2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2017-11-20 17:33:21 +00:00
|
|
|
|
|
|
|
#include "World/CWallWalker.hpp"
|
2018-09-16 23:22:35 +00:00
|
|
|
#include "Collision/CCollisionActorManager.hpp"
|
2018-05-02 00:43:31 +00:00
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
class CModelData;
|
|
|
|
}
|
|
|
|
|
2017-11-20 17:33:21 +00:00
|
|
|
namespace urde::MP1
|
|
|
|
{
|
2018-09-16 23:22:35 +00:00
|
|
|
class CParasite : public CWallWalker
|
2018-05-07 00:47:40 +00:00
|
|
|
{
|
2018-09-16 23:22:35 +00:00
|
|
|
class CRepulsor
|
2018-05-07 00:47:40 +00:00
|
|
|
{
|
2018-11-12 04:21:36 +00:00
|
|
|
zeus::CVector3f x0_v;
|
|
|
|
float xc_f;
|
|
|
|
public:
|
|
|
|
CRepulsor(const zeus::CVector3f& v, float f) : x0_v(v), xc_f(f) {}
|
|
|
|
const zeus::CVector3f& GetVector() const { return x0_v; }
|
|
|
|
float GetFloat() const { return xc_f; }
|
2018-05-07 00:47:40 +00:00
|
|
|
};
|
2018-09-16 23:22:35 +00:00
|
|
|
static const float flt_805A8FB0;
|
|
|
|
static const float skAttackVelocity;
|
|
|
|
static short word_805A8FC0;
|
|
|
|
static const float flt_805A8FB8;
|
|
|
|
static const float skRetreatVelocity;
|
|
|
|
std::vector<CRepulsor> x5d8_doorRepulsors;
|
2018-11-13 09:20:11 +00:00
|
|
|
s32 x5e8_stateProgress = -1;
|
|
|
|
zeus::CVector3f x5ec_;
|
|
|
|
zeus::CVector3f x5f8_targetPos;
|
|
|
|
float x604_activeSpeed = 1.f;
|
|
|
|
float x608_telegraphRemTime = 0.f;
|
|
|
|
float x60c_stuckTime = 0.f;
|
|
|
|
zeus::CVector3f x614_lastStuckPos;
|
|
|
|
std::unique_ptr<CCollisionActorManager> x620_collisionActorManager;
|
2018-11-12 04:21:36 +00:00
|
|
|
TLockedToken<CSkinnedModel> x624_extraModel;
|
2018-11-13 09:20:11 +00:00
|
|
|
zeus::CVector3f x628_parasiteSeparationMove;
|
|
|
|
zeus::CVector3f x634_parasiteCohesionMove;
|
|
|
|
zeus::CVector3f x640_parasiteAlignmentMove;
|
|
|
|
CDamageVulnerability x64c_oculusHaltDVuln;
|
|
|
|
CDamageInfo x6b4_oculusHaltDInfo;
|
|
|
|
float x6d0_maxTelegraphReactDist;
|
2018-09-16 23:22:35 +00:00
|
|
|
float x6d4_;
|
|
|
|
float x6dc_;
|
2018-11-13 09:20:11 +00:00
|
|
|
float x6e0_stuckTimeThreshold;
|
|
|
|
float x6e4_parasiteSearchRadius;
|
|
|
|
float x6e8_parasiteSeparationDist;
|
|
|
|
float x6ec_parasiteSeparationWeight;
|
|
|
|
float x6f0_parasiteAlignmentWeight;
|
|
|
|
float x6f4_parasiteCohesionWeight;
|
|
|
|
float x6f8_destinationSeekWeight;
|
|
|
|
float x6fc_forwardMoveWeight;
|
|
|
|
float x700_playerSeparationDist;
|
|
|
|
float x704_playerSeparationWeight;
|
|
|
|
float x708_unmorphedRadius;
|
|
|
|
float x710_haltDelay;
|
|
|
|
float x714_iceZoomerJointHP;
|
2018-09-16 23:22:35 +00:00
|
|
|
float x718_ = 0.f;
|
|
|
|
float x71c_ = 0.f;
|
|
|
|
float x720_ = 0.f;
|
|
|
|
float x724_ = 0.f;
|
|
|
|
float x728_ = 0.f;
|
|
|
|
float x72c_ = 0.f;
|
|
|
|
float x730_ = 0.f;
|
|
|
|
float x734_ = 0.f;
|
|
|
|
float x738_ = 0.f;
|
2018-11-12 04:21:36 +00:00
|
|
|
u16 x73c_haltSfx;
|
|
|
|
u16 x73e_getUpSfx;
|
|
|
|
u16 x740_crouchSfx;
|
2018-05-07 00:47:40 +00:00
|
|
|
union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
2018-11-13 09:20:11 +00:00
|
|
|
bool x742_24_receivedTelegraph : 1;
|
2018-11-12 04:21:36 +00:00
|
|
|
bool x742_25_jumpVelDirty : 1;
|
2018-09-16 23:22:35 +00:00
|
|
|
bool x742_26_ : 1;
|
2018-11-12 04:21:36 +00:00
|
|
|
bool x742_27_landed : 1;
|
|
|
|
bool x742_28_onGround : 1;
|
2018-09-16 23:22:35 +00:00
|
|
|
bool x742_29_ : 1;
|
2018-11-12 04:21:36 +00:00
|
|
|
bool x742_30_attackOver : 1;
|
2018-09-16 23:22:35 +00:00
|
|
|
bool x742_31_ : 1;
|
2018-11-13 09:20:11 +00:00
|
|
|
bool x743_24_halted : 1;
|
|
|
|
bool x743_25_vulnerable : 1;
|
2018-11-12 04:21:36 +00:00
|
|
|
bool x743_26_oculusShotAt : 1;
|
|
|
|
bool x743_27_inJump : 1;
|
2018-05-07 00:47:40 +00:00
|
|
|
};
|
2018-09-16 23:22:35 +00:00
|
|
|
u16 _dummy = 0;
|
2018-05-07 00:47:40 +00:00
|
|
|
};
|
2018-11-12 04:21:36 +00:00
|
|
|
bool CloseToWall(CStateManager& mgr);
|
|
|
|
void FaceTarget(const zeus::CVector3f& target);
|
|
|
|
TUniqueId RecursiveFindClosestWayPoint(CStateManager& mgr, TUniqueId id, float& dist);
|
|
|
|
TUniqueId GetClosestWaypointForState(EScriptObjectState state, CStateManager& mgr);
|
|
|
|
void UpdatePFDestination(CStateManager& mgr);
|
|
|
|
void DoFlockingBehavior(CStateManager& mgr);
|
2018-11-13 09:20:11 +00:00
|
|
|
void SetupIceZoomerCollision(CStateManager& mgr);
|
|
|
|
void SetupIceZoomerVulnerability(CStateManager& mgr, const CDamageVulnerability& dVuln,
|
|
|
|
const CHealthInfo& hInfo);
|
|
|
|
void AddDoorRepulsors(CStateManager& mgr);
|
|
|
|
void UpdateCollisionActors(float dt, CStateManager& mgr);
|
|
|
|
void DestroyActorManager(CStateManager& mgr);
|
|
|
|
void UpdateJumpVelocity();
|
2017-11-20 17:33:21 +00:00
|
|
|
public:
|
2018-09-14 00:49:34 +00:00
|
|
|
DEFINE_PATTERNED(Parasite)
|
2018-11-13 09:20:11 +00:00
|
|
|
CParasite(TUniqueId uid, std::string_view name, EFlavorType flavor, const CEntityInfo &info,
|
|
|
|
const zeus::CTransform &xf, CModelData &&mData, const CPatternedInfo &pInfo, EBodyType bodyType,
|
|
|
|
float maxTelegraphReactDist, float advanceWpRadius, float f3, float alignAngVel, float f5,
|
|
|
|
float stuckTimeThreshold, float collisionCloseMargin, float parasiteSearchRadius,
|
|
|
|
float parasiteSeparationDist, float parasiteSeparationWeight, float parasiteAlignmentWeight,
|
|
|
|
float parasiteCohesionWeight, float destinationSeekWeight, float forwardMoveWeight,
|
|
|
|
float playerSeparationDist, float playerSeparationWeight, float playerObstructionMinDist,
|
|
|
|
float haltDelay, bool disableMove, EWalkerType wType, const CDamageVulnerability& dVuln,
|
|
|
|
const CDamageInfo& parInfo, u16 haltSfx, u16 getUpSfx, u16 crouchSfx, CAssetId modelRes,
|
|
|
|
CAssetId skinRes, float iceZoomerJointHP,
|
|
|
|
const CActorParameters& aParams);
|
2018-05-02 00:43:31 +00:00
|
|
|
|
|
|
|
void Accept(IVisitor&);
|
2018-09-16 23:22:35 +00:00
|
|
|
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&);
|
|
|
|
void PreThink(float, CStateManager&);
|
|
|
|
void Think(float dt, CStateManager& mgr);
|
2018-11-12 04:21:36 +00:00
|
|
|
void Render(const CStateManager&) const;
|
|
|
|
const CDamageVulnerability* GetDamageVulnerability() const;
|
2018-11-13 09:20:11 +00:00
|
|
|
CDamageInfo GetContactDamage() const;
|
2018-11-12 04:21:36 +00:00
|
|
|
void Touch(CActor& actor, CStateManager&);
|
|
|
|
zeus::CVector3f GetAimPosition(const CStateManager&, float) const;
|
|
|
|
void CollidedWith(TUniqueId uid, const CCollisionInfoList&, CStateManager&);
|
|
|
|
void Death(CStateManager& mgr, const zeus::CVector3f& direction, EScriptObjectState state);
|
|
|
|
void Patrol(CStateManager&, EStateMsg msg, float dt);
|
|
|
|
void PathFind(CStateManager&, EStateMsg msg, float dt);
|
|
|
|
void TargetPlayer(CStateManager&, EStateMsg msg, float dt);
|
|
|
|
void TargetPatrol(CStateManager&, EStateMsg msg, float dt);
|
|
|
|
void Halt(CStateManager&, EStateMsg, float);
|
|
|
|
void Run(CStateManager&, EStateMsg, float);
|
|
|
|
void Generate(CStateManager&, EStateMsg, float);
|
|
|
|
void Deactivate(CStateManager&, EStateMsg, float);
|
|
|
|
void Attack(CStateManager&, EStateMsg, float);
|
|
|
|
void Crouch(CStateManager&, EStateMsg, float);
|
|
|
|
void GetUp(CStateManager&, EStateMsg, float);
|
|
|
|
void TelegraphAttack(CStateManager&, EStateMsg, float);
|
|
|
|
void Jump(CStateManager&, EStateMsg, float);
|
|
|
|
void Retreat(CStateManager&, EStateMsg, float);
|
|
|
|
bool AnimOver(CStateManager&, float);
|
|
|
|
bool ShouldAttack(CStateManager&, float);
|
|
|
|
bool HitSomething(CStateManager&, float);
|
|
|
|
bool Stuck(CStateManager&, float);
|
|
|
|
bool Landed(CStateManager&, float);
|
|
|
|
bool AttackOver(CStateManager&, float);
|
|
|
|
bool ShotAt(CStateManager&, float);
|
|
|
|
void MassiveDeath(CStateManager&);
|
|
|
|
void MassiveFrozenDeath(CStateManager&);
|
|
|
|
void ThinkAboutMove(float);
|
|
|
|
bool IsOnGround() const;
|
|
|
|
virtual void UpdateWalkerAnimation(CStateManager&, float);
|
2017-11-20 17:33:21 +00:00
|
|
|
};
|
|
|
|
}
|