UFO: Alien Invasion
Loading...
Searching...
No Matches
fireDef_t Struct Reference

this is a fire definition for our weapons/ammo More...

#include <inv_shared.h>

Collaboration diagram for fireDef_t:
Collaboration graph

Public Member Functions

void getShotOrigin (const vec3_t from, const vec3_t dir, bool crouching, vec3_t shotOrigin) const

Data Fields

const char * name
const char * projectile
const char * impact
const char * impactSound
const char * hitBody
const char * hitBodySound
const char * fireSound
const char * bounceSound
float fireAttenuation
float impactAttenuation
const struct objDef_s * obj
weaponFireDefIndex_t weapFdsIdx
fireDefIndex_t fdIdx
itemEffect_tactiveEffect
itemEffect_tdeactiveEffect
itemEffect_toverdoseEffect
bool soundOnce
bool gravity
bool launched
bool rolled
bool reaction
bool irgoggles
byte dmgweight
int throughWall
float speed
vec2_t shotOrg
vec2_t spread
int delay
int bounce
float bounceFac
float crouch
float range
int shots
int ammo
float delayBetweenShots
int time
vec2_t damage
vec2_t spldmg
float splrad
int weaponSkill
int rounds

Detailed Description

this is a fire definition for our weapons/ammo

Definition at line 110 of file inv_shared.h.

Member Function Documentation

◆ getShotOrigin()

void fireDef_t::getShotOrigin ( const vec3_t from,
const vec3_t dir,
bool crouching,
vec3_t shotOrigin ) const

Definition at line 1039 of file inv_shared.cpp.

References AngleToDir(), dvecs, EYE_STAND, length, PLAYER_CROUCH, shotOrg, todeg, and VectorCopy.

Referenced by AI_CheckLineOfFire(), and G_ClientShoot().

Field Documentation

◆ activeEffect

itemEffect_t* fireDef_t::activeEffect

Definition at line 131 of file inv_shared.h.

Referenced by Com_ParseFireEffect(), and RunImplant().

◆ ammo

int fireDef_t::ammo

how many ammo this firemode will use

Definition at line 154 of file inv_shared.h.

Referenced by G_ClientShoot(), G_ShootGrenade(), G_ShootSingle(), HUD_DisplayFiremodeEntry(), and HUD_UpdateActorFireMode().

◆ bounce

int fireDef_t::bounce

amount of max possible bounces, for example grenades

Definition at line 149 of file inv_shared.h.

Referenced by AI_CheckLineOfFire(), CL_ActorShootHidden(), G_ShootGrenade(), G_ShootSingle(), LE_AddGrenade(), and LE_AddProjectile().

◆ bounceFac

float fireDef_t::bounceFac

used in G_ShootGrenade() to apply VectorScale() effect

Definition at line 150 of file inv_shared.h.

Referenced by G_ShootGrenade().

◆ bounceSound

const char* fireDef_t::bounceSound

bouncing sound

Definition at line 118 of file inv_shared.h.

Referenced by CL_ActorShootHidden(), LE_AddGrenade(), LE_AddProjectile(), S_PrecacheSamples(), and TEST_F().

◆ crouch

float fireDef_t::crouch

used for accuracy calculations - must be greater than 0.0

Definition at line 151 of file inv_shared.h.

Referenced by CL_GetHitProbability(), and G_CalcEffectiveSpread().

◆ damage

vec2_t fireDef_t::damage

G_Damage(), damage[0] is min value of damage, damage[1] is used for randomized calculations of additional damage; damage[0] < 0 means healing, not applying damage

Definition at line 158 of file inv_shared.h.

Referenced by AI_CheckLineOfFire(), AI_FindBestFiredef(), AI_HideNeeded(), G_ClientShoot(), G_ShootSingle(), G_ShotMorale(), INV_ItemDescription(), and LE_AddProjectile().

◆ deactiveEffect

itemEffect_t* fireDef_t::deactiveEffect

Definition at line 132 of file inv_shared.h.

Referenced by Com_ParseFireEffect(), and RunImplant().

◆ delay

int fireDef_t::delay

applied on grenades and grenade launcher. If no delay is set, a touch with an actor will lead to an explosion or a hit of the projectile. If a delay is set, the (e.g. grenade) may bounce away again.

