2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2018-07-08 23:03:35 +00:00
|
|
|
|
2019-09-28 02:53:03 +00:00
|
|
|
#include <string_view>
|
|
|
|
|
|
|
|
#include "Runtime/Camera/CCameraShakeData.hpp"
|
2019-11-09 23:48:46 +00:00
|
|
|
#include "Runtime/Character/CBoneTracking.hpp"
|
|
|
|
#include "Runtime/Collision/CCollisionActorManager.hpp"
|
2019-09-28 02:53:03 +00:00
|
|
|
#include "Runtime/Weapon/CBeamInfo.hpp"
|
2019-11-09 23:48:46 +00:00
|
|
|
#include "Runtime/Weapon/CProjectileInfo.hpp"
|
2019-09-28 02:53:03 +00:00
|
|
|
#include "Runtime/World/CDamageInfo.hpp"
|
|
|
|
#include "Runtime/World/CPatterned.hpp"
|
2019-11-09 23:48:46 +00:00
|
|
|
#include "Runtime/World/CProjectedShadow.hpp"
|
2018-07-08 23:03:35 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
2019-11-09 23:48:46 +00:00
|
|
|
class CParticleElectric;
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace MP1 {
|
|
|
|
class CRidleyData {
|
2019-11-09 23:48:46 +00:00
|
|
|
friend class CRidley;
|
2018-12-08 05:30:43 +00:00
|
|
|
CAssetId x0_;
|
|
|
|
CAssetId x4_;
|
|
|
|
CAssetId x8_;
|
|
|
|
CAssetId xc_;
|
|
|
|
CAssetId x10_;
|
|
|
|
CAssetId x14_;
|
|
|
|
CAssetId x18_;
|
|
|
|
CAssetId x1c_;
|
|
|
|
CAssetId x20_;
|
|
|
|
CAssetId x24_;
|
|
|
|
CAssetId x28_;
|
|
|
|
CAssetId x2c_;
|
|
|
|
CAssetId x30_;
|
|
|
|
float x34_;
|
|
|
|
float x38_;
|
|
|
|
float x3c_;
|
|
|
|
float x40_;
|
|
|
|
CAssetId x44_;
|
|
|
|
CDamageInfo x48_;
|
|
|
|
CBeamInfo x64_;
|
|
|
|
u16 xa8_;
|
|
|
|
CAssetId xac_;
|
|
|
|
CDamageInfo xb0_;
|
|
|
|
CCameraShakeData xcc_;
|
|
|
|
CAssetId x1a0_;
|
|
|
|
CDamageInfo x1a4_;
|
|
|
|
CCameraShakeData x1c0_;
|
|
|
|
u16 x294_;
|
|
|
|
CDamageInfo x298_;
|
|
|
|
CCameraShakeData x2b4_;
|
|
|
|
float x388_;
|
|
|
|
float x38c_;
|
|
|
|
CDamageInfo x390_;
|
|
|
|
float x3ac_;
|
|
|
|
CDamageInfo x3b0_;
|
|
|
|
float x3cc_;
|
|
|
|
CDamageInfo x3d0_;
|
|
|
|
float x3ec_;
|
|
|
|
CAssetId x3f0_;
|
|
|
|
float x3f4_;
|
|
|
|
u16 x3f8_;
|
|
|
|
CDamageInfo x3fc_;
|
|
|
|
|
2018-07-08 23:03:35 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CRidleyData(CInputStream&, u32);
|
2018-07-08 23:03:35 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CRidley : public CPatterned {
|
2019-11-09 23:48:46 +00:00
|
|
|
CRidleyData x568_data;
|
2019-11-12 20:25:21 +00:00
|
|
|
std::unique_ptr<CCollisionActorManager> x980_tailCollision;
|
|
|
|
std::unique_ptr<CCollisionActorManager> x984_bodyCollision;
|
2019-11-09 23:48:46 +00:00
|
|
|
TUniqueId x988_headId = kInvalidUniqueId;
|
|
|
|
TUniqueId x98a_breastPlateId = kInvalidUniqueId;
|
2019-11-12 20:25:21 +00:00
|
|
|
TLockedToken<CGenDescription> x98c_;
|
2019-11-09 23:48:46 +00:00
|
|
|
CModelData x998_;
|
|
|
|
CModelData x9e4_;
|
|
|
|
CSegId xa30_breastPlateSegId;
|
2020-04-21 07:22:41 +00:00
|
|
|
bool xa31_24_ : 1 = true;
|
|
|
|
bool xa31_25_ : 1 = true;
|
|
|
|
bool xa31_26_ : 1 = false;
|
|
|
|
bool xa31_27_ : 1 = false;
|
|
|
|
bool xa31_28_ : 1 = false;
|
|
|
|
bool xa31_29_ : 1 = false;
|
|
|
|
bool xa31_30_ : 1 = false;
|
|
|
|
bool xa31_31_ : 1 = false;
|
|
|
|
bool xa32_24_ : 1 = false;
|
|
|
|
bool xa32_25_ : 1 = false;
|
|
|
|
bool xa32_26_ : 1 = false;
|
|
|
|
bool xa32_27_ : 1 = false;
|
|
|
|
bool xa32_28_shotAt : 1 = false;
|
|
|
|
bool xa32_29_ : 1 = false;
|
|
|
|
bool xa32_30_ : 1 = false;
|
|
|
|
bool xa32_31_ : 1 = true;
|
|
|
|
bool xa33_24_ : 1 = false;
|
|
|
|
bool xa33_25_ : 1 = true;
|
|
|
|
bool xa33_26_ : 1 = false;
|
|
|
|
bool xa33_27_ : 1 = true;
|
|
|
|
bool xa33_28_ : 1 = false;
|
|
|
|
bool xa33_29_doStrafe : 1 = false;
|
|
|
|
bool xa33_30_ : 1 = false;
|
|
|
|
bool xa33_31_ : 1 = false;
|
|
|
|
bool xa34_24_ : 1 = false;
|
|
|
|
bool xa34_25_ : 1 = false;
|
|
|
|
bool xa34_26_ : 1 = false;
|
2019-11-09 23:48:46 +00:00
|
|
|
CModelData xa38_;
|
|
|
|
zeus::CTransform xa84_;
|
|
|
|
float xab4_ = 20.f;
|
|
|
|
float xab8_ = 12.f;
|
|
|
|
float xabc_ = 40.f;
|
2020-05-13 13:20:40 +00:00
|
|
|
float xac0_ = 10.f;
|
2019-11-09 23:48:46 +00:00
|
|
|
zeus::CAABox xac4_ = zeus::skInvertedBox;
|
|
|
|
float xadc_;
|
|
|
|
float xae0_;
|
2020-05-13 13:20:40 +00:00
|
|
|
float xae4_;
|
2019-11-09 23:48:46 +00:00
|
|
|
float xae8_;
|
|
|
|
zeus::CVector3f xaec_;
|
|
|
|
zeus::CVector3f xaf8_;
|
2019-11-12 20:25:21 +00:00
|
|
|
s32 xb04_ = 2;
|
2019-11-09 23:48:46 +00:00
|
|
|
u32 xb08_;
|
|
|
|
u32 xb0c_ = 0;
|
|
|
|
float xb10_ = 0.f;
|
|
|
|
float xb14_;
|
|
|
|
float xb18_;
|
|
|
|
float xb1c_;
|
|
|
|
float xb20_ = 0.f;
|
|
|
|
float xb24_ = 0.f;
|
|
|
|
CSegId xb28_;
|
|
|
|
CBoneTracking xb2c_;
|
2019-11-12 20:25:21 +00:00
|
|
|
TUniqueId xb64_plasmaProjectile = kInvalidUniqueId;
|
2019-11-09 23:48:46 +00:00
|
|
|
CProjectileInfo xb68_;
|
|
|
|
CSegId xb90_headSegId;
|
|
|
|
CSegId xb91_mouthSegId;
|
|
|
|
u8 xb92_;
|
|
|
|
u8 xb93_;
|
|
|
|
zeus::CTransform xb94_;
|
|
|
|
zeus::CVector3f xbc4_;
|
|
|
|
zeus::CVector3f xbd0_;
|
2019-11-12 20:25:21 +00:00
|
|
|
float xbdc_;
|
|
|
|
float xbe0_;
|
2019-11-09 23:48:46 +00:00
|
|
|
zeus::CVector3f xbe4_;
|
|
|
|
zeus::CVector3f xbf0_ = zeus::skForward;
|
2019-11-12 20:25:21 +00:00
|
|
|
zeus::CVector3f xbfc_;
|
2019-11-09 23:48:46 +00:00
|
|
|
float xc08_ = 0.f;
|
|
|
|
float xc0c_ = 0.f;
|
|
|
|
float xc10_ = 120.f;
|
|
|
|
CProjectileInfo xc14_;
|
|
|
|
CProjectileInfo xc3c_;
|
|
|
|
u32 xc64_aiStage = 2;
|
|
|
|
zeus::CVector3f xc68_;
|
|
|
|
u32 xc74_ = 0;
|
|
|
|
float xc78_ = 0.f;
|
|
|
|
float xc7c_ = 0.f;
|
|
|
|
float xc80_ = 0.f;
|
|
|
|
u32 xc84_;
|
|
|
|
u32 xc88_ = 4;
|
|
|
|
CDamageInfo xc8c_;
|
2019-11-12 20:25:21 +00:00
|
|
|
CSfxHandle xca8_;
|
|
|
|
CSfxHandle xcac_ = 0;
|
2019-11-09 23:48:46 +00:00
|
|
|
u32 xcb0_ = 0;
|
|
|
|
u32 xcb4_ = 0;
|
|
|
|
float xcb8_ = 0.f;
|
|
|
|
float xcbc_ = 0.f;
|
|
|
|
u32 xcc0_ = 1;
|
|
|
|
u32 xcc4_ = 1;
|
|
|
|
float xcc8_ = 0.f;
|
2019-11-12 20:25:21 +00:00
|
|
|
float xccc_;
|
2019-11-09 23:48:46 +00:00
|
|
|
TLockedToken<CElectricDescription> xcd0_;
|
|
|
|
std::unique_ptr<CParticleElectric> xce0_;
|
2019-11-12 20:25:21 +00:00
|
|
|
std::vector<CSegId> xce4_wingBoneIds; // was rstl::reserved_vector<CSegId, 30>
|
2019-11-09 23:48:46 +00:00
|
|
|
float xd08_;
|
|
|
|
CSfxHandle xd0c_;
|
|
|
|
std::unique_ptr<CProjectedShadow> xd10_;
|
|
|
|
u32 xd14_;
|
|
|
|
|
|
|
|
void SetupCollisionActorManager(CStateManager& mgr);
|
|
|
|
void SetupCollisionActors(CStateManager& mgr);
|
|
|
|
|
|
|
|
void sub80257650(CStateManager& mgr);
|
|
|
|
void sub80256914(float f1, bool r4);
|
|
|
|
void sub802560d0(float dt);
|
|
|
|
void sub802563a8(float dt);
|
|
|
|
void sub80256b14(float dt, CStateManager& mgr);
|
|
|
|
void sub80256624(float dt, CStateManager& mgr);
|
2019-11-12 20:25:21 +00:00
|
|
|
void ResetPlasmaProjectile(CStateManager& mgr, bool b1);
|
|
|
|
void sub80255fe8(float f1, float f2, const zeus::CVector3f& vec);
|
|
|
|
void sub80255e5c(CStateManager& mgr);
|
|
|
|
void sub8025784c(CStateManager& mgr);
|
|
|
|
void sub80255d58(CStateManager& mgr);
|
|
|
|
void sub80257744(CStateManager& mgr);
|
|
|
|
void FirePlasma(CStateManager& mgr);
|
|
|
|
void FacePlayer(float arg, CStateManager& mgr);
|
|
|
|
void SetSphereCollisionRadius(float f1, CStateManager& mgr);
|
|
|
|
void sub80256580() {
|
|
|
|
if (!xa31_24_)
|
|
|
|
x3b4_speed = 1.2f;
|
|
|
|
}
|
2018-12-08 05:30:43 +00:00
|
|
|
|
2019-11-14 16:39:20 +00:00
|
|
|
void sub80253710(CStateManager& mgr);
|
|
|
|
bool sub80253960() {
|
2020-05-13 13:20:40 +00:00
|
|
|
const float mag = ((GetTranslation() + ((0.5f * xae4_) * GetTransform().frontVector())) - xa84_.origin).magnitude();
|
|
|
|
return mag < 0.5f * (xab4_ + xabc_);
|
2019-11-14 16:39:20 +00:00
|
|
|
}
|
|
|
|
|
2018-07-08 23:03:35 +00:00
|
|
|
public:
|
2020-08-23 19:03:33 +00:00
|
|
|
DEFINE_PATTERNED(Ridley);
|
2018-12-08 05:30:43 +00:00
|
|
|
CRidley(TUniqueId, std::string_view, const CEntityInfo&, const zeus::CTransform&, CModelData&&, const CPatternedInfo&,
|
|
|
|
const CActorParameters&, CInputStream&, u32);
|
2019-11-09 23:48:46 +00:00
|
|
|
|
|
|
|
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) override;
|
|
|
|
void Think(float dt, CStateManager& mgr) override;
|
|
|
|
void PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) override;
|
2020-04-09 17:28:20 +00:00
|
|
|
void Render(CStateManager& mgr) override;
|
2020-04-05 11:54:02 +00:00
|
|
|
void AddToRenderer(const zeus::CFrustum& frustum, CStateManager& mgr) override;
|
2019-11-19 23:06:25 +00:00
|
|
|
zeus::CAABox GetSortingBounds(const CStateManager&) const override { return GetBoundingBox(); }
|
2019-11-09 23:48:46 +00:00
|
|
|
const CDamageVulnerability* GetDamageVulnerability() const override {
|
|
|
|
return &CDamageVulnerability::ImmuneVulnerabilty();
|
|
|
|
}
|
|
|
|
|
|
|
|
zeus::CVector3f GetAimPosition(const CStateManager& mgr, float dt) const override {
|
2019-11-12 20:25:21 +00:00
|
|
|
return GetLctrTransform((xc64_aiStage == 3 && !xa32_28_shotAt) ? xb90_headSegId : xa30_breastPlateSegId).origin;
|
2019-11-09 23:48:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
float GetGravityConstant() const override { return 50.f; }
|
|
|
|
EWeaponCollisionResponseTypes GetCollisionResponseType(const zeus::CVector3f&, const zeus::CVector3f&,
|
|
|
|
const CWeaponMode&, EProjectileAttrib) const override {
|
|
|
|
return EWeaponCollisionResponseTypes::EnemyNormal;
|
|
|
|
}
|
|
|
|
|
2019-11-12 20:25:21 +00:00
|
|
|
void DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, EUserEventType type, float dt) override;
|
2019-11-09 23:48:46 +00:00
|
|
|
void Patrol(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void Dead(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void Generate(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void Attack(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void LoopedAttack(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void JumpBack(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void DoubleSnap(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void CoverAttack(CStateManager& mgr, EStateMsg msg, float arg) override;
|
2019-11-12 20:25:21 +00:00
|
|
|
void Crouch(CStateManager& mgr, EStateMsg msg, float arg) override;
|
2019-11-09 23:48:46 +00:00
|
|
|
void FadeOut(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void Taunt(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void Flee(CStateManager& mgr, EStateMsg msg, float arg) override;
|
2019-11-12 20:25:21 +00:00
|
|
|
void Lurk(CStateManager& mgr, EStateMsg msg, float arg) override;
|
2019-11-09 23:48:46 +00:00
|
|
|
void ProjectileAttack(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void Flinch(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void Hurled(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void TelegraphAttack(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void Jump(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void Explode(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void Dodge(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void Retreat(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void Approach(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void Enraged(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void SpecialAttack(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void Land(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
bool Attacked(CStateManager& mgr, float arg) override;
|
|
|
|
bool TooClose(CStateManager& mgr, float arg) override;
|
|
|
|
bool InRange(CStateManager& mgr, float arg) override;
|
|
|
|
bool ShouldAttack(CStateManager& mgr, float arg) override;
|
|
|
|
bool ShouldDoubleSnap(CStateManager& mgr, float arg) override;
|
|
|
|
bool ShouldTurn(CStateManager& mgr, float arg) override;
|
|
|
|
bool HitSomething(CStateManager& mgr, float arg) override;
|
|
|
|
bool AttackOver(CStateManager& mgr, float arg) override;
|
|
|
|
bool ShouldTaunt(CStateManager& mgr, float arg) override;
|
|
|
|
bool ShouldFire(CStateManager& mgr, float arg) override;
|
|
|
|
bool ShouldDodge(CStateManager& mgr, float arg) override;
|
|
|
|
bool ShouldRetreat(CStateManager& mgr, float arg) override;
|
|
|
|
bool ShouldCrouch(CStateManager& mgr, float arg) override;
|
2019-11-14 16:39:20 +00:00
|
|
|
bool ShouldMove(CStateManager& mgr, float arg) override;
|
2019-11-09 23:48:46 +00:00
|
|
|
bool ShotAt(CStateManager& mgr, float arg) override;
|
|
|
|
bool SetAIStage(CStateManager& mgr, float arg) override;
|
|
|
|
bool AIStage(CStateManager& mgr, float arg) override;
|
|
|
|
bool ShouldStrafe(CStateManager& mgr, float arg) override;
|
|
|
|
bool IsDizzy(CStateManager& mgr, float arg) override;
|
2018-07-08 23:03:35 +00:00
|
|
|
};
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace MP1
|
|
|
|
} // namespace urde
|