UFO: Alien Invasion
g_health.h File Reference
#include "g_local.h"
Include dependency graph for g_health.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void G_DamageActor (Edict *target, const int damage, const vec3_t impact)
 Deals damage and causes wounds. More...
 
void G_TreatActor (Actor *target, const fireDef_t *const fd, const int heal, const int healerTeam)
 Heals a target and treats wounds. More...
 
void G_BleedWounds (const int team)
 Deal damage to each wounded team member. More...
 
void G_SendWoundStats (Edict *const ent)
 Send wound stats to network buffer. More...
 
float G_ActorGetInjuryPenalty (const Edict *const ent, const modifier_types_t type)
 Returns the penalty to the given stat caused by the actor wounds. More...
 
bool G_IsActorWounded (const Edict *ent, bool serious=false)
 

Function Documentation

◆ G_ActorGetInjuryPenalty()

float G_ActorGetInjuryPenalty ( const Edict *const  ent,
const modifier_types_t  type 
)

Returns the penalty to the given stat caused by the actor wounds.

Parameters
[in]entPointer to the actor we want to calculate the penalty for.
[in]typeThe stat we want to calculate the penalty for.
Returns
The given penalty for this actor.

Definition at line 177 of file g_health.cpp.

References teamDef_t::bodyTemplate, Edict::chr, G_ActorGetInjuryPenalty(), gi, character_t::maxHP, MODIFIER_ACCURACY, MODIFIER_MOVEMENT, MODIFIER_REACTION, MODIFIER_SHOOTING, MODIFIER_SIGHT, MODIFIER_TU, BodyData::numBodyParts(), BodyData::penalty(), character_t::teamDef, woundInfo_t::treatmentLevel, type, woundInfo_t::woundLevel, character_t::wounds, and BodyData::woundThreshold().

Referenced by G_ActorCalculateMaxTU(), G_ActorGetInjuryPenalty(), G_ActorGetModifiedTimeForFiredef(), G_ActorMoveLength(), G_CalcEffectiveSpread(), G_ClientMove(), and G_VisCheckDist().

◆ G_BleedWounds()

◆ G_DamageActor()

void G_DamageActor ( Edict target,
const int  damage,
const vec3_t  impact 
)

Deals damage and causes wounds.

Parameters
[in,out]targetPointer to the actor we want to damage.
[in]damageThe value of the damage.
[in]impactImpact location nullptr for splash damage.

Definition at line 52 of file g_health.cpp.

References Edict::absBox, teamDef_t::bodyTemplate, Edict::chr, G_GetImpactDirection(), G_SendWoundStats(), G_TakeDamage(), BodyData::getArea(), BodyData::getHitBodyPart(), Edict::HP, AABB::maxs, AABB::mins, BodyData::numBodyParts(), character_t::teamDef, woundInfo_t::woundLevel, and character_t::wounds.

Referenced by G_Damage(), and Touch_HurtTrigger().

◆ G_IsActorWounded()

◆ G_SendWoundStats()

void G_SendWoundStats ( Edict *const  ent)

◆ G_TreatActor()

void G_TreatActor ( Actor target,
const fireDef_t *const  fd,
const int  heal,
const int  healerTeam 
)

Heals a target and treats wounds.

Parameters
[in,out]targetPointer to the actor who we want to treat.
[in]fdPointer to the firedef used to heal the target.
[in]healThe value of the damage to heal.
[in]healerTeamThe index of the team of the healer.
Todo:
According to specs it should only be possible to use the medikit to keep an alien sedated when 'live alien' is researched, is it possible to find if a tech is researched here?

Definition at line 81 of file g_health.cpp.

References ABILITY_MIND, BodyData::bleedingFactor(), teamDef_t::bodyTemplate, Edict::chr, CHRSH_IsTeamDefAlien(), game_import_t::csi, csi_t::damNormal, csi_t::damShock, csi_t::damStunElectro, fireDef_t::dmgweight, G_ActorCheckRevitalise(), G_SendWoundStats(), G_TakeDamage(), GET_MORALE, Edict::getStun(), Edict::getTeam(), gi, chrScoreMission_t::heal, Actor::isStunned(), Edict::morale, BodyData::numBodyParts(), character_t::score, character_t::scoreMission, Edict::setMorale(), Edict::setStun(), chrScoreGlobal_t::skills, character_t::teamDef, woundInfo_t::treatmentLevel, woundInfo_t::woundLevel, and character_t::wounds.

Referenced by G_Damage().