metaforce/Runtime/Weapon/CAuxWeapon.hpp

58 lines
2.5 KiB
C++

#ifndef __URDE_CAUXWEAPON_HPP__
#define __URDE_CAUXWEAPON_HPP__
#include "CPlayerState.hpp"
#include "RetroTypes.hpp"
#include "CStateManager.hpp"
#include "CGunWeapon.hpp"
#include "CWeapon.hpp"
namespace urde
{
class CAuxWeapon
{
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;
bool x80_24_isLoaded : 1;
void InitComboData();
void FreeComboVoiceId();
void DeleteFlameThrower(CStateManager& mgr);
void CreateFlameThrower(const zeus::CTransform& xf, CStateManager& mgr, float dt);
void DeleteWaveBusterBeam(CStateManager& mgr);
void CreateWaveBusterBeam(CWeapon::EProjectileAttrib attribs, TUniqueId homingTarget,
const zeus::CTransform& xf, CStateManager& mgr);
void LaunchMissile(float dt, bool underwater, bool charged, CPlayerState::EBeamId currentBeam,
CWeapon::EProjectileAttrib attrib, const zeus::CTransform& xf, TUniqueId homingId,
CStateManager& mgr);
public:
explicit CAuxWeapon(TUniqueId playerId);
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CStateManager& mgr);
bool IsComboFxActive(const CStateManager& mgr) const;
void Load(CPlayerState::EBeamId curBeam, CStateManager& mgr);
void StopComboFx(CStateManager& mgr, bool deactivate);
bool UpdateComboFx(float dt, const zeus::CVector3f& scale, const zeus::CVector3f& pos,
const zeus::CTransform& xf, CStateManager& mgr);
void Fire(float dt, bool underwater, CPlayerState::EBeamId currentBeam, EChargeState chargeState,
const zeus::CTransform& xf, CStateManager& mgr, EWeaponType type, TUniqueId homingId);
void LoadIdle();
bool IsLoaded() const { return x80_24_isLoaded; }
void RenderMuzzleFx() const;
TUniqueId HasTarget(const CStateManager& mgr) const;
void SetNewTarget(TUniqueId targetId, CStateManager& mgr);
};
}
#endif // __URDE_CAUXWEAPON_HPP__