metaforce/Runtime/Weapon/CFlameThrower.hpp

64 lines
2.2 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2017-05-09 13:27:07 +00:00
#include "Weapon/CGameProjectile.hpp"
2019-04-16 08:00:46 +00:00
#include "Particle/CFlameWarp.hpp"
2017-05-09 13:27:07 +00:00
2018-12-08 05:30:43 +00:00
namespace urde {
2017-05-09 13:27:07 +00:00
class CFlameInfo;
class CElementGen;
2018-12-08 05:30:43 +00:00
class CFlameThrower : public CGameProjectile {
public:
enum class EFlameState {
Default,
FireStart,
FireActive,
FireStopTimer,
FireWaitForParticlesDone
};
private:
2018-12-08 05:30:43 +00:00
static const zeus::CVector3f kLightOffset;
zeus::CTransform x2e8_flameXf;
zeus::CAABox x318_flameBounds = zeus::skNullBox;
float x330_particleWaitDelayTimer = 0.f;
float x334_fireStopTimer = 0.f;
2019-04-16 08:00:46 +00:00
float x338_;
2018-12-08 05:30:43 +00:00
TToken<CGenDescription> x33c_flameDesc;
std::unique_ptr<CElementGen> x348_flameGen;
CFlameWarp x34c_flameWarp;
EFlameState x3f0_flameState = EFlameState::Default;
CAssetId x3f4_playerSteamTxtr;
s16 x3f8_playerHitSfx;
CAssetId x3fc_playerIceTxtr;
2018-12-08 05:30:43 +00:00
union {
struct {
bool x400_24_active : 1;
bool x400_25_particlesActive : 1;
2019-04-16 08:00:46 +00:00
bool x400_26_ : 1;
2019-06-16 02:22:23 +00:00
bool x400_27_coneCollision : 1; /* Z-sort and finer collision detection */
};
2018-12-08 05:30:43 +00:00
u32 _dummy = 0;
};
2017-05-20 07:41:49 +00:00
2019-04-16 08:00:46 +00:00
void CreateFlameParticles(CStateManager&);
void SetFlameLightActive(CStateManager&, bool);
void UpdateFlameState(float, CStateManager&);
CRayCastResult DoCollisionCheck(TUniqueId& idOut, const zeus::CAABox& aabb, CStateManager& mgr);
void ApplyDamageToActor(CStateManager& mgr, TUniqueId id, float dt);
2017-05-09 13:27:07 +00:00
public:
2018-12-08 05:30:43 +00:00
CFlameThrower(const TToken<CWeaponDescription>& wDesc, std::string_view name, EWeaponType wType,
const CFlameInfo& flameInfo, const zeus::CTransform& xf, EMaterialTypes matType,
const CDamageInfo& dInfo, TUniqueId uid, TAreaId aId, TUniqueId owner, EProjectileAttrib attribs,
2019-06-30 07:29:49 +00:00
CAssetId playerSteamTxtr, s16 playerHitSfx, CAssetId playerIceTxtr);
2017-05-09 13:27:07 +00:00
void Accept(IVisitor& visitor) override;
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override;
void Think(float, CStateManager&) override;
void AddToRenderer(const zeus::CFrustum&, const CStateManager&) const override;
2018-12-31 08:37:52 +00:00
void SetTransform(const zeus::CTransform& xf, float);
2018-12-08 05:30:43 +00:00
void Reset(CStateManager&, bool);
void Fire(const zeus::CTransform&, CStateManager&, bool);
bool GetParticlesActive() const { return x400_25_particlesActive; }
2017-05-09 13:27:07 +00:00
};
2018-12-08 05:30:43 +00:00
} // namespace urde