2016-08-14 21:11:44 +00:00
|
|
|
#ifndef __URDE_CGUNWEAPON_HPP__
|
|
|
|
#define __URDE_CGUNWEAPON_HPP__
|
|
|
|
|
|
|
|
#include "RetroTypes.hpp"
|
|
|
|
#include "CWeaponMgr.hpp"
|
|
|
|
#include "Collision/CMaterialList.hpp"
|
|
|
|
#include "zeus/CVector3f.hpp"
|
2016-12-10 02:35:20 +00:00
|
|
|
#include "CPlayerState.hpp"
|
|
|
|
#include "Character/CAnimCharacterSet.hpp"
|
|
|
|
#include "Particle/CElementGen.hpp"
|
|
|
|
#include "CToken.hpp"
|
2017-08-25 06:18:09 +00:00
|
|
|
#include "CStateManager.hpp"
|
2016-08-14 21:11:44 +00:00
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
2016-12-10 02:35:20 +00:00
|
|
|
namespace NWeaponTypes
|
|
|
|
{
|
|
|
|
enum class EGunAnimType
|
|
|
|
{
|
2017-08-25 06:18:09 +00:00
|
|
|
Zero,
|
|
|
|
One,
|
|
|
|
Two,
|
|
|
|
Three,
|
|
|
|
Four,
|
|
|
|
FromMissile,
|
|
|
|
ToMissile,
|
|
|
|
Seven,
|
|
|
|
MissileReload,
|
|
|
|
FromBeam
|
2016-12-10 02:35:20 +00:00
|
|
|
};
|
|
|
|
}
|
2016-08-14 21:11:44 +00:00
|
|
|
|
2016-12-10 02:35:20 +00:00
|
|
|
class CActorLights;
|
|
|
|
class CGunController;
|
2016-12-11 01:54:08 +00:00
|
|
|
struct CModelFlags;
|
2017-07-23 23:45:04 +00:00
|
|
|
class CWeaponDescription;
|
|
|
|
|
|
|
|
class CVelocityInfo
|
|
|
|
{
|
|
|
|
friend class CGunWeapon;
|
|
|
|
rstl::reserved_vector<zeus::CVector3f, 2> x0_vel;
|
|
|
|
rstl::reserved_vector<bool, 2> x1c_;
|
|
|
|
rstl::reserved_vector<float, 2> x24_;
|
|
|
|
public:
|
|
|
|
const zeus::CVector3f& GetVelocity(int i) const { return x0_vel[i]; }
|
|
|
|
};
|
|
|
|
|
2016-08-14 21:11:44 +00:00
|
|
|
class CGunWeapon
|
|
|
|
{
|
|
|
|
public:
|
2017-08-25 06:18:09 +00:00
|
|
|
enum class ESecondaryFxType
|
2016-12-10 02:35:20 +00:00
|
|
|
{
|
2017-08-25 06:18:09 +00:00
|
|
|
Zero,
|
|
|
|
One,
|
|
|
|
Two,
|
|
|
|
Three
|
2016-12-10 02:35:20 +00:00
|
|
|
};
|
|
|
|
protected:
|
|
|
|
static const char* skBeamXferNames[5];
|
|
|
|
static const char* skAnimDependencyNames[5];
|
|
|
|
static const char* skDependencyNames[5];
|
|
|
|
static const char* skSuitArmNames[8];
|
2017-08-22 03:20:22 +00:00
|
|
|
zeus::CVector3f x4_scale;
|
2016-12-10 02:35:20 +00:00
|
|
|
TToken<CAnimCharacterSet> x104_gunCharacter;
|
|
|
|
TToken<CAnimCharacterSet> x13c_armCharacter;
|
2017-07-23 23:45:04 +00:00
|
|
|
rstl::reserved_vector<TCachedToken<CWeaponDescription>, 2> x144_weapons;
|
|
|
|
TToken<CGenDescription> x160_xferEffect;
|
|
|
|
rstl::reserved_vector<TCachedToken<CGenDescription>, 2> x16c_muzzleEffects;
|
|
|
|
rstl::reserved_vector<TCachedToken<CGenDescription>, 2> x188_secondaryEffects;
|
2017-08-25 06:18:09 +00:00
|
|
|
rstl::reserved_vector<std::unique_ptr<CElementGen>, 2> x1a4_muzzleGenerators;
|
|
|
|
u32 x1b8_ = 0;
|
|
|
|
CRainSplashGenerator* x1bc_rainSplashGenerator = nullptr;
|
2016-12-10 02:35:20 +00:00
|
|
|
EWeaponType x1c0_weaponType;
|
2017-08-22 03:20:22 +00:00
|
|
|
TUniqueId x1c4_playerId;
|
|
|
|
EMaterialTypes x1c8_playerMaterial;
|
2017-07-23 23:45:04 +00:00
|
|
|
CVelocityInfo x1d0_velInfo;
|
2016-12-10 02:35:20 +00:00
|
|
|
CPlayerState::EBeamId x200_beamId;
|
|
|
|
public:
|
2017-08-22 03:20:22 +00:00
|
|
|
CGunWeapon(CAssetId ancsId, EWeaponType type, TUniqueId playerId, EMaterialTypes, const zeus::CVector3f& scale);
|
2016-08-15 01:19:04 +00:00
|
|
|
void AsyncLoadSuitArm(CStateManager& mgr);
|
2016-12-10 02:35:20 +00:00
|
|
|
void AllocResPools(CPlayerState::EBeamId);
|
2016-08-14 21:11:44 +00:00
|
|
|
|
2016-12-10 02:35:20 +00:00
|
|
|
virtual void Reset(CStateManager&) {}
|
|
|
|
virtual void PlayAnim(NWeaponTypes::EGunAnimType, bool) {}
|
|
|
|
virtual void PreRenderGunFx(const CStateManager&, const zeus::CTransform&) {}
|
|
|
|
virtual void PostRenderGunFx(const CStateManager&, const zeus::CTransform&) {}
|
|
|
|
virtual void UpdateGunFx(bool, float, const CStateManager&, const zeus::CTransform&) {}
|
|
|
|
virtual void Fire(bool, float, CPlayerState::EChargeState, const zeus::CTransform&, CStateManager&, TUniqueId) {}
|
|
|
|
virtual void EnableFx(bool) {}
|
|
|
|
virtual void EnableSecondaryFx(ESecondaryFxType) {}
|
2017-08-25 06:18:09 +00:00
|
|
|
void ActivateCharge(bool b1, bool b2);
|
|
|
|
void Touch(const CStateManager& mgr);
|
|
|
|
void TouchHolo(const CStateManager& mgr);
|
2016-12-10 02:35:20 +00:00
|
|
|
virtual void Draw(bool, const CStateManager&, const zeus::CTransform&, const CModelFlags&,
|
|
|
|
const CActorLights*) const {}
|
|
|
|
virtual void DrawMuzzleFx(const CStateManager&) const {}
|
|
|
|
virtual void Update(float, CStateManager&) {}
|
2017-08-25 06:18:09 +00:00
|
|
|
virtual void Load(CStateManager& mgr, bool) {}
|
2016-12-10 02:35:20 +00:00
|
|
|
virtual void Unload(CStateManager&) {}
|
|
|
|
virtual bool IsLoaded() const {return false;}
|
2017-07-23 23:45:04 +00:00
|
|
|
const CVelocityInfo& GetVelocityInfo() const { return x1d0_velInfo; }
|
2017-08-25 06:18:09 +00:00
|
|
|
void SetRainSplashGenerator(CRainSplashGenerator* g) { x1bc_rainSplashGenerator = g; }
|
|
|
|
CElementGen* GetChargeMuzzleFx() const { return x1a4_muzzleGenerators[1].get(); }
|
2016-12-10 02:35:20 +00:00
|
|
|
};
|
2016-08-14 21:11:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __URDE_CGUNWEAPON_HPP__
|