2020-03-31 18:17:47 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Runtime/MP1/World/CElitePirate.hpp"
|
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce::MP1 {
|
2020-03-31 18:17:47 +00:00
|
|
|
class COmegaPirate : public CElitePirate {
|
|
|
|
private:
|
|
|
|
class CFlash : public CActor {
|
|
|
|
private:
|
2022-05-24 00:26:35 +00:00
|
|
|
TToken<CTexture> xe8_thermalSpotToken;
|
|
|
|
CTexture* xf0_thermalSpot = nullptr;
|
2020-04-19 06:47:25 +00:00
|
|
|
float xf4_delay;
|
2020-04-20 07:20:22 +00:00
|
|
|
float xf8_time = 0.f;
|
|
|
|
float xfc_size = 0.f;
|
2020-03-31 18:17:47 +00:00
|
|
|
|
2020-04-02 06:15:23 +00:00
|
|
|
public:
|
2021-05-26 14:00:57 +00:00
|
|
|
DEFINE_ENTITY
|
2020-04-19 06:47:25 +00:00
|
|
|
CFlash(TUniqueId uid, const CEntityInfo& info, const zeus::CVector3f& pos, TLockedToken<CTexture>& thermalSpot,
|
|
|
|
float delay);
|
2020-04-02 06:15:23 +00:00
|
|
|
|
|
|
|
void Accept(IVisitor& visitor) override;
|
2020-04-19 06:47:25 +00:00
|
|
|
void Think(float dt, CStateManager& mgr) override;
|
|
|
|
void PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) override;
|
|
|
|
void AddToRenderer(const zeus::CFrustum& frustum, CStateManager& mgr) override;
|
|
|
|
void Render(CStateManager& mgr) override;
|
2020-03-31 18:17:47 +00:00
|
|
|
};
|
|
|
|
|
2020-04-02 06:15:23 +00:00
|
|
|
TUniqueId x990_launcherId2 = kInvalidUniqueId;
|
2020-04-20 06:14:17 +00:00
|
|
|
enum class ENormalFadeState {
|
2020-04-19 23:26:25 +00:00
|
|
|
Zero,
|
|
|
|
One,
|
|
|
|
Two,
|
|
|
|
Three,
|
2020-04-20 06:14:17 +00:00
|
|
|
} x994_normalFadeState = ENormalFadeState::Zero;
|
|
|
|
float x998_normalFadeTime = 0.f;
|
|
|
|
float x99c_normalAlpha = 1.f;
|
2020-04-19 23:26:25 +00:00
|
|
|
bool x9a0_visible = true;
|
|
|
|
bool x9a1_fadeIn = true;
|
2020-04-02 21:24:59 +00:00
|
|
|
std::vector<std::pair<TUniqueId, std::vector<TUniqueId>>> x9a4_scriptWaypointPlatforms;
|
2020-05-07 23:13:43 +00:00
|
|
|
bool x9b4_lostAllHp = false;
|
2020-04-02 21:24:59 +00:00
|
|
|
std::vector<std::pair<TUniqueId, std::string_view>> x9b8_scriptEffects;
|
2020-04-19 23:26:25 +00:00
|
|
|
enum class EScaleState {
|
2020-04-20 06:14:17 +00:00
|
|
|
None,
|
|
|
|
ScaleDownX,
|
|
|
|
ScaleDownY,
|
|
|
|
ScaleDownZ,
|
|
|
|
WaitForTrigger,
|
|
|
|
ScaleUpX,
|
|
|
|
ScaleUpY,
|
|
|
|
ScaleUpZ,
|
|
|
|
} x9c8_scaleState = EScaleState::None;
|
2020-04-19 23:26:25 +00:00
|
|
|
float x9cc_scaleTime = 0.f;
|
|
|
|
zeus::CVector3f x9d0_initialScale;
|
2020-04-02 21:24:59 +00:00
|
|
|
std::vector<std::pair<TUniqueId, std::string_view>> x9dc_scriptPlatforms;
|
2020-04-20 06:14:17 +00:00
|
|
|
bool x9ec_decrement = false;
|
2020-04-19 23:26:25 +00:00
|
|
|
CSkinnedModel x9f0_skeletonModel;
|
|
|
|
float xa2c_skeletonAlpha = 0.f;
|
2020-04-20 06:14:17 +00:00
|
|
|
enum class ESkeletonFadeState {
|
|
|
|
None,
|
|
|
|
FadeOut,
|
|
|
|
Flash,
|
|
|
|
FadeIn,
|
|
|
|
} xa30_skeletonFadeState = ESkeletonFadeState::None;
|
2020-04-19 23:26:25 +00:00
|
|
|
float xa34_skeletonStateTime = 0.f;
|
2020-04-02 21:24:59 +00:00
|
|
|
std::unique_ptr<CCollisionActorManager> xa38_collisionActorMgr1;
|
2020-04-02 06:15:23 +00:00
|
|
|
bool xa3c_hearPlayer = false;
|
2020-04-19 23:26:25 +00:00
|
|
|
pas::ELocomotionType xa40_locomotionType = pas::ELocomotionType::Relaxed;
|
2020-04-20 06:14:17 +00:00
|
|
|
bool xa44_targetable = false;
|
2020-04-02 06:15:23 +00:00
|
|
|
TUniqueId xa46_ = kInvalidUniqueId;
|
|
|
|
TUniqueId xa48_ = kInvalidUniqueId;
|
2020-04-20 06:14:17 +00:00
|
|
|
bool xa4a_heartVisible = false;
|
2020-04-02 21:24:59 +00:00
|
|
|
zeus::CTransform xa4c_initialXf;
|
2020-04-20 06:14:17 +00:00
|
|
|
enum class EXRayFadeState {
|
|
|
|
None,
|
|
|
|
FadeIn,
|
|
|
|
WaitForTrigger,
|
|
|
|
FadeOut,
|
|
|
|
} xa7c_xrayAlphaState = EXRayFadeState::None;
|
2020-04-19 23:26:25 +00:00
|
|
|
float xa80_xrayAlpha = 1.f;
|
|
|
|
float xa84_xrayAlphaStateTime = 0.f;
|
2020-04-20 06:14:17 +00:00
|
|
|
bool xa88_xrayFadeInTrigger = false;
|
2020-05-07 23:13:43 +00:00
|
|
|
float xa8c_xrayFadeOutTime = 3.f;
|
|
|
|
float xa90_xrayFadeInTime = 1.f;
|
|
|
|
float xa94_xrayFadeTriggerTime = 1.f;
|
2020-04-02 06:15:23 +00:00
|
|
|
float xa98_maxEnergy = 0.f;
|
2020-04-02 21:24:59 +00:00
|
|
|
std::unique_ptr<CCollisionActorManager> xa9c_collisionActorMgr2;
|
|
|
|
std::vector<std::pair<TUniqueId, std::string_view>> xaa0_scriptSounds;
|
2020-04-02 06:15:23 +00:00
|
|
|
float xab0_ = 0.f;
|
2020-04-04 06:08:16 +00:00
|
|
|
std::vector<u32> xab4_;
|
2020-04-02 06:15:23 +00:00
|
|
|
int xac4_ = 0;
|
|
|
|
int xac8_ = 0;
|
|
|
|
int xacc_ = 0;
|
2020-04-20 06:14:17 +00:00
|
|
|
bool xad0_scaleUpTrigger = false;
|
2020-04-02 06:15:23 +00:00
|
|
|
float xad4_cachedSpeed = 1.f;
|
|
|
|
bool xad8_cover = false;
|
2020-04-20 06:14:17 +00:00
|
|
|
TUniqueId xada_lastWaypointId = kInvalidUniqueId;
|
2020-05-07 23:13:43 +00:00
|
|
|
// bool xadc_ = false;
|
|
|
|
// bool xadd_ = false;
|
2020-04-20 06:14:17 +00:00
|
|
|
u8 xade_armorPiecesDestroyed = 0;
|
2020-04-19 23:26:25 +00:00
|
|
|
bool xadf_launcher1FollowPlayer = true;
|
|
|
|
bool xae0_launcher2FollowPlayer = true;
|
2020-04-02 21:24:59 +00:00
|
|
|
CDamageVulnerability xae4_platformVuln = CDamageVulnerability::NormalVulnerabilty();
|
2020-04-20 06:14:17 +00:00
|
|
|
int xb4c_armorPiecesHealed = 0;
|
2020-05-07 23:13:43 +00:00
|
|
|
float xb50_armorPieceHealTime = 0.f;
|
2020-04-02 21:24:59 +00:00
|
|
|
zeus::CColor xb54_platformColor = zeus::skWhite;
|
2020-05-07 23:13:43 +00:00
|
|
|
float xb58_healTime = 2.5f;
|
|
|
|
float xb5c_hpLost = 0.f;
|
|
|
|
float xb60_hpLostInPhase = 0.f;
|
|
|
|
float xb64_stateTime = 17.f;
|
2020-04-02 06:15:23 +00:00
|
|
|
int xb68_ = 0;
|
2020-05-07 23:13:43 +00:00
|
|
|
bool xb6c_exit1Sent = false;
|
|
|
|
bool xb6d_exit2Sent = false;
|
|
|
|
bool xb6e_armorPieceActivated = false;
|
2020-04-02 06:15:23 +00:00
|
|
|
TLockedToken<CTexture> xb70_thermalSpot; // was TToken<CTexture>
|
2020-04-20 06:14:17 +00:00
|
|
|
bool xb78_codeTrigger = false;
|
2020-05-07 23:13:43 +00:00
|
|
|
bool xb79_bossPhaseActive = false;
|
2020-04-02 06:15:23 +00:00
|
|
|
std::vector<u8> xb7c_;
|
2020-05-07 23:13:43 +00:00
|
|
|
float xb8c_avoidStaticCollisionTime = 0.f; // not initialized in ctr
|
2020-04-02 06:15:23 +00:00
|
|
|
|
2020-03-31 18:17:47 +00:00
|
|
|
public:
|
2021-05-26 14:00:57 +00:00
|
|
|
DEFINE_ENTITY
|
2020-03-31 18:17:47 +00:00
|
|
|
COmegaPirate(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
|
|
|
|
CModelData&& mData, const CPatternedInfo& pInfo, const CActorParameters& actParms, CElitePirateData data,
|
2020-06-01 02:05:48 +00:00
|
|
|
CAssetId skeletonModelId, CAssetId skeletonSkinRulesId, CAssetId skeletonLayoutInfoId);
|
2020-04-02 06:15:23 +00:00
|
|
|
|
|
|
|
void Think(float dt, CStateManager& mgr) override;
|
|
|
|
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) override;
|
|
|
|
void PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) override;
|
2020-04-10 00:15:25 +00:00
|
|
|
void Render(CStateManager& mgr) override;
|
2020-04-02 06:15:23 +00:00
|
|
|
zeus::CVector3f GetOrbitPosition(const CStateManager& mgr) const override;
|
|
|
|
void DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, EUserEventType type, float dt) override;
|
|
|
|
void PathFind(CStateManager& mgr, EStateMsg msg, float dt) override;
|
|
|
|
void TargetPatrol(CStateManager& mgr, EStateMsg msg, float dt) override;
|
|
|
|
void Run(CStateManager& mgr, EStateMsg msg, float dt) override;
|
|
|
|
void Attack(CStateManager& mgr, EStateMsg msg, float dt) override;
|
|
|
|
void JumpBack(CStateManager& mgr, EStateMsg msg, float dt) override;
|
|
|
|
void DoubleSnap(CStateManager& mgr, EStateMsg msg, float dt) override;
|
|
|
|
void Shuffle(CStateManager& mgr, EStateMsg msg, float dt) override;
|
|
|
|
void Skid(CStateManager& mgr, EStateMsg msg, float dt) override;
|
|
|
|
void Suck(CStateManager& mgr, EStateMsg msg, float dt) override;
|
|
|
|
void Explode(CStateManager& mgr, EStateMsg msg, float dt) override;
|
|
|
|
void Retreat(CStateManager& mgr, EStateMsg msg, float dt) override;
|
|
|
|
void Cover(CStateManager& mgr, EStateMsg msg, float dt) override;
|
|
|
|
void WallHang(CStateManager& mgr, EStateMsg msg, float dt) override;
|
|
|
|
void WallDetach(CStateManager& mgr, EStateMsg msg, float dt) override;
|
|
|
|
void Enraged(CStateManager& mgr, EStateMsg msg, float dt) override;
|
|
|
|
void Growth(CStateManager& mgr, EStateMsg msg, float dt) override;
|
|
|
|
void Faint(CStateManager& mgr, EStateMsg msg, float dt) override;
|
|
|
|
void Dizzy(CStateManager& mgr, EStateMsg msg, float dt) override;
|
|
|
|
|
|
|
|
bool Landed(CStateManager& mgr, float arg) override;
|
|
|
|
bool HearPlayer(CStateManager& mgr, float arg) override;
|
|
|
|
bool CoverBlown(CStateManager& mgr, float arg) override;
|
|
|
|
bool AggressionCheck(CStateManager& mgr, float arg) override;
|
|
|
|
bool ShouldFire(CStateManager& mgr, float arg) override;
|
|
|
|
bool ShouldMove(CStateManager& mgr, float arg) override;
|
|
|
|
bool ShotAt(CStateManager& mgr, float arg) override;
|
|
|
|
bool CodeTrigger(CStateManager& mgr, float arg) override;
|
|
|
|
bool ShouldCallForBackup(CStateManager& mgr, float arg) override;
|
|
|
|
bool HasWeakPointHead() const override { return false; }
|
|
|
|
bool IsElitePirate() const override { return false; }
|
|
|
|
void SetupHealthInfo(CStateManager& mgr) override;
|
|
|
|
void SetLaunchersActive(CStateManager& mgr, bool val) override;
|
|
|
|
SShockWaveData GetShockWaveData() const override {
|
2020-05-07 23:13:43 +00:00
|
|
|
return {GetData().GetShockwaveParticleDescId(), GetData().GetShockwaveDamageInfo(), 24.78255f,
|
|
|
|
GetData().GetShockwaveWeaponDescId(), GetData().GetShockwaveElectrocuteSfxId()};
|
2020-04-02 06:15:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
void CreateFlash(CStateManager& mgr, float arg);
|
2020-04-02 21:24:59 +00:00
|
|
|
void SetupCollisionManager(CStateManager& mgr);
|
|
|
|
void AddSphereCollisionList(const SSphereJointInfo* joints, size_t count,
|
|
|
|
std::vector<CJointCollisionDescription>& outJoints) const;
|
|
|
|
void AddOBBAutoSizeCollisionList(const SOBBJointInfo* joints, size_t count,
|
2020-04-19 06:47:25 +00:00
|
|
|
std::vector<CJointCollisionDescription>& outJoints) const;
|
2020-04-02 21:24:59 +00:00
|
|
|
void SetupCollisionActorInfo1(const std::unique_ptr<CCollisionActorManager>& actMgr, CStateManager& mgr);
|
|
|
|
void SetupCollisionActorInfo2(const std::unique_ptr<CCollisionActorManager>& actMgr, CStateManager& mgr);
|
2020-04-04 06:08:16 +00:00
|
|
|
void sub_8028cbec(u32 arg, CStateManager& mgr);
|
2020-04-05 05:36:58 +00:00
|
|
|
u8 sub_8028c230() const;
|
2020-04-04 06:08:16 +00:00
|
|
|
u8 sub_8028bfac() const;
|
2020-04-05 05:36:58 +00:00
|
|
|
void TeleportToFurthestPlatform(CStateManager& mgr);
|
2020-04-20 06:14:17 +00:00
|
|
|
void UpdateNormalAlpha(CStateManager& mgr, float dt);
|
2020-04-05 05:36:58 +00:00
|
|
|
void sub_8028c704(CStateManager& mgr, float dt);
|
2020-04-19 23:26:25 +00:00
|
|
|
void UpdateXRayAlpha(CStateManager& mgr, float dt);
|
|
|
|
void UpdateScale(CStateManager& mgr, float dt);
|
2020-04-20 06:14:17 +00:00
|
|
|
void UpdateSkeletonAlpha(CStateManager& mgr, float dt);
|
2020-04-19 23:26:25 +00:00
|
|
|
void DeathDestroy(CStateManager& mgr);
|
2020-04-05 05:36:58 +00:00
|
|
|
void sub_8028c840(u32 arg, CStateManager& mgr);
|
|
|
|
zeus::CVector3f FindGround(const zeus::CVector3f& pos, CStateManager& mgr) const;
|
2020-03-31 18:17:47 +00:00
|
|
|
};
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce::MP1
|