2018-10-11 22:57:05 +00:00
|
|
|
#pragma once
|
|
|
|
|
2019-09-28 02:53:03 +00:00
|
|
|
#include "Runtime/Character/CBoneTracking.hpp"
|
2020-03-01 13:14:39 +00:00
|
|
|
#include "Runtime/Weapon/CFlameInfo.hpp"
|
2019-09-28 02:53:03 +00:00
|
|
|
#include "Runtime/World/CPatterned.hpp"
|
2018-10-11 22:57:05 +00:00
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2020-03-01 13:14:39 +00:00
|
|
|
class CCollisionActorManager;
|
|
|
|
class CSkinnedModel;
|
|
|
|
class CWeaponDescription;
|
2020-04-21 05:32:16 +00:00
|
|
|
|
2020-03-01 13:14:39 +00:00
|
|
|
namespace MP1 {
|
2018-12-08 05:30:43 +00:00
|
|
|
class CMagdolite : public CPatterned {
|
2018-10-11 22:57:05 +00:00
|
|
|
private:
|
2020-03-02 04:42:19 +00:00
|
|
|
float x568_initialDelay;
|
|
|
|
float x56c_minDelay;
|
|
|
|
float x570_maxDelay;
|
|
|
|
float x574_minHp;
|
|
|
|
float x578_losMaxDistance;
|
2019-05-14 22:30:15 +00:00
|
|
|
float x57c_;
|
2020-03-02 04:42:19 +00:00
|
|
|
std::unique_ptr<CCollisionActorManager> x580_collisionManager;
|
2019-05-14 22:30:15 +00:00
|
|
|
CBoneTracking x584_boneTracker;
|
2020-04-21 18:15:17 +00:00
|
|
|
CDamageVulnerability x5bc_instaKillVulnerability;
|
|
|
|
CDamageVulnerability x624_normalVulnerability;
|
2020-04-21 05:32:16 +00:00
|
|
|
// CRefData* x68c_;
|
2020-03-01 13:14:39 +00:00
|
|
|
TLockedToken<CSkinnedModel> x690_headlessModel;
|
2020-04-21 05:32:16 +00:00
|
|
|
rstl::reserved_vector<TUniqueId, 4> x69c_;
|
2020-04-21 18:15:17 +00:00
|
|
|
CFlameInfo x6a8_flameInfo;
|
2020-03-01 13:14:39 +00:00
|
|
|
TUniqueId x6c8_flameThrowerId = kInvalidUniqueId;
|
2020-04-21 18:15:17 +00:00
|
|
|
TLockedToken<CWeaponDescription> x6cc_flameThrowerDesc; // was TToken<CWeaponDescription>
|
|
|
|
CDamageInfo x6d4_flameThrowerDamage;
|
|
|
|
CDamageInfo x6f0_headContactDamage;
|
2020-04-21 05:32:16 +00:00
|
|
|
float x70c_curHealth = 0.f; // not init in ctr
|
2020-03-02 04:42:19 +00:00
|
|
|
zeus::CVector3f x710_attackOffset;
|
|
|
|
zeus::CVector3f x71c_attackTarget;
|
|
|
|
zeus::CVector3f x728_cachedTarget;
|
2020-03-01 13:14:39 +00:00
|
|
|
float x734_ = 0.f;
|
|
|
|
float x738_ = 0.f;
|
|
|
|
float x73c_ = 0.f;
|
|
|
|
float x740_ = 0.f;
|
|
|
|
float x744_;
|
|
|
|
float x748_;
|
|
|
|
float x74c_;
|
2020-03-02 04:42:19 +00:00
|
|
|
u32 x750_aiStage = 0;
|
|
|
|
bool x754_24_retreat : 1 = false;
|
|
|
|
bool x754_25_up : 1 = false;
|
|
|
|
bool x754_26_lostMyHead : 1 = false;
|
|
|
|
bool x754_27_flameThrowerActive : 1 = false;
|
|
|
|
bool x754_28_alert : 1 = false;
|
|
|
|
bool x754_29_useDetectionRange : 1 = true;
|
|
|
|
bool x754_30_inProjectileAttack : 1 = false;
|
2020-03-01 13:14:39 +00:00
|
|
|
float x758_ = 0.f;
|
|
|
|
|
|
|
|
void ApplyContactDamage(TUniqueId uid, CStateManager& mgr);
|
|
|
|
void SetupCollisionActors(CStateManager& mgr);
|
|
|
|
void CreateFlameThrower(CStateManager& mgr);
|
|
|
|
void LaunchFlameThrower(CStateManager& mgr, bool fire);
|
|
|
|
void UpdateOrientation(CStateManager& mgr);
|
|
|
|
TUniqueId FindSuitableTarget(CStateManager& mgr, EScriptObjectState state, EScriptObjectMessage msg);
|
2020-04-21 05:32:16 +00:00
|
|
|
|
2018-10-11 22:57:05 +00:00
|
|
|
public:
|
2020-08-23 19:03:33 +00:00
|
|
|
DEFINE_PATTERNED(Magdolite);
|
2019-01-31 20:44:05 +00:00
|
|
|
|
2020-04-21 05:32:16 +00:00
|
|
|
CMagdolite(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
|
|
|
|
CModelData&& mData, const CPatternedInfo& pInfo, const CActorParameters& actParms, float f1, float f2,
|
|
|
|
const CDamageInfo& dInfo1, const CDamageInfo& dInfo2, const CDamageVulnerability& dVuln1,
|
|
|
|
const CDamageVulnerability& dVuln2, CAssetId modelId, CAssetId skinId, float f3, float f4, float f5,
|
|
|
|
float f6, const CFlameInfo& magData, float f7, float f8, float f9);
|
|
|
|
|
|
|
|
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) override;
|
2020-03-01 13:14:39 +00:00
|
|
|
void Think(float dt, CStateManager& mgr) override;
|
2020-08-23 19:03:33 +00:00
|
|
|
void Touch(CActor& actor, CStateManager& mgr) override {}
|
2020-03-01 13:14:39 +00:00
|
|
|
const CDamageVulnerability* GetDamageVulnerability() const override {
|
|
|
|
return x400_25_alive ? CAi::GetDamageVulnerability() : &CDamageVulnerability::ImmuneVulnerabilty();
|
|
|
|
}
|
|
|
|
const CDamageVulnerability* GetDamageVulnerability(const zeus::CVector3f&, const zeus::CVector3f&,
|
|
|
|
const CDamageInfo&) const override {
|
|
|
|
return GetDamageVulnerability();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, EUserEventType type, float dt) override;
|
|
|
|
void Death(CStateManager& mgr, const zeus::CVector3f& direction, EScriptObjectState state) override;
|
|
|
|
void FluidFXThink(EFluidState state, CScriptWater& water, CStateManager& mgr) override;
|
|
|
|
void SelectTarget(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void Generate(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void Deactivate(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void Attack(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void Active(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void InActive(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void GetUp(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void Taunt(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 Flinch(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
void Retreat(CStateManager& mgr, EStateMsg msg, float arg) override;
|
|
|
|
bool InAttackPosition(CStateManager& mgr, float arg) override;
|
|
|
|
bool Leash(CStateManager& mgr, float arg) override;
|
|
|
|
bool HasAttackPattern(CStateManager& mgr, float arg) override;
|
|
|
|
bool LineOfSight(CStateManager& mgr, float arg) override;
|
|
|
|
bool ShouldRetreat(CStateManager& mgr, float arg) override;
|
2018-10-11 22:57:05 +00:00
|
|
|
};
|
2020-03-01 13:14:39 +00:00
|
|
|
} // namespace MP1
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|