metaforce/Runtime/MP1/World/CPuddleToadGamma.hpp

79 lines
3.1 KiB
C++
Raw Permalink Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2018-02-11 05:27:00 +00:00
#include <memory>
#include <string_view>
#include "Runtime/Collision/CCollidableOBBTreeGroup.hpp"
#include "Runtime/World/CPatterned.hpp"
#include <zeus/CVector3f.hpp>
2018-02-11 05:27:00 +00:00
2021-04-10 08:42:06 +00:00
namespace metaforce::MP1 {
2018-02-11 05:27:00 +00:00
2018-12-08 05:30:43 +00:00
class CPuddleToadGamma final : public CPatterned {
u32 x568_stateProg = 0;
float x56c_waitTimer = 0.f;
CDamageInfo x570_playerShootDamage;
2018-12-08 05:30:43 +00:00
CDamageInfo x58c_;
float x5a8_suckForceMultiplier;
float x5ac_minSuckAngleProj;
float x5b0_playerSuckRange;
zeus::CVector3f x5b4_localShootDir;
float x5c0_playerShootSpeed;
float x5c4_shouldAttackWaitTime;
float x5c8_spotPlayerWaitTime;
zeus::CVector3f x5cc_suckPoint;
zeus::CVector3f x5d8_damageablePoint;
2018-12-08 05:30:43 +00:00
std::unique_ptr<CCollidableOBBTreeGroup> x5e4_collisionTreePrim;
bool x5e8_24_playerInside : 1 = false;
bool x5e8_25_waitTimerActive : 1 = false;
bool x5e8_26_shotPlayer : 1 = false;
2018-12-01 00:44:33 +00:00
2018-12-08 05:30:43 +00:00
void SetSolid(CStateManager&, bool);
2018-12-01 00:44:33 +00:00
2018-12-08 05:30:43 +00:00
static void CenterPlayer(CStateManager&, const zeus::CVector3f&, float);
void ShootPlayer(CStateManager&, float);
void SuckPlayer(CStateManager&, float);
bool PlayerInVortexArea(const CStateManager&) const;
2018-12-08 05:30:43 +00:00
void SetPlayerPosition(CStateManager&, const zeus::CVector3f&);
2018-12-01 00:44:33 +00:00
2018-02-11 05:27:00 +00:00
public:
DEFINE_PATTERNED(PuddleToad);
2018-12-01 00:44:33 +00:00
2018-12-08 05:30:43 +00:00
CPuddleToadGamma(TUniqueId uid, std::string_view name, EFlavorType flavor, const CEntityInfo& info,
const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo,
const CActorParameters& aParms, float suckForceMultiplier, float suckAngle, float playerSuckRange,
const zeus::CVector3f& localShootDir, float playerShootSpeed, float shouldAttackWaitTime,
float spotPlayerWaitTime, const CDamageInfo& playerShootDamage, const CDamageInfo& dInfo2,
CAssetId dcln);
2018-12-01 00:44:33 +00:00
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override;
void Think(float dt, CStateManager& mgr) override;
void DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, EUserEventType type, float dt) override;
std::optional<zeus::CAABox> GetTouchBounds() const override;
2018-12-01 00:44:33 +00:00
2018-12-08 05:30:43 +00:00
const CDamageVulnerability* GetDamageVulnerability(const zeus::CVector3f&, const zeus::CVector3f&,
const CDamageInfo&) const override;
2018-12-01 00:44:33 +00:00
const CDamageVulnerability* GetDamageVulnerability() const override {
return &CDamageVulnerability::ImmuneVulnerabilty();
}
2018-12-01 00:44:33 +00:00
const CCollisionPrimitive* GetCollisionPrimitive() const override;
2018-12-01 00:44:33 +00:00
zeus::CTransform GetPrimitiveTransform() const override;
2018-12-01 00:44:33 +00:00
void InActive(CStateManager&, EStateMsg, float) override;
void Active(CStateManager&, EStateMsg, float) override;
void Suck(CStateManager&, EStateMsg, float) override;
void Attack(CStateManager&, EStateMsg, float) override;
void Crouch(CStateManager&, EStateMsg, float) override;
bool InAttackPosition(CStateManager&, float) override;
bool SpotPlayer(CStateManager&, float) override;
bool ShouldAttack(CStateManager&, float) override;
bool LostInterest(CStateManager&, float) override;
bool Inside(CStateManager&, float) override;
2018-02-11 05:27:00 +00:00
};
2021-04-10 08:42:06 +00:00
} // namespace metaforce::MP1