More CRidley imps

This commit is contained in:
Phillip Stephens 2019-11-12 12:25:21 -08:00
parent 3b101267f8
commit a1c7692d36
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
11 changed files with 1082 additions and 163 deletions

View File

@ -1,5 +1,6 @@
#include "CSfxManager.hpp" #include "Runtime/Audio/CSfxManager.hpp"
#include "CSimplePool.hpp"
#include "Runtime/CSimplePool.hpp"
namespace urde { namespace urde {
static TLockedToken<std::vector<u16>> mpSfxTranslationTableTok; static TLockedToken<std::vector<u16>> mpSfxTranslationTableTok;

View File

@ -1,64 +1,56 @@
#include "CStateManager.hpp" #include "Runtime/CStateManager.hpp"
#include "Camera/CCameraShakeData.hpp"
#include "Camera/CGameCamera.hpp"
#include "Graphics/CBooRenderer.hpp"
#include "World/CGameLight.hpp"
#include "CSortedLists.hpp"
#include "Weapon/CWeaponMgr.hpp"
#include "World/CFluidPlaneManager.hpp"
#include "World/CEnvFxManager.hpp"
#include "World/CActorModelParticles.hpp"
#include "World/CTeamAiTypes.hpp"
#include "World/CScriptPlayerActor.hpp"
#include "Input/CRumbleManager.hpp"
#include "World/CWorld.hpp"
#include "Graphics/CLight.hpp"
#include "GameGlobalObjects.hpp"
#include "CSimplePool.hpp"
#include "CPlayerState.hpp"
#include "CGameState.hpp"
#include "World/CPlayer.hpp"
#include "Weapon/CPlayerGun.hpp"
#include "World/CMorphBall.hpp"
#include "World/CScriptSpawnPoint.hpp"
#include "AutoMapper/CMapWorldInfo.hpp"
#include "Particle/CGenDescription.hpp"
#include "CMemoryCardSys.hpp"
#include "TCastTo.hpp" // Generated file, do not modify include path
#include "World/CScriptSpecialFunction.hpp"
#include "CTimeProvider.hpp"
#include "Camera/CBallCamera.hpp"
#include "Collision/CMaterialFilter.hpp"
#include "World/CScriptDock.hpp"
#include "Particle/CDecalManager.hpp"
#include "Particle/CParticleElectric.hpp"
#include "World/CProjectedShadow.hpp"
#include "Weapon/CProjectileWeapon.hpp"
#include "World/CScriptEffect.hpp"
#include "MP1/CSamusHud.hpp"
#include "Collision/CGameCollision.hpp"
#include "World/CScriptPlatform.hpp"
#include "World/CScriptRoomAcoustics.hpp"
#include "Weapon/CWeapon.hpp"
#include "World/CWallCrawlerSwarm.hpp"
#include "World/CSnakeWeedSwarm.hpp"
#include "Collision/CCollidableSphere.hpp"
#include "zeus/CMRay.hpp"
#include "Collision/CollisionUtil.hpp"
#include "World/CScriptWater.hpp"
#include "World/CScriptDoor.hpp"
#include "Input/ControlMapper.hpp"
#include "MP1/MP1.hpp"
#include "GameGlobalObjects.hpp"
#include "World/CScriptDoor.hpp"
#include "World/CScriptDamageableTrigger.hpp"
#include "World/CScriptDebris.hpp"
#include "hecl/CVarManager.hpp"
#include "World/CPatterned.hpp"
#include "World/CDestroyableRock.hpp"
#include "World/CPathFindSearch.hpp"
#include <cmath> #include <cmath>
#include "Runtime/AutoMapper/CMapWorldInfo.hpp"
#include "Runtime/Camera/CBallCamera.hpp"
#include "Runtime/Camera/CCameraShakeData.hpp"
#include "Runtime/Camera/CGameCamera.hpp"
#include "Runtime/CGameState.hpp"
#include "Runtime/CMemoryCardSys.hpp"
#include "Runtime/Collision/CCollidableSphere.hpp"
#include "Runtime/Collision/CGameCollision.hpp"
#include "Runtime/Collision/CMaterialFilter.hpp"
#include "Runtime/Collision/CollisionUtil.hpp"
#include "Runtime/CPlayerState.hpp"
#include "Runtime/CSortedLists.hpp"
#include "Runtime/CTimeProvider.hpp"
#include "Runtime/GameGlobalObjects.hpp"
#include "Runtime/Graphics/CBooRenderer.hpp"
#include "Runtime/Graphics/CLight.hpp"
#include "Runtime/Input/ControlMapper.hpp"
#include "Runtime/Input/CRumbleManager.hpp"
#include "Runtime/MP1/CSamusHud.hpp"
#include "Runtime/MP1/MP1.hpp"
#include "Runtime/Particle/CDecalManager.hpp"
#include "Runtime/Particle/CParticleElectric.hpp"
#include "Runtime/Weapon/CProjectileWeapon.hpp"
#include "Runtime/Weapon/CWeapon.hpp"
#include "Runtime/Weapon/CWeaponMgr.hpp"
#include "Runtime/World/CDestroyableRock.hpp"
#include "Runtime/World/CGameLight.hpp"
#include "Runtime/World/CPathFindSearch.hpp"
#include "Runtime/World/CPatterned.hpp"
#include "Runtime/World/CPlayer.hpp"
#include "Runtime/World/CProjectedShadow.hpp"
#include "Runtime/World/CScriptDebris.hpp"
#include "Runtime/World/CScriptDock.hpp"
#include "Runtime/World/CScriptDoor.hpp"
#include "Runtime/World/CScriptEffect.hpp"
#include "Runtime/World/CScriptPlatform.hpp"
#include "Runtime/World/CScriptPlayerActor.hpp"
#include "Runtime/World/CScriptRoomAcoustics.hpp"
#include "Runtime/World/CScriptSpawnPoint.hpp"
#include "Runtime/World/CScriptSpecialFunction.hpp"
#include "Runtime/World/CScriptWater.hpp"
#include "Runtime/World/CSnakeWeedSwarm.hpp"
#include "Runtime/World/CWallCrawlerSwarm.hpp"
#include "Runtime/World/CWorld.hpp"
#include "TCastTo.hpp" // Generated file, do not modify include path
#include <hecl/CVarManager.hpp>
#include <zeus/CMRay.hpp>
namespace urde { namespace urde {
hecl::CVar* sm_logScripting = nullptr; hecl::CVar* sm_logScripting = nullptr;
logvisor::Module LogModule("urde::CStateManager"); logvisor::Module LogModule("urde::CStateManager");

View File

@ -49,7 +49,6 @@ class CProjectedShadow;
class CRelayTracker; class CRelayTracker;
class CRumbleManager; class CRumbleManager;
class CSortedListManager; class CSortedListManager;
class CTeamAiTypes;
class CTexture; class CTexture;
class CWorld; class CWorld;
class CWorldLayerState; class CWorldLayerState;

View File

@ -23,6 +23,7 @@ public:
const zeus::CSphere& GetSphere() const { return x10_sphere; } const zeus::CSphere& GetSphere() const { return x10_sphere; }
void SetSphereCenter(const zeus::CVector3f& center) { x10_sphere.position = center; } void SetSphereCenter(const zeus::CVector3f& center) { x10_sphere.position = center; }
void SetSphereRadius(float radius) { x10_sphere.radius = radius; }
zeus::CSphere Transform(const zeus::CTransform& xf) const; zeus::CSphere Transform(const zeus::CTransform& xf) const;
u32 GetTableIndex() const override; u32 GetTableIndex() const override;

View File

@ -169,4 +169,12 @@ void CCollisionActor::Touch(CActor& actor, CStateManager& mgr) {
} }
zeus::CVector3f CCollisionActor::GetOrbitPosition(const CStateManager&) const { return GetTouchBounds()->center(); } zeus::CVector3f CCollisionActor::GetOrbitPosition(const CStateManager&) const { return GetTouchBounds()->center(); }
void CCollisionActor::SetSphereRadius(float radius) {
if (x258_primitiveType != EPrimitiveType::Sphere)
return;
x288_sphereRadius = radius;
x284_spherePrimitive->SetSphereRadius(radius);
}
} // namespace urde } // namespace urde

View File

@ -60,6 +60,7 @@ public:
TUniqueId GetLastTouchedObject() const { return x2fc_lastTouched; } TUniqueId GetLastTouchedObject() const { return x2fc_lastTouched; }
zeus::CVector3f GetScanObjectIndicatorPosition(const CStateManager&) const override; zeus::CVector3f GetScanObjectIndicatorPosition(const CStateManager&) const override;
void SetExtendedTouchBounds(const zeus::CVector3f& boundExt) { x304_extendedTouchBounds = boundExt; } void SetExtendedTouchBounds(const zeus::CVector3f& boundExt) { x304_extendedTouchBounds = boundExt; }
void SetSphereRadius(float radius);
float GetSphereRadius() const { return x288_sphereRadius; } float GetSphereRadius() const { return x288_sphereRadius; }
}; };
} // namespace urde } // namespace urde

