UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
fireDef_s Struct Reference

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

#include <inv_shared.h>

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_sobj
 
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

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

Field Documentation

itemEffect_t* fireDef_s::activeEffect

Definition at line 131 of file inv_shared.h.

Referenced by Com_ParseFireEffect(), and RunImplant().

int fireDef_s::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().

int fireDef_s::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().

float fireDef_s::bounceFac

used in G_ShootGrenade() to apply VectorScale() effect

Definition at line 150 of file inv_shared.h.

Referenced by G_ShootGrenade().

const char* fireDef_s::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().

float fireDef_s::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().

vec2_t fireDef_s::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().

itemEffect_t* fireDef_s::deactiveEffect

Definition at line 132 of file inv_shared.h.

Referenced by Com_ParseFireEffect(), and RunImplant().

int fireDef_s::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().

float fireDef_s::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().

byte fireDef_s::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().

fireDefIndex_t fireDef_s::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().

float fireDef_s::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().

const char* fireDef_s::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().

bool fireDef_s::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(), CL_ActorTargetAlign_f(), CL_AddTargeting(), and G_ClientShoot().

const char* fireDef_s::hitBody

hit the body particles

Definition at line 115 of file inv_shared.h.

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

const char* fireDef_s::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().

const char* fireDef_s::impact

impact particle

Definition at line 113 of file inv_shared.h.

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

float fireDef_s::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().

const char* fireDef_s::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().

bool fireDef_s::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().

bool fireDef_s::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(), CL_TargetingGrenade(), and G_ShootGrenade().

itemEffect_t* fireDef_s::overdoseEffect

Definition at line 133 of file inv_shared.h.

Referenced by Com_ParseFireEffect(), and RunImplant().

const char* fireDef_s::projectile

projectile particle

Definition at line 112 of file inv_shared.h.

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

bool fireDef_s::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().

bool fireDef_s::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(), CL_TargetingGrenade(), and G_ShootGrenade().

int fireDef_s::rounds

e.g. for incendiary grenades

Definition at line 163 of file inv_shared.h.

Referenced by G_ClientShoot().

vec2_t fireDef_s::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().

int fireDef_s::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().

bool fireDef_s::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().

float fireDef_s::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().

vec2_t fireDef_s::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().

vec2_t fireDef_s::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().

int fireDef_s::throughWall

allow the shooting through a wall

Definition at line 142 of file inv_shared.h.

Referenced by G_ShootSingle().

weaponFireDefIndex_t fireDef_s::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().

int fireDef_s::weaponSkill

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