2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-04-27 19:59:38 +00:00
|
|
|
|
2019-09-23 19:00:23 +00:00
|
|
|
#include <optional>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "Runtime/RetroTypes.hpp"
|
|
|
|
#include "Runtime/World/CActor.hpp"
|
|
|
|
#include "Runtime/World/CDamageInfo.hpp"
|
|
|
|
|
2022-12-08 02:02:33 +00:00
|
|
|
#include "Runtime/ConsoleVariables/CVar.hpp"
|
|
|
|
|
2019-09-23 19:00:23 +00:00
|
|
|
#include <zeus/CColor.hpp>
|
|
|
|
#include <zeus/CTransform.hpp>
|
|
|
|
#include <zeus/CVector3f.hpp>
|
2016-04-27 19:59:38 +00:00
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2018-12-08 05:30:43 +00:00
|
|
|
class CScriptSpecialFunction : public CActor {
|
2016-04-27 19:59:38 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
enum class ESpecialFunction {
|
|
|
|
What = 0,
|
|
|
|
PlayerFollowLocator = 1,
|
|
|
|
SpinnerController = 2,
|
|
|
|
ObjectFollowLocator = 3,
|
|
|
|
ChaffTarget = 4,
|
|
|
|
InventoryActivator = 5,
|
|
|
|
MapStation = 6,
|
|
|
|
SaveStation = 7,
|
|
|
|
IntroBossRingController = 8,
|
|
|
|
ViewFrustumTester = 9,
|
|
|
|
ShotSpinnerController = 10,
|
|
|
|
EscapeSequence = 11,
|
|
|
|
BossEnergyBar = 12,
|
|
|
|
EndGame = 13,
|
|
|
|
HUDFadeIn = 14,
|
|
|
|
CinematicSkip = 15,
|
|
|
|
ScriptLayerController = 16,
|
|
|
|
RainSimulator = 17,
|
|
|
|
AreaDamage = 18,
|
|
|
|
ObjectFollowObject = 19,
|
|
|
|
RedundantHintSystem = 20,
|
|
|
|
DropBomb = 21,
|
|
|
|
ScaleActor = 22,
|
|
|
|
MissileStation = 23,
|
|
|
|
Billboard = 24,
|
|
|
|
PlayerInAreaRelay = 25,
|
|
|
|
HUDTarget = 26,
|
|
|
|
FogFader = 27,
|
|
|
|
EnterLogbook = 28,
|
|
|
|
PowerBombStation = 29,
|
|
|
|
Ending = 30,
|
|
|
|
FusionRelay = 31,
|
|
|
|
WeaponSwitch = 32,
|
|
|
|
FogVolume = 47,
|
|
|
|
RadialDamage = 48,
|
|
|
|
EnvFxDensityController = 49,
|
|
|
|
RumbleEffect = 50
|
|
|
|
};
|
2016-04-27 19:59:38 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
enum class ESpinnerControllerMode {
|
|
|
|
Zero,
|
|
|
|
One,
|
|
|
|
};
|
2016-12-19 18:27:58 +00:00
|
|
|
|
2019-11-24 15:01:07 +00:00
|
|
|
enum class ERingState { Scramble, Rotate, Stopped, Breakup };
|
2019-03-09 08:58:27 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
struct SRingController {
|
|
|
|
TUniqueId x0_id;
|
2019-03-09 08:58:27 +00:00
|
|
|
float x4_rotateSpeed;
|
|
|
|
bool x8_reachedTarget;
|
2018-12-08 05:30:43 +00:00
|
|
|
zeus::CVector3f xc_;
|
2019-03-10 09:37:36 +00:00
|
|
|
SRingController(TUniqueId uid, float rotateSpeed, bool reachedTarget);
|
2018-12-08 05:30:43 +00:00
|
|
|
};
|
2016-12-19 18:27:58 +00:00
|
|
|
|
2016-04-27 19:59:38 +00:00
|
|
|
private:
|
2018-12-08 05:30:43 +00:00
|
|
|
ESpecialFunction xe8_function;
|
|
|
|
std::string xec_locatorName;
|
2019-03-09 08:58:27 +00:00
|
|
|
float xfc_float1;
|
|
|
|
float x100_float2;
|
|
|
|
float x104_float3;
|
|
|
|
float x108_float4;
|
|
|
|
zeus::CVector3f x10c_vector3f;
|
|
|
|
zeus::CColor x118_color;
|
2018-12-08 05:30:43 +00:00
|
|
|
CDamageInfo x11c_damageInfo;
|
|
|
|
float x138_ = 0.f;
|
2020-08-23 17:06:01 +00:00
|
|
|
zeus::CTransform x13c_spinnerInitialXf = zeus::CTransform();
|
2018-12-08 05:30:43 +00:00
|
|
|
float x16c_ = 0.f;
|
2019-06-11 03:09:38 +00:00
|
|
|
u16 x170_sfx1;
|
|
|
|
u16 x172_sfx2;
|
|
|
|
u16 x174_sfx3;
|
2018-12-08 05:30:43 +00:00
|
|
|
CSfxHandle x178_sfxHandle;
|
|
|
|
u32 x17c_;
|
|
|
|
float x180_ = 0.f;
|
2020-03-03 08:31:49 +00:00
|
|
|
TReservedAverage<float, 6> x184_;
|
2018-12-08 05:30:43 +00:00
|
|
|
float x194_ = 0.f;
|
|
|
|
std::vector<SRingController> x198_ringControllers;
|
2019-03-09 08:58:27 +00:00
|
|
|
ERingState x1a8_ringState = ERingState::Stopped;
|
|
|
|
zeus::CVector3f x1ac_ringRotateTarget = zeus::skZero3f;
|
|
|
|
bool x1b8_ringReverse = true;
|
2018-12-08 05:30:43 +00:00
|
|
|
s32 x1bc_areaSaveId;
|
|
|
|
s32 x1c0_layerIdx;
|
|
|
|
CPlayerState::EItemType x1c4_item;
|
2019-11-24 15:01:07 +00:00
|
|
|
std::optional<zeus::CAABox> x1c8_touchBounds;
|
2020-08-23 17:06:01 +00:00
|
|
|
bool x1e4_24_spinnerInitializedXf : 1 = false;
|
2020-04-20 04:57:50 +00:00
|
|
|
bool x1e4_25_spinnerCanMove : 1 = false;
|
|
|
|
bool x1e4_26_sfx2Played : 1 = true;
|
|
|
|
bool x1e4_27_sfx3Played : 1 = false;
|
|
|
|
bool x1e4_28_frustumEntered : 1 = false;
|
|
|
|
bool x1e4_29_frustumExited : 1 = false;
|
|
|
|
bool x1e4_30_ : 1 = false;
|
|
|
|
bool x1e4_31_inAreaDamage : 1 = false;
|
|
|
|
bool x1e5_24_doSave : 1 = false;
|
|
|
|
bool x1e5_25_playerInArea : 1 = false;
|
|
|
|
bool x1e5_26_displayBillboard : 1 = false;
|
2018-12-08 05:30:43 +00:00
|
|
|
TLockedToken<CTexture> x1e8_; // Used to be optional
|
2022-12-08 02:02:33 +00:00
|
|
|
std::optional<CVarValueReference<bool>> m_cvRef;
|
|
|
|
bool m_canSkipCutscenes = false;
|
|
|
|
|
2016-04-27 19:59:38 +00:00
|
|
|
public:
|
2021-05-26 14:00:57 +00:00
|
|
|
DEFINE_ENTITY
|
2018-12-08 05:30:43 +00:00
|
|
|
CScriptSpecialFunction(TUniqueId, std::string_view, const CEntityInfo&, const zeus::CTransform&, ESpecialFunction,
|
|
|
|
std::string_view, float, float, float, float, const zeus::CVector3f&, const zeus::CColor&,
|
|
|
|
bool, const CDamageInfo&, s32, s32, CPlayerState::EItemType, s16, s16, s16);
|
2016-12-19 18:27:58 +00:00
|
|
|
|
2019-08-09 12:45:18 +00:00
|
|
|
void Accept(IVisitor& visitor) override;
|
|
|
|
void Think(float, CStateManager&) override;
|
|
|
|
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override;
|
|
|
|
void PreRender(CStateManager&, const zeus::CFrustum&) override;
|
2020-04-05 11:54:02 +00:00
|
|
|
void AddToRenderer(const zeus::CFrustum&, CStateManager&) override;
|
2020-04-09 17:28:20 +00:00
|
|
|
void Render(CStateManager&) override;
|
2019-11-24 15:01:07 +00:00
|
|
|
std::optional<zeus::CAABox> GetTouchBounds() const override { return x1c8_touchBounds; }
|
2016-12-19 18:27:58 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void SkipCinematic(CStateManager&);
|
|
|
|
void RingScramble(CStateManager&);
|
|
|
|
void ThinkIntroBossRingController(float, CStateManager&);
|
|
|
|
void ThinkPlayerFollowLocator(float, CStateManager&);
|
|
|
|
void ThinkSpinnerController(float, CStateManager&, ESpinnerControllerMode);
|
|
|
|
void ThinkObjectFollowLocator(float, CStateManager&);
|
|
|
|
void ThinkObjectFollowObject(float, CStateManager&);
|
|
|
|
void ThinkChaffTarget(float, CStateManager&);
|
|
|
|
void ThinkActorScale(float, CStateManager&);
|
|
|
|
void ThinkSaveStation(float, CStateManager&);
|
|
|
|
void ThinkRainSimulator(float, CStateManager&);
|
|
|
|
void ThinkAreaDamage(float, CStateManager&);
|
|
|
|
void ThinkPlayerInArea(float, CStateManager&);
|
2017-02-18 02:19:50 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
bool ShouldSkipCinematic(CStateManager& stateMgr) const;
|
2018-05-20 05:01:17 +00:00
|
|
|
|
2022-10-09 17:07:51 +00:00
|
|
|
void DeleteEmitter(CSfxHandle& handle);
|
2023-10-22 16:21:20 +00:00
|
|
|
u32 ClassifyEnding(const CStateManager& mgr) const;
|
2020-03-03 08:31:49 +00:00
|
|
|
void AddOrUpdateEmitter(float pitch, CSfxHandle& handle, u16 id, const zeus::CVector3f& pos, float vol);
|
2016-04-27 19:59:38 +00:00
|
|
|
};
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|