2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2017-05-09 13:27:07 +00:00
|
|
|
|
2019-09-22 21:52:05 +00:00
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
#include "Runtime/Particle/CFlameWarp.hpp"
|
|
|
|
#include "Runtime/Weapon/CGameProjectile.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;
|
2020-04-11 04:49:02 +00:00
|
|
|
bool x400_24_active : 1;
|
|
|
|
bool x400_25_particlesActive : 1;
|
|
|
|
bool x400_26_ : 1;
|
|
|
|
bool x400_27_coneCollision : 1; /* Z-sort and finer collision detection */
|
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;
|
2020-04-05 11:54:02 +00:00
|
|
|
void AddToRenderer(const zeus::CFrustum&, CStateManager&) override;
|
2020-04-09 17:28:20 +00:00
|
|
|
void Render(CStateManager& mgr) override;
|
2020-03-04 11:49:49 +00:00
|
|
|
std::optional<zeus::CAABox> GetTouchBounds() const override;
|
|
|
|
void Touch(CActor& actor, CStateManager& mgr) 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
|