2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-04-25 05:46:28 +00:00
|
|
|
|
|
|
|
#include "World/CPatterned.hpp"
|
2019-01-16 04:22:44 +00:00
|
|
|
#include "World/CPathFindSearch.hpp"
|
|
|
|
#include "Weapon/CProjectileInfo.hpp"
|
|
|
|
#include "Collision/CCollidableSphere.hpp"
|
2016-04-25 05:46:28 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
2016-04-25 05:46:28 +00:00
|
|
|
class CDamageInfo;
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace MP1 {
|
|
|
|
class CWarWasp : public CPatterned {
|
2019-01-16 04:22:44 +00:00
|
|
|
s32 x568_stateProg = -1;
|
|
|
|
CCollidableSphere x570_cSphere;
|
|
|
|
CPathFindSearch x590_pfSearch;
|
|
|
|
TUniqueId x674_aiMgr = kInvalidUniqueId;
|
|
|
|
zeus::CVector3f x678_targetPos;
|
|
|
|
CDamageInfo x684_;
|
|
|
|
zeus::CQuaternion x6a0_initialRot;
|
|
|
|
zeus::CVector3f x6b0_circleBurstPos;
|
|
|
|
zeus::CVector3f x6bc_circleBurstDir;
|
|
|
|
zeus::CVector3f x6c8_circleBurstRight;
|
|
|
|
CProjectileInfo x6d4_projectileInfo;
|
|
|
|
float x6fc_initialSpeed = x3b4_speed;
|
|
|
|
float x700_attackRemTime = 0.f;
|
|
|
|
pas::EStepDirection x704_dodgeDir = pas::EStepDirection::Invalid;
|
|
|
|
s32 x708_circleAttackTeam = -1;
|
|
|
|
s32 x70c_initialCircleAttackTeam = -1;
|
|
|
|
s32 x710_initialCircleAttackTeamUnit = -1;
|
|
|
|
float x714_circleTelegraphSeekHeight = 0.f;
|
|
|
|
float x718_circleBurstOffTotemAngle = zeus::degToRad(90.f);
|
|
|
|
TLockedToken<CGenDescription> x71c_projectileVisorParticle; // Used to be optional
|
|
|
|
u16 x72c_projectileVisorSfx;
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
bool x72e_24_jumpBackRepeat : 1;
|
|
|
|
bool x72e_25_canApplyDamage : 1;
|
|
|
|
bool x72e_26_initiallyInactive : 1;
|
|
|
|
bool x72e_27_teamMatesMelee : 1;
|
|
|
|
bool x72e_28_inProjectileAttack : 1;
|
|
|
|
bool x72e_29_pathObstructed : 1;
|
|
|
|
bool x72e_30_isRetreating : 1;
|
|
|
|
bool x72e_31_heardNoise : 1;
|
|
|
|
};
|
|
|
|
u32 _dummy = 0;
|
|
|
|
};
|
|
|
|
void SwarmAdd(CStateManager& mgr);
|
|
|
|
void SwarmRemove(CStateManager& mgr);
|
|
|
|
void ApplyDamage(CStateManager& mgr);
|
|
|
|
void SetUpCircleBurstWaypoint(CStateManager& mgr);
|
|
|
|
zeus::CVector3f GetProjectileAimPos(CStateManager& mgr, float zBias);
|
|
|
|
zeus::CVector3f GetCloseInPos(const CStateManager& mgr, const zeus::CVector3f& aimPos) const;
|
|
|
|
float GetCloseInZBasis(const CStateManager& mgr) const;
|
|
|
|
void SetUpPathFindBehavior(CStateManager& mgr);
|
|
|
|
s32 GetAttackTeamSize(CStateManager& mgr, s32 team);
|
|
|
|
float CalcTimeToNextAttack(CStateManager& mgr);
|
|
|
|
float CalcOffTotemAngle(CStateManager& mgr);
|
|
|
|
void JoinCircleAttackTeam(s32 unit, CStateManager& mgr);
|
|
|
|
void SetUpCircleTelegraphTeam(CStateManager& mgr);
|
|
|
|
TUniqueId GetAttackTeamLeader(CStateManager& mgr, s32 team);
|
|
|
|
void TryCircleTeamMerge(CStateManager& mgr);
|
|
|
|
float GetTeamZStratum(s32 team);
|
|
|
|
float CalcSeekMagnitude(CStateManager& mgr);
|
|
|
|
void UpdateTelegraphMoveSpeed(CStateManager& mgr);
|
|
|
|
bool CheckCircleAttackSpread(CStateManager& mgr, s32 team);
|
|
|
|
void ApplyNormalSteering(CStateManager& mgr);
|
|
|
|
void ApplySeparationBehavior(CStateManager& mgr, float sep);
|
|
|
|
bool PathToHiveIsClear(CStateManager& mgr);
|
|
|
|
bool SteerToDeactivatePos(CStateManager& mgr, EStateMsg msg, float dt);
|
|
|
|
zeus::CVector3f CalcShuffleDest(CStateManager& mgr);
|
2019-01-31 20:44:05 +00:00
|
|
|
|
2016-04-25 05:46:28 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
DEFINE_PATTERNED(WarWasp)
|
|
|
|
CWarWasp(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
|
|
|
|
CModelData&& mData, const CPatternedInfo& pInfo, CPatterned::EFlavorType flavor, CPatterned::EColliderType,
|
2019-01-16 04:22:44 +00:00
|
|
|
const CDamageInfo& dInfo1, const CActorParameters&, CAssetId projectileWeapon,
|
|
|
|
const CDamageInfo& projectileDamage, CAssetId projectileVisorParticle, u32 projecileVisorSfx);
|
2017-01-18 22:30:02 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void Accept(IVisitor& visitor);
|
2019-01-16 04:22:44 +00:00
|
|
|
void Think(float dt, CStateManager& mgr);
|
|
|
|
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CStateManager& mgr);
|
|
|
|
|
2019-01-29 08:28:35 +00:00
|
|
|
rstl::optional<zeus::CAABox> GetTouchBounds() const;
|
2019-01-16 04:22:44 +00:00
|
|
|
void DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, EUserEventType type, float dt);
|
|
|
|
const CCollisionPrimitive* GetCollisionPrimitive() const;
|
|
|
|
void Death(CStateManager& mgr, const zeus::CVector3f& direction, EScriptObjectState state);
|
|
|
|
bool IsListening() const;
|
|
|
|
bool Listen(const zeus::CVector3f&, EListenNoiseType);
|
2019-01-31 20:44:05 +00:00
|
|
|
zeus::CVector3f GetOrigin(const CStateManager& mgr, const CTeamAiRole& role, const zeus::CVector3f& aimPos) const;
|
2019-01-16 04:22:44 +00:00
|
|
|
void UpdateTouchBounds();
|
|
|
|
bool IsRetreating() const { return x72e_30_isRetreating; }
|
|
|
|
|
|
|
|
void Patrol(CStateManager&, EStateMsg, float);
|
|
|
|
void PathFind(CStateManager& mgr, EStateMsg msg, float dt);
|
|
|
|
void TargetPatrol(CStateManager&, EStateMsg, float);
|
|
|
|
void Generate(CStateManager&, EStateMsg, float);
|
|
|
|
void Deactivate(CStateManager&, EStateMsg, float);
|
|
|
|
void Attack(CStateManager&, EStateMsg, float);
|
|
|
|
void JumpBack(CStateManager&, EStateMsg, float);
|
|
|
|
void Shuffle(CStateManager&, EStateMsg, float);
|
|
|
|
void ProjectileAttack(CStateManager&, EStateMsg, float);
|
|
|
|
void TelegraphAttack(CStateManager&, EStateMsg, float);
|
|
|
|
void Dodge(CStateManager&, EStateMsg, float);
|
|
|
|
void Retreat(CStateManager&, EStateMsg, float);
|
|
|
|
void SpecialAttack(CStateManager&, EStateMsg, float);
|
|
|
|
|
|
|
|
bool InAttackPosition(CStateManager&, float);
|
|
|
|
bool Leash(CStateManager&, float);
|
|
|
|
bool PathShagged(CStateManager&, float);
|
|
|
|
bool AnimOver(CStateManager&, float);
|
|
|
|
bool ShouldAttack(CStateManager&, float);
|
|
|
|
bool InPosition(CStateManager&, float);
|
|
|
|
bool ShouldTurn(CStateManager&, float);
|
|
|
|
bool HearShot(CStateManager&, float);
|
|
|
|
bool ShouldFire(CStateManager&, float);
|
|
|
|
bool ShouldDodge(CStateManager&, float);
|
|
|
|
bool ShouldSpecialAttack(CStateManager&, float);
|
|
|
|
|
|
|
|
CPathFindSearch* GetSearchPath();
|
|
|
|
CProjectileInfo* GetProjectileInfo();
|
2016-04-25 05:46:28 +00:00
|
|
|
};
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace MP1
|
|
|
|
} // namespace urde
|