metaforce/Runtime/MP1/World/CJellyZap.hpp

64 lines
2.9 KiB
C++
Raw Normal View History

2019-02-12 01:58:12 +00:00
#pragma once
#include "Runtime/World/CPatterned.hpp"
2019-02-12 01:58:12 +00:00
2021-04-10 08:42:06 +00:00
namespace metaforce::MP1 {
2019-02-12 01:58:12 +00:00
class CJellyZap : public CPatterned {
u32 x568_ = 0;
CDamageInfo x56c_attackDamage;
float x588_attackRadius;
float x58c_;
float x590_;
float x594_;
float x598_;
2020-03-16 02:00:52 +00:00
float x59c_priority;
float x5a0_repulseRadius;
float x5a4_attractRadius;
2019-02-12 01:58:12 +00:00
float x5a8_attackDelay;
float x5ac_;
float x5b0_;
float x5b4_;
bool x5b8_24_ : 1 = false;
bool x5b8_25_ : 1 = false;
2019-02-12 01:58:12 +00:00
bool x5b8_26_ : 1;
2020-03-16 02:00:52 +00:00
void AddSelfToFishCloud(CStateManager&, float, float, bool);
2019-02-12 01:58:12 +00:00
void AddRepulsor(CStateManager&);
void AddAttractor(CStateManager&);
void RemoveSelfFromFishCloud(CStateManager&);
void RemoveAllAttractors(CStateManager&);
bool ClosestToPlayer(const CStateManager&) const;
2020-03-16 02:00:52 +00:00
bool sub801d8190() const { return x568_ != 1; }
2019-02-12 01:58:12 +00:00
public:
DEFINE_PATTERNED(JellyZap);
2019-02-12 01:58:12 +00:00
2021-04-26 03:16:16 +00:00
CJellyZap(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
CModelData&& mData, const CDamageInfo& attackDamage, bool b1, float attackRadius, float f2, float f3, float f4, float attackDelay,
float f6, float f7, float f8, float priority, float repulseRadius, float attractRadius, float f12,
const CPatternedInfo& pInfo, const CActorParameters& actParms);
2019-02-12 01:58:12 +00:00
void Accept(IVisitor&) override;
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override;
void Think(float, CStateManager&) override;
void DoUserAnimEvent(CStateManager&, const CInt32POINode&, EUserEventType, float dt) override;
2021-04-26 03:16:16 +00:00
void KnockBack(const zeus::CVector3f&, CStateManager&, const CDamageInfo& info, EKnockBackType type, bool inDeferred,
float magnitude) override;
2020-03-16 02:00:52 +00:00
const CDamageVulnerability* GetDamageVulnerability() const override { return CAi::GetDamageVulnerability(); }
const CDamageVulnerability* GetDamageVulnerability(const zeus::CVector3f& pos, const zeus::CVector3f& dir,
const CDamageInfo& info) const override;
EWeaponCollisionResponseTypes GetCollisionResponseType(const zeus::CVector3f&, const zeus::CVector3f&,
const CWeaponMode&, EProjectileAttrib) const override {
return sub801d8190() ? EWeaponCollisionResponseTypes::Unknown89 : EWeaponCollisionResponseTypes::Unknown39;
}
void Attack(CStateManager&, EStateMsg, float) override;
void Suck(CStateManager&, EStateMsg, float) override;
void Active(CStateManager&, EStateMsg, float) override;
void InActive(CStateManager&, EStateMsg, float) override;
void Flinch(CStateManager&, EStateMsg, float) override;
bool ShouldAttack(CStateManager&, float) override { return x330_stateMachineState.GetTime() > x5a8_attackDelay; }
bool ShouldSpecialAttack(CStateManager& mgr, float) override { return ClosestToPlayer(mgr); }
bool InAttackPosition(CStateManager&, float) override;
bool InDetectionRange(CStateManager&, float) override;
2019-02-12 01:58:12 +00:00
};
2021-04-10 08:42:06 +00:00
} // namespace metaforce::MP1