Definition at line 147 of file inv_shared.h.

Referenced by G_ShootGrenade(), and G_ShootSingle().

◆ delayBetweenShots

float fireDef_t::delayBetweenShots

delay between shots (sounds and particles) for this firemode; the higher the value, the less the delay (1000/delay)

Definition at line 155 of file inv_shared.h.

Referenced by CL_ActorDoShootTime(), CL_ActorShootHiddenTime(), and Com_ParseFire().

◆ dmgweight

byte fireDef_t::dmgweight

used in G_Damage() to apply damagetype effects - redundant with obj->dmgtype

Definition at line 141 of file inv_shared.h.

Referenced by G_ClientShoot(), G_Damage(), G_SplashDamage(), and G_TreatActor().

◆ fdIdx

fireDefIndex_t fireDef_t::fdIdx

Self link of the fd in the objDef_t->fd[][fdIdx] array.

Definition at line 130 of file inv_shared.h.

Referenced by actorL_throwgrenade(), AI_ActorThink(), AI_CalcShotDamage(), Com_ParseFireDefinition(), G_EventShoot(), G_EventShootHidden(), G_EventThrow(), and HUD_DisplayFiremodeEntry().

◆ fireAttenuation

float fireDef_t::fireAttenuation

attenuation of firing (less louder over distance), see S_PlaySample()

Definition at line 120 of file inv_shared.h.

Referenced by CL_ActorDoShoot(), CL_ActorShootHidden(), Com_ParseFire(), and Com_ParseFireDefinition().

◆ fireSound

const char* fireDef_t::fireSound

the sound when a recruits fires

Definition at line 117 of file inv_shared.h.

Referenced by CL_ActorDoShoot(), CL_ActorDoThrow(), CL_ActorShootHidden(), S_PrecacheSamples(), and TEST_F().

◆ gravity

bool fireDef_t::gravity

Does gravity have any influence on this item?

Definition at line 136 of file inv_shared.h.

Referenced by AI_CalcShotDamage(), AI_CheckLineOfFire(), AI_FindBestFiredef(), AIL_GetBestShot(), and G_ClientShoot().

◆ hitBody

const char* fireDef_t::hitBody

hit the body particles

Definition at line 115 of file inv_shared.h.

Referenced by LE_AddGrenade(), LE_AddProjectile(), and TEST_F().

◆ hitBodySound

const char* fireDef_t::hitBodySound

the sound that is played on hitting a body

Definition at line 116 of file inv_shared.h.

Referenced by CL_ActorShootHidden(), LE_AddGrenade(), LE_AddProjectile(), S_PrecacheSamples(), and TEST_F().

◆ impact

const char* fireDef_t::impact

impact particle

Definition at line 113 of file inv_shared.h.

Referenced by LE_AddGrenade(), LE_AddProjectile(), and TEST_F().

◆ impactAttenuation

float fireDef_t::impactAttenuation

attenuation of impact (less louder over distance), see S_PlaySample()

Definition at line 121 of file inv_shared.h.

Referenced by CL_ActorShootHidden(), Com_ParseFire(), Com_ParseFireDefinition(), LE_AddProjectile(), and LET_Projectile().

◆ impactSound

const char* fireDef_t::impactSound

the sound that is played on impact

Definition at line 114 of file inv_shared.h.

Referenced by CL_ActorShootHidden(), LE_AddGrenade(), LE_AddProjectile(), S_PrecacheSamples(), and TEST_F().

◆ irgoggles

bool fireDef_t::irgoggles

Is this an irgoggle?

Definition at line 140 of file inv_shared.h.

Referenced by CL_ActorDoShoot(), G_ClientShoot(), G_ShotMorale(), and G_SplashDamage().

◆ launched

bool fireDef_t::launched

used for calculating parabolas in Com_GrenadeTarget()

Definition at line 137 of file inv_shared.h.

Referenced by AI_CheckLineOfFire(), AI_FindBestFiredef(), AIL_GetBestShot(), and G_ShootGrenade().

◆ name

◆ obj

◆ overdoseEffect

itemEffect_t* fireDef_t::overdoseEffect

