2018-10-11 22:57:05 +00:00
|
|
|
#pragma once
|
|
|
|
|
2019-09-28 02:53:03 +00:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "Runtime/rstl.hpp"
|
|
|
|
#include "Runtime/Weapon/CProjectileInfo.hpp"
|
|
|
|
#include "Runtime/World/CPatterned.hpp"
|
|
|
|
#include "Runtime/World/CPathFindSearch.hpp"
|
2018-10-11 22:57:05 +00:00
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce::MP1 {
|
2018-12-08 05:30:43 +00:00
|
|
|
class CAtomicAlpha : public CPatterned {
|
2018-12-18 04:42:17 +00:00
|
|
|
static constexpr u32 skBombCount = 4;
|
|
|
|
struct SBomb {
|
|
|
|
std::string x0_locatorName;
|
|
|
|
pas::ELocomotionType x10_locomotionType;
|
|
|
|
float x14_scaleTime = FLT_MAX;
|
|
|
|
SBomb(const std::string_view locator, pas::ELocomotionType locomotionType)
|
2019-10-03 04:41:23 +00:00
|
|
|
: x0_locatorName(locator), x10_locomotionType(locomotionType) {}
|
2018-12-18 04:42:17 +00:00
|
|
|
};
|
2020-04-21 07:22:41 +00:00
|
|
|
bool x568_24_inRange : 1 = false;
|
2018-12-18 04:42:17 +00:00
|
|
|
bool x568_25_invisible : 1;
|
|
|
|
bool x568_26_applyBeamAttraction : 1;
|
2020-08-24 07:33:26 +00:00
|
|
|
float x56c_bombDropDelay;
|
2018-12-18 04:42:17 +00:00
|
|
|
float x570_bombReappearDelay;
|
|
|
|
float x574_bombRappearTime;
|
|
|
|
float x578_bombTime = 0.f;
|
|
|
|
u32 x57c_curBomb = 0;
|
|
|
|
CPathFindSearch x580_pathFind;
|
|
|
|
CSteeringBehaviors x664_steeringBehaviors;
|
|
|
|
CProjectileInfo x668_bombProjectile;
|
|
|
|
CModelData x690_bombModel;
|
|
|
|
rstl::reserved_vector<SBomb, skBombCount> x6dc_bombLocators;
|
2019-01-31 20:44:05 +00:00
|
|
|
|
2018-10-11 22:57:05 +00:00
|
|
|
public:
|
2020-08-23 19:03:33 +00:00
|
|
|
DEFINE_PATTERNED(AtomicAlpha);
|
2018-12-18 04:42:17 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
CAtomicAlpha(TUniqueId, std::string_view, const CEntityInfo&, const zeus::CTransform&, CModelData&&,
|
|
|
|
const CActorParameters&, const CPatternedInfo&, CAssetId, const CDamageInfo&, float, float, float,
|
|
|
|
CAssetId, bool, bool);
|
2018-12-18 04:42:17 +00:00
|
|
|
|
2019-08-09 19:46:49 +00:00
|
|
|
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override;
|
2020-04-09 17:28:20 +00:00
|
|
|
void Render(CStateManager&) override;
|
2020-04-05 11:54:02 +00:00
|
|
|
void AddToRenderer(const zeus::CFrustum& frustum, CStateManager& mgr) override;
|
2019-08-09 19:46:49 +00:00
|
|
|
void Think(float, CStateManager&) override;
|
|
|
|
void DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, EUserEventType type, float dt) override;
|
2018-12-18 04:42:17 +00:00
|
|
|
|
2019-08-09 19:46:49 +00:00
|
|
|
CPathFindSearch* GetSearchPath() override { return &x580_pathFind; }
|
2018-12-18 04:42:17 +00:00
|
|
|
|
|
|
|
EWeaponCollisionResponseTypes GetCollisionResponseType(const zeus::CVector3f&, const zeus::CVector3f&,
|
2019-08-09 19:46:49 +00:00
|
|
|
const CWeaponMode& wMode, EProjectileAttrib) const override {
|
2018-12-18 04:42:17 +00:00
|
|
|
return GetDamageVulnerability()->WeaponHits(wMode, false) ? EWeaponCollisionResponseTypes::AtomicAlpha
|
|
|
|
: EWeaponCollisionResponseTypes::AtomicAlphaReflect;
|
|
|
|
}
|
|
|
|
|
2019-08-09 19:46:49 +00:00
|
|
|
bool Leash(CStateManager& mgr, float) override;
|
|
|
|
bool AggressionCheck(CStateManager&, float) override;
|
|
|
|
void CollidedWith(TUniqueId, const CCollisionInfoList&, CStateManager&) override;
|
|
|
|
void Patrol(CStateManager&, EStateMsg, float) override;
|
|
|
|
void Attack(CStateManager&, EStateMsg, float) override;
|
2018-12-18 04:42:17 +00:00
|
|
|
|
2019-08-09 19:46:49 +00:00
|
|
|
CProjectileInfo* GetProjectileInfo() override { return &x668_bombProjectile; }
|
2018-10-11 22:57:05 +00:00
|
|
|
};
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce::MP1
|