2019-06-20 11:22:44 +00:00
|
|
|
#pragma once
|
2020-03-28 14:47:52 +00:00
|
|
|
|
2020-05-24 15:27:12 +00:00
|
|
|
#include "AnimManager.h"
|
2020-04-19 16:34:08 +00:00
|
|
|
#include "AnimationId.h"
|
|
|
|
#include "WeaponType.h"
|
2019-06-20 11:22:44 +00:00
|
|
|
|
2020-12-26 12:22:02 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
WEAPONFLAG_USE_GRAVITY = 1,
|
|
|
|
WEAPONFLAG_SLOWS_DOWN = 1 << 1,
|
|
|
|
WEAPONFLAG_DISSIPATES = 1 << 2,
|
|
|
|
WEAPONFLAG_RAND_SPEED = 1 << 3,
|
|
|
|
WEAPONFLAG_EXPANDS = 1 << 4,
|
|
|
|
WEAPONFLAG_EXPLODES = 1 << 5,
|
|
|
|
WEAPONFLAG_CANAIM = 1 << 6,
|
|
|
|
WEAPONFLAG_CANAIM_WITHARM = 1 << 7,
|
|
|
|
WEAPONFLAG_1ST_PERSON = 1 << 8,
|
|
|
|
WEAPONFLAG_HEAVY = 1 << 9,
|
|
|
|
WEAPONFLAG_THROW = 1 << 10,
|
|
|
|
WEAPONFLAG_RELOAD_LOOP2START = 1 << 11,
|
|
|
|
WEAPONFLAG_USE_2ND = 1 << 12,
|
|
|
|
WEAPONFLAG_GROUND_2ND = 1 << 13,
|
|
|
|
WEAPONFLAG_FINISH_3RD = 1 << 14,
|
|
|
|
WEAPONFLAG_RELOAD = 1 << 15,
|
|
|
|
WEAPONFLAG_FIGHTMODE = 1 << 16,
|
|
|
|
WEAPONFLAG_CROUCHFIRE = 1 << 17,
|
|
|
|
WEAPONFLAG_COP3_RD = 1 << 18,
|
|
|
|
WEAPONFLAG_GROUND_3RD = 1 << 19,
|
|
|
|
WEAPONFLAG_PARTIALATTACK = 1 << 20,
|
|
|
|
WEAPONFLAG_ANIMDETONATE = 1 << 21,
|
|
|
|
};
|
2020-05-15 14:30:25 +00:00
|
|
|
|
2019-06-20 11:22:44 +00:00
|
|
|
class CWeaponInfo {
|
2020-05-15 14:30:25 +00:00
|
|
|
static CWeaponInfo ms_apWeaponInfos[WEAPONTYPE_TOTALWEAPONS];
|
2020-08-27 16:52:43 +00:00
|
|
|
static char ms_aWeaponNames[WEAPONTYPE_TOTALWEAPONS][32];
|
2019-06-20 11:22:44 +00:00
|
|
|
public:
|
2020-08-27 16:52:43 +00:00
|
|
|
static uint16 ms_aReloadSampleTime[WEAPONTYPE_TOTALWEAPONS];
|
2020-05-15 14:30:25 +00:00
|
|
|
static int32 ms_aMaxAmmoForWeapon[WEAPONTYPE_TOTALWEAPONS];
|
|
|
|
|
2019-06-20 11:22:44 +00:00
|
|
|
eWeaponFire m_eWeaponFire;
|
|
|
|
float m_fRange;
|
|
|
|
uint32 m_nFiringRate;
|
|
|
|
uint32 m_nReload;
|
2020-05-16 12:07:09 +00:00
|
|
|
int32 m_nAmountofAmmunition;
|
2019-06-20 11:22:44 +00:00
|
|
|
uint32 m_nDamage;
|
|
|
|
float m_fSpeed;
|
|
|
|
float m_fRadius;
|
|
|
|
float m_fLifespan;
|
|
|
|
float m_fSpread;
|
|
|
|
CVector m_vecFireOffset;
|
2020-05-15 14:30:25 +00:00
|
|
|
AssocGroupId m_AnimToPlay;
|
2019-06-20 11:22:44 +00:00
|
|
|
float m_fAnimLoopStart;
|
|
|
|
float m_fAnimLoopEnd;
|
|
|
|
float m_fAnimFrameFire;
|
2020-05-15 14:30:25 +00:00
|
|
|
float m_fAnim2LoopStart;
|
|
|
|
float m_fAnim2LoopEnd;
|
2019-06-20 11:22:44 +00:00
|
|
|
float m_fAnim2FrameFire;
|
2020-05-15 14:30:25 +00:00
|
|
|
float m_fAnimBreakout;
|
2019-06-20 11:22:44 +00:00
|
|
|
int32 m_nModelId;
|
2020-05-15 14:30:25 +00:00
|
|
|
int32 m_nModel2Id;
|
2020-12-26 12:22:02 +00:00
|
|
|
uint32 m_Flags;
|
2020-05-15 14:30:25 +00:00
|
|
|
|
|
|
|
uint32 m_nWeaponSlot;
|
2019-06-20 11:22:44 +00:00
|
|
|
|
2019-06-21 18:16:51 +00:00
|
|
|
static void Initialise(void);
|
|
|
|
static void LoadWeaponData(void);
|
2019-06-20 11:22:44 +00:00
|
|
|
static CWeaponInfo *GetWeaponInfo(eWeaponType weaponType);
|
2019-06-21 18:16:51 +00:00
|
|
|
static eWeaponFire FindWeaponFireType(char *name);
|
|
|
|
static eWeaponType FindWeaponType(char *name);
|
|
|
|
static void Shutdown(void);
|
2020-11-25 17:39:57 +00:00
|
|
|
static bool IsWeaponSlotAmmoMergeable(uint32 slot) { return slot == WEAPONSLOT_SHOTGUN || slot == WEAPONSLOT_SUBMACHINEGUN || slot == WEAPONSLOT_RIFLE; }
|
2020-12-26 12:22:02 +00:00
|
|
|
bool IsFlagSet(uint32 flag) const { return (m_Flags & flag) != 0; }
|
2019-06-20 11:22:44 +00:00
|
|
|
};
|
|
|
|
|
2020-05-15 14:30:25 +00:00
|
|
|
VALIDATE_SIZE(CWeaponInfo, 0x64);
|