2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2017-02-21 03:29:28 +00:00
|
|
|
|
2019-09-23 19:00:23 +00:00
|
|
|
#include <memory>
|
|
|
|
#include <string_view>
|
|
|
|
|
|
|
|
#include "Runtime/CPlayerState.hpp"
|
|
|
|
#include "Runtime/RetroTypes.hpp"
|
|
|
|
#include "Runtime/World/CScriptActor.hpp"
|
2016-09-25 16:45:22 +00:00
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2018-12-08 05:30:43 +00:00
|
|
|
class CScriptPlayerActor : public CScriptActor {
|
|
|
|
CAnimRes x2e8_suitRes;
|
|
|
|
CPlayerState::EBeamId x304_beam;
|
|
|
|
CPlayerState::EPlayerSuit x308_suit = CPlayerState::EPlayerSuit::Invalid;
|
|
|
|
CPlayerState::EBeamId x30c_setBeamId = CPlayerState::EBeamId::Invalid;
|
|
|
|
s32 x310_loadedCharIdx = -1;
|
|
|
|
std::unique_ptr<CModelData> x314_beamModelData;
|
|
|
|
std::unique_ptr<CModelData> x318_suitModelData;
|
|
|
|
TLockedToken<CModel> x31c_beamModel; // Used to be single_ptr
|
|
|
|
TLockedToken<CModel> x320_suitModel; // Used to be single_ptr
|
|
|
|
TLockedToken<CSkinRules> x324_suitSkin; // Used to be single_ptr
|
|
|
|
TLockedToken<CSkinnedModel> x328_backupModelData; // Used to be optional
|
|
|
|
TLockedToken<CTexture> x338_phazonIndirectTexture; // Used to be optional
|
|
|
|
u32 x348_deallocateBackupCountdown = 0;
|
|
|
|
float x34c_phazonOffsetAngle = 0.f;
|
|
|
|
u32 x350_flags; /* 0x1: suit transition, 0x2: previous suit, 0x4: force reset
|
|
|
|
* 0x8: track in area data, 0x10: keep in state manager */
|
2020-04-11 05:50:10 +00:00
|
|
|
bool x354_24_setBoundingBox : 1;
|
2020-04-20 04:57:50 +00:00
|
|
|
bool x354_25_deferOnlineModelData : 1 = false;
|
|
|
|
bool x354_26_deferOfflineModelData : 1 = false;
|
|
|
|
bool x354_27_beamModelLoading : 1 = false;
|
|
|
|
bool x354_28_suitModelLoading : 1 = false;
|
|
|
|
bool x354_29_loading : 1 = true;
|
|
|
|
bool x354_30_enableLoading : 1 = true;
|
|
|
|
bool x354_31_deferOnlineLoad : 1 = false;
|
|
|
|
bool x355_24_areaTrackingLoad : 1 = false;
|
2018-12-08 05:30:43 +00:00
|
|
|
TUniqueId x356_nextPlayerActor = kInvalidUniqueId;
|
2017-02-21 03:29:28 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
u32 GetSuitCharIdx(const CStateManager& mgr, CPlayerState::EPlayerSuit suit) const;
|
|
|
|
u32 GetNextSuitCharIdx(const CStateManager& mgr) const;
|
|
|
|
void LoadSuit(u32 charIdx);
|
|
|
|
void LoadBeam(CPlayerState::EBeamId beam);
|
|
|
|
void PumpBeamModel(CStateManager& mgr);
|
|
|
|
void BuildBeamModelData();
|
|
|
|
void PumpSuitModel(CStateManager& mgr);
|
|
|
|
void SetupOfflineModelData();
|
|
|
|
void SetupOnlineModelData();
|
2018-05-14 04:38:58 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void SetupEnvFx(CStateManager& mgr, bool set);
|
|
|
|
void SetIntoStateManager(CStateManager& mgr, bool set);
|
2018-05-14 04:38:58 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void TouchModels_Internal(const CStateManager& mgr) const;
|
2018-05-13 23:27:47 +00:00
|
|
|
|
2016-09-25 16:45:22 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CScriptPlayerActor(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
|
|
|
|
const CAnimRes& animRes, CModelData&& mData, const zeus::CAABox& aabox, bool setBoundingBox,
|
|
|
|
const CMaterialList& list, float mass, float zMomentum, const CHealthInfo& hInfo,
|
|
|
|
const CDamageVulnerability& dVuln, const CActorParameters& aParams, bool loop, bool active,
|
|
|
|
u32 flags, CPlayerState::EBeamId beam);
|
2017-02-21 03:29:28 +00:00
|
|
|
|
2019-08-09 12:45:18 +00:00
|
|
|
void Think(float, CStateManager&) override;
|
|
|
|
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override;
|
|
|
|
void SetActive(bool active) 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& mgr) override;
|
2018-12-08 05:30:43 +00:00
|
|
|
void TouchModels(const CStateManager& mgr) const;
|
2016-09-25 16:45:22 +00:00
|
|
|
};
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|