CElitePirate: Initial stubbing

This commit is contained in:
Phillip Stephens 2020-03-08 19:52:21 -07:00 committed by Luke Street
parent 98b9556f3e
commit e5df609673
2 changed files with 206 additions and 7 deletions

View File

@ -1,7 +1,13 @@
#include "Runtime/MP1/World/CElitePirate.hpp" #include "Runtime/MP1/World/CElitePirate.hpp"
#include "Runtime/Collision/CCollisionActorManager.hpp"
#include "Runtime/CSimplePool.hpp"
#include "Runtime/GameGlobalObjects.hpp"
#include "Runtime/World/CPatternedInfo.hpp"
#include "Runtime/World/ScriptLoader.hpp" #include "Runtime/World/ScriptLoader.hpp"
#include "TCastTo.hpp" // Generated file, do not modify include path
namespace urde::MP1 { namespace urde::MP1 {
CElitePirateData::CElitePirateData(CInputStream& in, u32 propCount) CElitePirateData::CElitePirateData(CInputStream& in, u32 propCount)
: x0_(in.readFloatBig()) : x0_(in.readFloatBig())
@ -44,5 +50,81 @@ CElitePirate::CElitePirate(TUniqueId uid, std::string_view name, const CEntityIn
CModelData&& mData, const CPatternedInfo& pInfo, const CActorParameters& actParms, CModelData&& mData, const CPatternedInfo& pInfo, const CActorParameters& actParms,
const CElitePirateData& eliteData) const CElitePirateData& eliteData)
: CPatterned(ECharacter::ElitePirate, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo, : CPatterned(ECharacter::ElitePirate, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo,
EMovementType::Ground, EColliderType::One, EBodyType::BiPedal, actParms, EKnockBackVariant::Large) {} EMovementType::Ground, EColliderType::One, EBodyType::BiPedal, actParms, EKnockBackVariant::Large)
, x56c_(pInfo.GetDamageVulnerability())
, x5d8_(eliteData)
, x6f8_(*GetModelData()->GetAnimationData(), "Head_1", zeus::degToRad(80.f), zeus::degToRad(180.f),
EBoneTrackingFlags::None)
, x738_(GetBoundingBox(), GetMaterialList())
, x7d0_(nullptr, 1, pInfo.GetPathfindingIndex(), 1.f, 1.f) {
if (x5d8_.GetX20().IsValid()) {
x760_ = g_SimplePool->GetObj({SBIG('PART'), x5d8_.GetX20()});
}
x460_knockBackController.SetEnableFreeze(false);
x460_knockBackController.SetAutoResetImpulse(false);
x460_knockBackController.SetEnableBurn(false);
x460_knockBackController.SetEnableExplodeDeath(false);
x460_knockBackController.SetEnableLaggedBurnDeath(false);
sub80229248();
}
void CElitePirate::Accept(IVisitor& visitor) { visitor.Visit(this); }
void CElitePirate::Think(float dt, CStateManager& mgr) { CPatterned::Think(dt, mgr); }
void CElitePirate::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) {
CPatterned::AcceptScriptMsg(msg, uid, mgr);
}
void CElitePirate::PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) { CPatterned::PreRender(mgr, frustum); }
const CDamageVulnerability* CElitePirate::GetDamageVulnerability() const { return CAi::GetDamageVulnerability(); }
const CDamageVulnerability* CElitePirate::GetDamageVulnerability(const zeus::CVector3f& pos, const zeus::CVector3f& dir,
const CDamageInfo& dInfo) const {
return CActor::GetDamageVulnerability(pos, dir, dInfo);
}
zeus::CVector3f CElitePirate::GetOrbitPosition(const CStateManager& mgr) const {
return CPatterned::GetOrbitPosition(mgr);
}
zeus::CVector3f CElitePirate::GetAimPosition(const CStateManager& mgr, float dt) const {
return CPatterned::GetAimPosition(mgr, dt);
}
void CElitePirate::DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, EUserEventType type, float dt) {
CPatterned::DoUserAnimEvent(mgr, node, type, dt);
}
const CCollisionPrimitive* CElitePirate::GetCollisionPrimitive() const {
return CPhysicsActor::GetCollisionPrimitive();
}
void CElitePirate::KnockBack(const zeus::CVector3f& pos, CStateManager& mgr, const CDamageInfo& info, EKnockBackType type,
bool inDeferred, float magnitude) {
CPatterned::KnockBack(pos, mgr, info, type, inDeferred, magnitude);
}
void CElitePirate::TakeDamage(const zeus::CVector3f& pos, float arg) { CPatterned::TakeDamage(pos, arg); }
void CElitePirate::Patrol(CStateManager& mgr, EStateMsg msg, float dt) { CPatterned::Patrol(mgr, msg, dt); }
void CElitePirate::PathFind(CStateManager& mgr, EStateMsg msg, float dt) { CPatterned::PathFind(mgr, msg, dt); }
void CElitePirate::TargetPatrol(CStateManager& mgr, EStateMsg msg, float dt) {
CPatterned::TargetPatrol(mgr, msg, dt);
}
void CElitePirate::Halt(CStateManager& mgr, EStateMsg msg, float dt) { CAi::Halt(mgr, msg, dt); }
void CElitePirate::Run(CStateManager& mgr, EStateMsg msg, float dt) { CAi::Run(mgr, msg, dt); }
void CElitePirate::Generate(CStateManager& mgr, EStateMsg msg, float dt) { CAi::Generate(mgr, msg, dt); }
void CElitePirate::Attack(CStateManager& mgr, EStateMsg msg, float dt) { CAi::Attack(mgr, msg, dt); }
void CElitePirate::Taunt(CStateManager& mgr, EStateMsg msg, float dt) { CAi::Taunt(mgr, msg, dt); }
void CElitePirate::ProjectileAttack(CStateManager& mgr, EStateMsg msg, float dt) {
CAi::ProjectileAttack(mgr, msg, dt);
}
void CElitePirate::SpecialAttack(CStateManager& mgr, EStateMsg msg, float dt) { CAi::SpecialAttack(mgr, msg, dt); }
void CElitePirate::CallForBackup(CStateManager& mgr, EStateMsg msg, float dt) { CAi::CallForBackup(mgr, msg, dt); }
bool CElitePirate::TooClose(CStateManager& mgr, float arg) { return CPatterned::TooClose(mgr, arg); }
bool CElitePirate::InDetectionRange(CStateManager& mgr, float arg) { return CPatterned::InDetectionRange(mgr, arg); }
bool CElitePirate::SpotPlayer(CStateManager& mgr, float arg) { return CPatterned::SpotPlayer(mgr, arg); }
bool CElitePirate::AnimOver(CStateManager& mgr, float arg) { return CPatterned::AnimOver(mgr, arg); }
bool CElitePirate::ShouldAttack(CStateManager& mgr, float arg) { return CAi::ShouldAttack(mgr, arg); }
bool CElitePirate::InPosition(CStateManager& mgr, float arg) { return CPatterned::InPosition(mgr, arg); }
bool CElitePirate::ShouldTurn(CStateManager& mgr, float arg) { return CAi::ShouldTurn(mgr, arg); }
bool CElitePirate::AggressionCheck(CStateManager& mgr, float arg) { return CAi::AggressionCheck(mgr, arg); }
bool CElitePirate::ShouldTaunt(CStateManager& mgr, float arg) { return CAi::ShouldTaunt(mgr, arg); }
bool CElitePirate::ShouldFire(CStateManager& mgr, float arg) { return CAi::ShouldFire(mgr, arg); }
bool CElitePirate::ShotAt(CStateManager& mgr, float arg) { return CAi::ShotAt(mgr, arg); }
bool CElitePirate::ShouldSpecialAttack(CStateManager& mgr, float arg) { return CAi::ShouldSpecialAttack(mgr, arg); }
bool CElitePirate::ShouldCallForBackup(CStateManager& mgr, float arg) { return CAi::ShouldCallForBackup(mgr, arg); }
CPathFindSearch* CElitePirate::GetSearchPath() { return CPatterned::GetSearchPath(); }
void CElitePirate::V181(CStateManager& mgr) {}
void CElitePirate::v182(CStateManager& mgr, bool b) {}
} // namespace urde::MP1 } // namespace urde::MP1

