2019-05-29 16:06:33 +00:00
|
|
|
#pragma once
|
2019-06-20 11:22:44 +00:00
|
|
|
#include "Entity.h"
|
2019-05-29 16:06:33 +00:00
|
|
|
|
|
|
|
enum eWeaponType
|
|
|
|
{
|
|
|
|
WEAPONTYPE_UNARMED = 0,
|
|
|
|
WEAPONTYPE_BASEBALLBAT,
|
|
|
|
WEAPONTYPE_COLT45,
|
|
|
|
WEAPONTYPE_UZI,
|
|
|
|
WEAPONTYPE_SHOTGUN,
|
|
|
|
WEAPONTYPE_AK47,
|
|
|
|
WEAPONTYPE_M16,
|
|
|
|
WEAPONTYPE_SNIPERRIFLE,
|
|
|
|
WEAPONTYPE_ROCKETLAUNCHER,
|
|
|
|
WEAPONTYPE_FLAMETHROWER,
|
|
|
|
WEAPONTYPE_MOLOTOV,
|
|
|
|
WEAPONTYPE_GRENADE,
|
|
|
|
WEAPONTYPE_DETONATOR,
|
2019-06-21 18:16:51 +00:00
|
|
|
NUM_PED_WEAPONTYPES = 13,
|
|
|
|
WEAPONTYPE_HELICANNON = 13,
|
2019-06-24 14:57:54 +00:00
|
|
|
NUM_WEAPONTYPES,
|
|
|
|
NO_STORED_WEAPON = 22
|
2019-05-29 16:06:33 +00:00
|
|
|
};
|
|
|
|
|
2019-06-20 11:22:44 +00:00
|
|
|
enum eWeaponFire {
|
|
|
|
WEAPON_FIRE_MELEE,
|
|
|
|
WEAPON_FIRE_INSTANT_HIT,
|
|
|
|
WEAPON_FIRE_PROJECTILE,
|
|
|
|
WEAPON_FIRE_AREA_EFFECT,
|
|
|
|
WEAPON_FIRE_USE
|
|
|
|
};
|
|
|
|
|
|
|
|
// Taken from MTA SA, seems it's unchanged
|
|
|
|
enum eWeaponState
|
|
|
|
{
|
|
|
|
WEAPONSTATE_READY,
|
|
|
|
WEAPONSTATE_FIRING,
|
|
|
|
WEAPONSTATE_RELOADING,
|
|
|
|
WEAPONSTATE_OUT_OF_AMMO,
|
|
|
|
WEAPONSTATE_MELEE_MADECONTACT
|
|
|
|
};
|
|
|
|
|
2019-05-29 16:06:33 +00:00
|
|
|
class CWeapon
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
eWeaponType m_eWeaponType;
|
2019-06-20 11:22:44 +00:00
|
|
|
eWeaponState m_eWeaponState;
|
2019-06-30 21:50:40 +00:00
|
|
|
uint32 m_nAmmoInClip;
|
|
|
|
uint32 m_nAmmoTotal;
|
2019-05-29 16:06:33 +00:00
|
|
|
int32 m_nTimer;
|
|
|
|
bool m_bAddRotOffset;
|
2019-06-20 11:22:44 +00:00
|
|
|
|
2019-06-30 21:50:40 +00:00
|
|
|
CWeapon() {
|
|
|
|
m_bAddRotOffset = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Initialise(eWeaponType type, int ammo);
|
|
|
|
void Reload(void);
|
2019-06-20 11:22:44 +00:00
|
|
|
bool Fire(CEntity*, CVector*);
|
2019-06-21 18:16:51 +00:00
|
|
|
void AddGunshell(CEntity*, CVector const&, CVector2D const&, float);
|
2019-05-29 16:06:33 +00:00
|
|
|
};
|
|
|
|
static_assert(sizeof(CWeapon) == 0x18, "CWeapon: error");
|