Definition at line 133 of file inv_shared.h.

Referenced by Com_ParseFireEffect(), and RunImplant().

◆ projectile

const char* fireDef_t::projectile

projectile particle

Definition at line 112 of file inv_shared.h.

Referenced by LE_AddGrenade(), LE_AddProjectile(), and TEST_F().

◆ range

◆ reaction

bool fireDef_t::reaction

This firemode can be used/selected for reaction fire.

Definition at line 139 of file inv_shared.h.

Referenced by Item::getReactionFireWeaponType(), and HUD_DisplayFiremodeEntry().

◆ rolled

bool fireDef_t::rolled

Can it be rolled - e.g. grenades - used in "Roll" firemodes, see Com_GrenadeTarget()

Definition at line 138 of file inv_shared.h.

Referenced by AI_CheckLineOfFire(), AI_FindBestFiredef(), AIL_GetBestShot(), and G_ShootGrenade().

◆ rounds

int fireDef_t::rounds

e.g. for incendiary grenades

Definition at line 163 of file inv_shared.h.

Referenced by G_ClientShoot().

◆ shotOrg

vec2_t fireDef_t::shotOrg

This can shift a muzzle vertically (first value) and horizontally (second value) for the trace that is done on the server side.

Definition at line 145 of file inv_shared.h.

Referenced by getShotOrigin().

◆ shots

int fireDef_t::shots

how many shots this firemode will produce

Definition at line 153 of file inv_shared.h.

Referenced by AI_CalcShotDamage(), AI_CheckLineOfFire(), Com_ParseFire(), G_ClientShoot(), INV_ItemDescription(), and ReactionFire::shoot().

◆ soundOnce

bool fireDef_t::soundOnce

when set, firing sound is played only once, see CL_ActorDoThrow() and CL_ActorShootHidden()

Definition at line 135 of file inv_shared.h.

Referenced by CL_ActorDoShoot(), and CL_ActorShootHidden().

◆ speed

float fireDef_t::speed

projectile-related; zero value means unlimited speed (most of the cases). for that unlimited speed we use special particle (which cannot work with speed non-zero valued.

Definition at line 143 of file inv_shared.h.

Referenced by CL_ActorDoShootTime(), and LE_AddProjectile().

◆ spldmg

vec2_t fireDef_t::spldmg

G_SplashDamage(), currently we use only first value (spldmg[0]) for apply splashdamage effect

Definition at line 160 of file inv_shared.h.

Referenced by AI_FindBestFiredef(), AI_HideNeeded(), G_SplashDamage(), and INV_ItemDescription().

◆ splrad

◆ spread

vec2_t fireDef_t::spread

used for accuracy calculations (G_ShootGrenade(), G_ShootSingle())

Definition at line 146 of file inv_shared.h.

Referenced by CL_GetHitProbability(), G_CalcEffectiveSpread(), and INV_ItemDescription().

◆ throughWall

int fireDef_t::throughWall

allow the shooting through a wall

Definition at line 142 of file inv_shared.h.

Referenced by G_ShootSingle().

◆ time

◆ weapFdsIdx

weaponFireDefIndex_t fireDef_t::weapFdsIdx

The index of the "weapon_mod" entry (objDef_t->fd[weapFdsIdx]) this fd is located in. Depending on this value you can find out via objDef_t->weapIdx[weapFdsIdx] what weapon this firemode is used for. This does NOT equal the index of the weapon object in ods.

Definition at line 126 of file inv_shared.h.

Referenced by actorL_throwgrenade(), AI_FindBestFiredef(), AI_HasLineOfFire(), AIL_GetBestShot(), CL_GetSkillIndicator(), Com_ParseFireDefinition(), G_ActorHasWorkingFireModeSet(), G_EventShoot(), G_EventShootHidden(), G_EventThrow(), Item::getNumFiredefs(), HUD_CheckFiremodeReservation(), HUD_DisplayActions(), HUD_FireWeapon_f(), HUD_PopupFiremodeReservation(), HUD_UpdateActorFireMode(), and HUD_UpdateReactionFiremodes().

◆ weaponSkill

int fireDef_t::weaponSkill

The documentation for this struct was generated from the following files: