2018-10-11 22:57:05 +00:00
|
|
|
#pragma once
|
|
|
|
|
2019-09-28 02:53:03 +00:00
|
|
|
#include <string_view>
|
|
|
|
|
|
|
|
#include "Runtime/RetroTypes.hpp"
|
|
|
|
#include "Runtime/Character/CBoneTracking.hpp"
|
|
|
|
#include "Runtime/Weapon/CProjectileInfo.hpp"
|
|
|
|
#include "Runtime/World/CPatterned.hpp"
|
|
|
|
|
|
|
|
#include <zeus/CVector3f.hpp>
|
2018-10-11 22:57:05 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde::MP1 {
|
|
|
|
class CEyeball : public CPatterned {
|
|
|
|
float x568_attackDelay;
|
2019-01-16 04:22:44 +00:00
|
|
|
float x56c_attackStartTime;
|
2018-12-08 05:30:43 +00:00
|
|
|
CBoneTracking x570_boneTracking;
|
|
|
|
zeus::CVector3f x5a8_targetPosition;
|
|
|
|
CProjectileInfo x5b4_projectileInfo;
|
2019-01-16 04:22:44 +00:00
|
|
|
CAssetId x5dc_beamContactFxId;
|
|
|
|
CAssetId x5e0_beamPulseFxId;
|
|
|
|
CAssetId x5e4_beamTextureId;
|
|
|
|
CAssetId x5e8_beamGlowTextureId;
|
2018-12-08 05:30:43 +00:00
|
|
|
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
|
|
|
|
2019-01-16 04:22:44 +00:00
|
|
|
CEyeball(TUniqueId uid, std::string_view name, CPatterned::EFlavorType flavor, const CEntityInfo& info,
|
|
|
|
const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo, float attackDelay,
|
|
|
|
float attackStartTime, CAssetId wpscId, const CDamageInfo& dInfo, CAssetId beamContactFxId,
|
2019-01-31 20:44:05 +00:00
|
|
|
CAssetId beamPulseFxId, CAssetId beamTextureId, CAssetId beamGlowTextureId, u32 anim0, u32 anim1, u32 anim2,
|
|
|
|
u32 anim3, u32 beamSfx, bool attackDisabled, const CActorParameters& actParms);
|
2018-11-21 00:02:20 +00:00
|
|
|
|
2019-08-09 19:46:49 +00:00
|
|
|
void Accept(IVisitor& visitor) override;
|
|
|
|
void PreRender(CStateManager&, const zeus::CFrustum&) override;
|
|
|
|
void Touch(CActor&, CStateManager&) override {}
|
|
|
|
void Death(CStateManager&, const zeus::CVector3f&, EScriptObjectState) override;
|
|
|
|
|
|
|
|
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) override;
|
|
|
|
void DoUserAnimEvent(CStateManager&, const CInt32POINode&, EUserEventType, float) override;
|
|
|
|
void Think(float, CStateManager&) override;
|
|
|
|
void Flinch(CStateManager&, EStateMsg, float) override;
|
|
|
|
void Active(CStateManager&, EStateMsg, float) override;
|
|
|
|
void InActive(CStateManager&, EStateMsg, float) override;
|
|
|
|
|
|
|
|
void Cover(CStateManager&, EStateMsg, float) override;
|
|
|
|
|
|
|
|
bool ShouldAttack(CStateManager&, float) override { return x60c_26_alert; }
|
|
|
|
bool ShouldFire(CStateManager&, float) override { return !x60c_27_attackDisabled; }
|
2018-10-11 22:57:05 +00:00
|
|
|
};
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde::MP1
|