View File

@ -1,13 +1,16 @@
#pragma once #pragma once
#include <string_view> #include "Runtime/Character/CBoneTracking.hpp"
#include "Runtime/RetroTypes.hpp"
#include "Runtime/World/CActorParameters.hpp" #include "Runtime/World/CActorParameters.hpp"
#include "Runtime/World/CAnimationParameters.hpp" #include "Runtime/World/CAnimationParameters.hpp"
#include "Runtime/World/CPatterned.hpp" #include "Runtime/World/CPatterned.hpp"
#include "Runtime/World/CPathFindSearch.hpp"
namespace urde::MP1 { namespace urde {
class CCollisionActorManager;
class CGenDescription;
namespace MP1 {
class CElitePirateData { class CElitePirateData {
float x0_; float x0_;
float x4_; float x4_;
@ -47,13 +50,127 @@ class CElitePirateData {
public: public:
CElitePirateData(CInputStream&, u32 propCount); CElitePirateData(CInputStream&, u32 propCount);
CAssetId GetX20() const { return x20_; }
CAssetId GetXF8() const { return xf8_; }
const CDamageInfo& GetXFC() const { return xfc_; }
CAssetId GetX118() const { return x118_; }
s16 GetX11C() const { return x11c_; }
}; };
class CElitePirate : public CPatterned { class CElitePirate : public CPatterned {
struct SUnknownStruct {
float x0_;
s32 x4_ = 0;
SUnknownStruct(float f) : x0_(f * f) {}
};
struct SUnknownStruct2 {
u32 x0_ = 8;
CAssetId x4_particleDesc;
CDamageInfo x8_damageInfo;
float x24_ = 0.f;
float x28_ = 0.5f;
float x2c_ = 16.5217f;
float x30_ = 0.f;
CAssetId x34_weaponDesc;
s16 x38_sfx;
SUnknownStruct2(CAssetId part, const CDamageInfo& dInfo, CAssetId weapon, s16 sfx)
: x4_particleDesc(part), x8_damageInfo(dInfo), x34_weaponDesc(weapon), x38_sfx(sfx) {}
};
s32 x568_ = -1;
CDamageVulnerability x56c_;
std::unique_ptr<CCollisionActorManager> x5d4_;
CElitePirateData x5d8_;
CBoneTracking x6f8_;
std::unique_ptr<CCollisionActorManager> x730_;
s32 x734_;
CCollidableAABox x738_;
std::optional<TLockedToken<CGenDescription>> x760_;
TUniqueId x770_ = kInvalidUniqueId;
TUniqueId x772_ = kInvalidUniqueId;
s32 x774_ = 0;
s32 x788_ = 0;
TUniqueId x79c_ = kInvalidUniqueId;
float x7a0_;
float x7a4_ = 1.f;
float x7a8_ = 0.f;
float x7ac_ = 0.f;
float x7b0_ = 1.f;
float x7b4_ = 0.f;
float x7b8_ = 0.f;
float x7bc_ = 0.f;
float x7c0_ = 0.f;
float x7c4_ = 0.f;
s32 x7c8_ = -1;
s32 x7cc_ = 0;
CPathFindSearch x7d0_;
zeus::CVector3f x8b4_;
SUnknownStruct x8c0_ = SUnknownStruct(5.f);
bool x988_24_ : 1;
bool x988_25_ : 1;
bool x988_26_ : 1;
bool x988_27_ : 1;
bool x988_28_ : 1;
bool x988_29_ : 1;
bool x988_30_ : 1;
bool x988_31_ : 1;
bool x989_24_ : 1;
void sub80229248() {}
public: public:
DEFINE_PATTERNED(ElitePirate) DEFINE_PATTERNED(ElitePirate)
CElitePirate(TUniqueId, std::string_view, const CEntityInfo&, const zeus::CTransform&, CModelData&&, CElitePirate(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
const CPatternedInfo&, const CActorParameters&, const CElitePirateData&); CModelData&& mData, const CPatternedInfo& pInfo, const CActorParameters& actParms,
const CElitePirateData& data);
void Accept(IVisitor& visitor) override;
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;
const CDamageVulnerability* GetDamageVulnerability() const override;
const CDamageVulnerability* GetDamageVulnerability(const zeus::CVector3f& pos, const zeus::CVector3f& dir,
const CDamageInfo& dInfo) const override;
zeus::CVector3f GetOrbitPosition(const CStateManager& mgr) const override;
zeus::CVector3f GetAimPosition(const CStateManager& mgr, float) const override;
void DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, EUserEventType type, float dt) override;
const CCollisionPrimitive* GetCollisionPrimitive() const override;
void KnockBack(const zeus::CVector3f&, CStateManager&, const CDamageInfo& info, EKnockBackType type, bool inDeferred,
float magnitude) override;
void TakeDamage(const zeus::CVector3f&, float arg) override;
void Patrol(CStateManager&, EStateMsg msg, float dt) override;
void PathFind(CStateManager&, EStateMsg msg, float dt) override;
void TargetPatrol(CStateManager&, EStateMsg msg, float dt) override;
void Halt(CStateManager&, EStateMsg msg, float dt) override;
void Run(CStateManager&, EStateMsg msg, float dt) override;
void Generate(CStateManager&, EStateMsg msg, float dt) override;
void Attack(CStateManager&, EStateMsg msg, float dt) override;
void Taunt(CStateManager&, EStateMsg msg, float dt) override;
void ProjectileAttack(CStateManager&, EStateMsg msg, float dt) override;
void SpecialAttack(CStateManager&, EStateMsg msg, float dt) override;
void CallForBackup(CStateManager&, EStateMsg msg, float dt) override;
bool TooClose(CStateManager&, float arg) override;
bool InDetectionRange(CStateManager&, float arg) override;
bool SpotPlayer(CStateManager&, float arg) override;
bool AnimOver(CStateManager&, float arg) override;
bool ShouldAttack(CStateManager&, float arg) override;
bool InPosition(CStateManager&, float arg) override;
bool ShouldTurn(CStateManager&, float arg) override;
bool AggressionCheck(CStateManager&, float arg) override;
bool ShouldTaunt(CStateManager&, float arg) override;
bool ShouldFire(CStateManager&, float arg) override;
bool ShotAt(CStateManager&, float arg) override;
bool ShouldSpecialAttack(CStateManager&, float arg) override;
bool ShouldCallForBackup(CStateManager&, float arg) override;
CPathFindSearch* GetSearchPath() override;
virtual bool V179() { return true; }
virtual bool V180() { return true; }
virtual void V181(CStateManager& mgr);
virtual void v182(CStateManager& mgr, bool b);
virtual SUnknownStruct2 V182() const {return {x5d8_.GetXF8(), x5d8_.GetXFC(), x5d8_.GetX118(), x5d8_.GetX11C()}; }
}; };
} // namespace urde::MP1 } // namespace MP1
} // namespace urde