2018-10-11 22:57:05 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "World/CPatterned.hpp"
|
2018-11-21 00:02:20 +00:00
|
|
|
#include "Character/CBoneTracking.hpp"
|
|
|
|
#include "Weapon/CProjectileInfo.hpp"
|
2018-10-11 22:57:05 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde::MP1 {
|
|
|
|
class CEyeball : public CPatterned {
|
|
|
|
static constexpr std::string_view skEyeLocator = "Laser_LCTR"sv;
|
|
|
|
float x568_attackDelay;
|
|
|
|
float x56c_maxAttackDelay;
|
|
|
|
CBoneTracking x570_boneTracking;
|
|
|
|
zeus::CVector3f x5a8_targetPosition;
|
|
|
|
CProjectileInfo x5b4_projectileInfo;
|
|
|
|
CAssetId x5dc_;
|
|
|
|
CAssetId x5e0_;
|
|
|
|
CAssetId x5e4_;
|
|
|
|
CAssetId x5e8_;
|
|
|
|
TUniqueId x5ec_projectileId = kInvalidUniqueId;
|
|
|
|
u32 x5f0_currentAnim = 0;
|
|
|
|
s32 x5f4_animIdxs[4];
|
|
|
|
u16 x604_beamSfxId;
|
|
|
|
CSfxHandle x608_beamSfx = 0;
|
|
|
|
bool x60c_24_canAttack : 1;
|
|
|
|
bool x60c_25_playerInRange : 1;
|
|
|
|
bool x60c_26_alert : 1;
|
|
|
|
bool x60c_27_attackDisabled : 1;
|
|
|
|
bool x60c_28_firingBeam : 1;
|
|
|
|
|
|
|
|
void CreateBeam(CStateManager&);
|
|
|
|
void FireBeam(CStateManager&, const zeus::CTransform&);
|
|
|
|
void TryFlinch(CStateManager&, int);
|
|
|
|
void UpdateAnimation();
|
|
|
|
void ResetBeamState(CStateManager&);
|
|
|
|
|
2018-10-11 22:57:05 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
DEFINE_PATTERNED(EyeBall)
|
2018-10-11 22:57:05 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
CEyeball(TUniqueId, std::string_view, EFlavorType, const CEntityInfo&, const zeus::CTransform&, CModelData&&,
|
|
|
|
const CPatternedInfo&, float, float, CAssetId, const CDamageInfo&, CAssetId, CAssetId, CAssetId, CAssetId,
|
|
|
|
u32, u32, u32, u32, u32, bool, const CActorParameters&);
|
2018-11-21 00:02:20 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void Accept(IVisitor& visitor);
|
|
|
|
void PreRender(CStateManager&, const zeus::CFrustum&);
|
|
|
|
void Touch(CActor&, CStateManager&){};
|
|
|
|
void Death(CStateManager&, const zeus::CVector3f&, EScriptObjectState);
|
2018-11-21 00:02:20 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr);
|
|
|
|
void DoUserAnimEvent(CStateManager&, const CInt32POINode&, EUserEventType, float);
|
|
|
|
void Think(float, CStateManager&);
|
|
|
|
void Flinch(CStateManager&, EStateMsg, float);
|
|
|
|
void Active(CStateManager&, EStateMsg, float);
|
|
|
|
void InActive(CStateManager&, EStateMsg, float);
|
2018-11-21 00:02:20 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void Cover(CStateManager&, EStateMsg, float);
|
2018-10-11 22:57:05 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
bool ShouldAttack(CStateManager&, float) { return x60c_26_alert; }
|
|
|
|
bool ShouldFire(CStateManager&, float) { return !x60c_27_attackDisabled; }
|
2018-10-11 22:57:05 +00:00
|
|
|
};
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde::MP1
|