metaforce/Runtime/Weapon/CAuxWeapon.hpp

56 lines
2.4 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2017-08-31 02:42:37 +00:00
#include "CPlayerState.hpp"
#include "RetroTypes.hpp"
2017-08-25 06:18:09 +00:00
#include "CStateManager.hpp"
2017-09-02 04:06:05 +00:00
#include "CGunWeapon.hpp"
2017-09-10 00:36:21 +00:00
#include "CWeapon.hpp"
namespace urde
{
class CAuxWeapon
{
2017-09-10 00:36:21 +00:00
TCachedToken<CWeaponDescription> x0_missile;
TCachedToken<CGenDescription> xc_flameMuzzle;
TCachedToken<CGenDescription> x18_busterMuzzle;
std::unique_ptr<CElementGen> x24_muzzleFxGen;
rstl::reserved_vector<TCachedToken<CWeaponDescription>, 5> x28_combos;
float x68_ammoConsumeTimer = 0.f;
TUniqueId x6c_playerId;
TUniqueId x6e_flameThrowerId = kInvalidUniqueId;
TUniqueId x70_waveBusterId = kInvalidUniqueId;
CPlayerState::EBeamId x74_firingBeamId = CPlayerState::EBeamId::Invalid;
CPlayerState::EBeamId x78_loadBeamId = CPlayerState::EBeamId::Power;
CSfxHandle x7c_comboSfx;
2017-08-26 04:36:25 +00:00
bool x80_24_isLoaded : 1;
2017-09-10 00:36:21 +00:00
void InitComboData();
void FreeComboVoiceId();
void DeleteFlameThrower(CStateManager& mgr);
void CreateFlameThrower(const zeus::CTransform& xf, CStateManager& mgr, float dt);
void DeleteWaveBusterBeam(CStateManager& mgr);
2018-02-12 05:30:21 +00:00
void CreateWaveBusterBeam(EProjectileAttrib attribs, TUniqueId homingTarget,
2017-09-10 00:36:21 +00:00
const zeus::CTransform& xf, CStateManager& mgr);
void LaunchMissile(float dt, bool underwater, bool charged, CPlayerState::EBeamId currentBeam,
2018-02-12 05:30:21 +00:00
EProjectileAttrib attrib, const zeus::CTransform& xf, TUniqueId homingId,
2017-09-10 00:36:21 +00:00
CStateManager& mgr);
public:
2017-09-10 00:36:21 +00:00
explicit CAuxWeapon(TUniqueId playerId);
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CStateManager& mgr);
2017-08-25 06:18:09 +00:00
bool IsComboFxActive(const CStateManager& mgr) const;
2017-08-31 02:42:37 +00:00
void Load(CPlayerState::EBeamId curBeam, CStateManager& mgr);
2017-09-10 00:36:21 +00:00
void StopComboFx(CStateManager& mgr, bool deactivate);
2017-09-02 04:06:05 +00:00
bool UpdateComboFx(float dt, const zeus::CVector3f& scale, const zeus::CVector3f& pos,
const zeus::CTransform& xf, CStateManager& mgr);
2017-09-10 00:36:21 +00:00
void Fire(float dt, bool underwater, CPlayerState::EBeamId currentBeam, EChargeState chargeState,
2017-09-02 04:06:05 +00:00
const zeus::CTransform& xf, CStateManager& mgr, EWeaponType type, TUniqueId homingId);
2017-08-26 04:36:25 +00:00
void LoadIdle();
bool IsLoaded() const { return x80_24_isLoaded; }
2017-08-31 02:42:37 +00:00
void RenderMuzzleFx() const;
2017-09-02 04:06:05 +00:00
TUniqueId HasTarget(const CStateManager& mgr) const;
void SetNewTarget(TUniqueId targetId, CStateManager& mgr);
};
}