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;
|
2017-05-10 10:03:29 +00:00
|
|
|
class CElementGen;
|
2018-12-08 05:30:43 +00:00
|
|
|
class CFlameThrower : public CGameProjectile {
|
2019-06-12 02:05:17 +00:00
|
|
|
public:
|
|
|
|
enum class EFlameState {
|
|
|
|
Default,
|
|
|
|
FireStart,
|
|
|
|
FireActive,
|
|
|
|
FireStopTimer,
|
|
|
|
FireWaitForParticlesDone
|
|
|
|
};
|
|
|
|
private:
|
2018-12-08 05:30:43 +00:00
|
|
|
static const zeus::CVector3f kLightOffset;
|
2019-06-12 02:05:17 +00:00
|
|
|
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;
|
2019-06-12 02:05:17 +00:00
|
|
|
CFlameWarp x34c_flameWarp;
|
|
|
|
EFlameState x3f0_flameState = EFlameState::Default;
|
|
|
|
CAssetId x3f4_playerSteamTxtr;
|
|
|
|
s16 x3f8_playerHitSfx;
|
|
|
|
CAssetId x3fc_playerIceTxtr;
|
2017-05-18 10:58:15 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
union {
|
|
|
|
struct {
|
2019-06-12 02:05:17 +00:00
|
|
|
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 */
|
2017-05-18 10:58:15 +00:00
|
|
|
};
|
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&);
|
2019-05-10 02:33:56 +00:00
|
|
|
void SetFlameLightActive(CStateManager&, bool);
|
|
|
|
void UpdateFlameState(float, CStateManager&);
|
2019-06-12 02:05:17 +00:00
|
|
|
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
|
|
|
|
2019-08-09 12:45:18 +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);
|
2019-06-12 02:05:17 +00:00
|
|
|
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
|