re3/src/weapons/Weapon.h

73 lines
2.5 KiB
C
Raw Normal View History

#pragma once
2020-04-19 16:34:08 +00:00
#include "WeaponType.h"
2020-04-15 05:03:53 +00:00
#define DRIVEBYAUTOAIMING_MAXDIST (2.5f)
#define DOOMAUTOAIMING_MAXDIST (9000.0f)
2019-07-23 14:39:30 +00:00
class CEntity;
2020-04-15 05:03:53 +00:00
class CPhysical;
2019-07-23 14:39:30 +00:00
class CAutomobile;
2020-04-15 05:03:53 +00:00
struct CColPoint;
class CWeaponInfo;
2019-07-23 14:39:30 +00:00
class CWeapon
{
public:
eWeaponType m_eWeaponType;
eWeaponState m_eWeaponState;
uint32 m_nAmmoInClip;
uint32 m_nAmmoTotal;
uint32 m_nTimer;
bool m_bAddRotOffset;
CWeapon() {
m_bAddRotOffset = false;
}
2020-04-15 05:03:53 +00:00
CWeaponInfo *GetInfo();
2020-04-15 05:03:53 +00:00
static void InitialiseWeapons(void);
static void ShutdownWeapons (void);
static void UpdateWeapons (void);
void Initialise(eWeaponType type, int32 ammo);
bool Fire (CEntity *shooter, CVector *fireSource);
bool FireFromCar (CAutomobile *shooter, bool left);
bool FireMelee (CEntity *shooter, CVector &fireSource);
bool FireInstantHit(CEntity *shooter, CVector *fireSource);
void AddGunshell (CEntity *shooter, CVector const &source, CVector2D const &direction, float size);
void DoBulletImpact(CEntity *shooter, CEntity *victim, CVector *source, CVector *target, CColPoint *point, CVector2D ahead);
bool FireShotgun (CEntity *shooter, CVector *fireSource);
bool FireProjectile(CEntity *shooter, CVector *fireSource, float power);
static void GenerateFlameThrowerParticles(CVector pos, CVector dir);
bool FireAreaEffect (CEntity *shooter, CVector *fireSource);
bool FireSniper (CEntity *shooter);
bool FireM16_1stPerson (CEntity *shooter);
bool FireInstantHitFromCar(CAutomobile *shooter, bool left);
static void DoDoomAiming (CEntity *shooter, CVector *source, CVector *target);
static void DoTankDoomAiming (CEntity *shooter, CEntity *driver, CVector *source, CVector *target);
static void DoDriveByAutoAiming(CEntity *shooter, CVector *source, CVector *target);
void Reload(void);
2020-04-15 05:03:53 +00:00
void Update(int32 audioEntity);
bool IsTypeMelee (void);
2019-07-15 12:11:40 +00:00
bool IsType2Handed(void);
2020-04-15 05:03:53 +00:00
static void MakePedsJumpAtShot(CPhysical *shooter, CVector *source, CVector *target);
bool HitsGround(CEntity *holder, CVector *fireSource, CEntity *aimingTo);
static void BlowUpExplosiveThings(CEntity *thing);
bool HasWeaponAmmoToBeUsed(void);
2020-04-15 05:03:53 +00:00
static bool ProcessLineOfSight(CVector const &point1, CVector const &point2, CColPoint &point, CEntity *&entity, eWeaponType type, CEntity *shooter, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects);
};
2020-04-15 05:03:53 +00:00
VALIDATE_SIZE(CWeapon, 0x18);
2020-03-31 22:58:40 +00:00
2020-04-15 05:03:53 +00:00
void FireOneInstantHitRound(CVector *source, CVector *target, int32 damage);