File diff suppressed because it is too large Load Diff

View File

@ -65,11 +65,11 @@ public:
class CRidley : public CPatterned { class CRidley : public CPatterned {
CRidleyData x568_data; CRidleyData x568_data;
std::unique_ptr<CCollisionActorManager> x980_; std::unique_ptr<CCollisionActorManager> x980_tailCollision;
std::unique_ptr<CCollisionActorManager> x984_; std::unique_ptr<CCollisionActorManager> x984_bodyCollision;
TUniqueId x988_headId = kInvalidUniqueId; TUniqueId x988_headId = kInvalidUniqueId;
TUniqueId x98a_breastPlateId = kInvalidUniqueId; TUniqueId x98a_breastPlateId = kInvalidUniqueId;
TToken<CGenDescription> x98c_; TLockedToken<CGenDescription> x98c_;
CModelData x998_; CModelData x998_;
CModelData x9e4_; CModelData x9e4_;
CSegId xa30_breastPlateSegId; CSegId xa30_breastPlateSegId;
@ -85,7 +85,7 @@ class CRidley : public CPatterned {
bool xa32_25_ : 1; bool xa32_25_ : 1;
bool xa32_26_ : 1; bool xa32_26_ : 1;
bool xa32_27_ : 1; bool xa32_27_ : 1;
bool xa32_28_ : 1; bool xa32_28_shotAt : 1;
bool xa32_29_ : 1; bool xa32_29_ : 1;
bool xa32_30_ : 1; bool xa32_30_ : 1;
bool xa32_31_ : 1; bool xa32_31_ : 1;
@ -94,7 +94,7 @@ class CRidley : public CPatterned {
bool xa33_26_ : 1; bool xa33_26_ : 1;
bool xa33_27_ : 1; bool xa33_27_ : 1;
bool xa33_28_ : 1; bool xa33_28_ : 1;
bool xa33_29_ : 1; bool xa33_29_doStrafe : 1;
bool xa33_30_ : 1; bool xa33_30_ : 1;
bool xa33_31_ : 1; bool xa33_31_ : 1;
bool xa34_24_ : 1; bool xa34_24_ : 1;
@ -113,7 +113,7 @@ class CRidley : public CPatterned {
float xae8_; float xae8_;
zeus::CVector3f xaec_; zeus::CVector3f xaec_;
zeus::CVector3f xaf8_; zeus::CVector3f xaf8_;
u32 xb04_ = 2; s32 xb04_ = 2;
u32 xb08_; u32 xb08_;
u32 xb0c_ = 0; u32 xb0c_ = 0;
float xb10_ = 0.f; float xb10_ = 0.f;
@ -124,7 +124,7 @@ class CRidley : public CPatterned {
float xb24_ = 0.f; float xb24_ = 0.f;
CSegId xb28_; CSegId xb28_;
CBoneTracking xb2c_; CBoneTracking xb2c_;
TUniqueId xb64_ = kInvalidUniqueId; TUniqueId xb64_plasmaProjectile = kInvalidUniqueId;
CProjectileInfo xb68_; CProjectileInfo xb68_;
CSegId xb90_headSegId; CSegId xb90_headSegId;
CSegId xb91_mouthSegId; CSegId xb91_mouthSegId;
@ -133,10 +133,11 @@ class CRidley : public CPatterned {
zeus::CTransform xb94_; zeus::CTransform xb94_;
zeus::CVector3f xbc4_; zeus::CVector3f xbc4_;
zeus::CVector3f xbd0_; zeus::CVector3f xbd0_;
u32 xbdc_; float xbdc_;
u32 xbe0_; float xbe0_;
zeus::CVector3f xbe4_; zeus::CVector3f xbe4_;
zeus::CVector3f xbf0_ = zeus::skForward; zeus::CVector3f xbf0_ = zeus::skForward;
zeus::CVector3f xbfc_;
float xc08_ = 0.f; float xc08_ = 0.f;
float xc0c_ = 0.f; float xc0c_ = 0.f;
float xc10_ = 120.f; float xc10_ = 120.f;
@ -151,8 +152,8 @@ class CRidley : public CPatterned {
u32 xc84_; u32 xc84_;
u32 xc88_ = 4; u32 xc88_ = 4;
CDamageInfo xc8c_; CDamageInfo xc8c_;
u32 xca8_ = 0; CSfxHandle xca8_;
u32 xcac_ = 0; CSfxHandle xcac_ = 0;
u32 xcb0_ = 0; u32 xcb0_ = 0;
u32 xcb4_ = 0; u32 xcb4_ = 0;
float xcb8_ = 0.f; float xcb8_ = 0.f;
@ -160,10 +161,10 @@ class CRidley : public CPatterned {
u32 xcc0_ = 1; u32 xcc0_ = 1;
u32 xcc4_ = 1; u32 xcc4_ = 1;
float xcc8_ = 0.f; float xcc8_ = 0.f;
float xccc_;
TLockedToken<CElectricDescription> xcd0_; TLockedToken<CElectricDescription> xcd0_;
bool xcdc_;
std::unique_ptr<CParticleElectric> xce0_; std::unique_ptr<CParticleElectric> xce0_;
std::vector<CSegId> xce4_; // was rstl::reserved_vector<CSegId, 30> std::vector<CSegId> xce4_wingBoneIds; // was rstl::reserved_vector<CSegId, 30>
float xd08_; float xd08_;
CSfxHandle xd0c_; CSfxHandle xd0c_;
std::unique_ptr<CProjectedShadow> xd10_; std::unique_ptr<CProjectedShadow> xd10_;
@ -178,6 +179,19 @@ class CRidley : public CPatterned {
void sub802563a8(float dt); void sub802563a8(float dt);
void sub80256b14(float dt, CStateManager& mgr); void sub80256b14(float dt, CStateManager& mgr);
void sub80256624(float dt, CStateManager& mgr); void sub80256624(float dt, CStateManager& mgr);
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;
}
public: public:
DEFINE_PATTERNED(Ridley) DEFINE_PATTERNED(Ridley)
@ -194,7 +208,7 @@ public:
} }
zeus::CVector3f GetAimPosition(const CStateManager& mgr, float dt) const override { zeus::CVector3f GetAimPosition(const CStateManager& mgr, float dt) const override {
return GetLctrTransform((xc64_aiStage == 3 && !xa32_28_) ? xb90_headSegId : xa30_breastPlateSegId).origin; return GetLctrTransform((xc64_aiStage == 3 && !xa32_28_shotAt) ? xb90_headSegId : xa30_breastPlateSegId).origin;
} }
float GetGravityConstant() const override { return 50.f; } float GetGravityConstant() const override { return 50.f; }
@ -203,6 +217,7 @@ public:
return EWeaponCollisionResponseTypes::EnemyNormal; return EWeaponCollisionResponseTypes::EnemyNormal;
} }
void DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, EUserEventType type, float dt) override;
void Patrol(CStateManager& mgr, EStateMsg msg, float arg) override; void Patrol(CStateManager& mgr, EStateMsg msg, float arg) override;
void Dead(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 Generate(CStateManager& mgr, EStateMsg msg, float arg) override;
@ -211,9 +226,11 @@ public:
void JumpBack(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 DoubleSnap(CStateManager& mgr, EStateMsg msg, float arg) override;
void CoverAttack(CStateManager& mgr, EStateMsg msg, float arg) override; void CoverAttack(CStateManager& mgr, EStateMsg msg, float arg) override;
void Crouch(CStateManager& mgr, EStateMsg msg, float arg) override;
void FadeOut(CStateManager& mgr, EStateMsg msg, float arg) override; void FadeOut(CStateManager& mgr, EStateMsg msg, float arg) override;
void Taunt(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; void Flee(CStateManager& mgr, EStateMsg msg, float arg) override;
void Lurk(CStateManager& mgr, EStateMsg msg, float arg) override;
void ProjectileAttack(CStateManager& mgr, EStateMsg msg, float arg) override; void ProjectileAttack(CStateManager& mgr, EStateMsg msg, float arg) override;
void Flinch(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 Hurled(CStateManager& mgr, EStateMsg msg, float arg) override;

View File

@ -23,6 +23,7 @@ public:
const CPlayer& player, bool gravity, float dt) const; const CPlayer& player, bool gravity, float dt) const;
const CDamageInfo& GetDamage() const { return xc_damageInfo; } const CDamageInfo& GetDamage() const { return xc_damageInfo; }
void SetDamage(const CDamageInfo& damageInfo) { xc_damageInfo = damageInfo; }
TToken<CWeaponDescription>& Token() { return x0_weaponDescription; } TToken<CWeaponDescription>& Token() { return x0_weaponDescription; }
}; };
} // namespace urde } // namespace urde

View File

@ -216,10 +216,10 @@ protected:
zeus::CColor x430_damageColor = skDamageColor; zeus::CColor x430_damageColor = skDamageColor;
zeus::CVector3f x434_posDelta; zeus::CVector3f x434_posDelta;
zeus::CQuaternion x440_rotDelta; zeus::CQuaternion x440_rotDelta;
CSteeringBehaviors x45c_steeringBehaviors;
std::unique_ptr<CBodyController> x450_bodyController; std::unique_ptr<CBodyController> x450_bodyController;
u16 x454_deathSfx; u16 x454_deathSfx;
u16 x458_iceShatterSfx; u16 x458_iceShatterSfx;
CSteeringBehaviors x45c_steeringBehaviors;
CKnockBackController x460_knockBackController; CKnockBackController x460_knockBackController;
zeus::CVector3f x4e4_latestPredictedTranslation; zeus::CVector3f x4e4_latestPredictedTranslation;

View File

@ -26,5 +26,7 @@ public:
void Render(const CStateManager& mgr); void Render(const CStateManager& mgr);
void RenderShadowBuffer(const CStateManager&, const CModelData&, const zeus::CTransform&, s32, const zeus::CVector3f&, void RenderShadowBuffer(const CStateManager&, const CModelData&, const zeus::CTransform&, s32, const zeus::CVector3f&,
float, float); float, float);
void Unset_X80() { x80_ = false; }
}; };
} // namespace urde } // namespace urde