UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
g_health.h File Reference
#include "g_local.h"

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

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_s::bodyTemplate, Edict::chr, G_ActorGetInjuryPenalty(), gi, character_s::maxHP, MODIFIER_ACCURACY, MODIFIER_MOVEMENT, MODIFIER_REACTION, MODIFIER_SHOOTING, MODIFIER_SIGHT, MODIFIER_TU, BodyData::numBodyParts(), BodyData::penalty(), character_s::teamDef, woundInfo_s::treatmentLevel, woundInfo_s::woundLevel, character_s::wounds, and BodyData::woundThreshold().

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

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_s::bodyTemplate, Edict::chr, G_GetImpactDirection(), G_SendWoundStats(), G_TakeDamage(), BodyData::getArea(), BodyData::getHitBodyPart(), Edict::HP, AABB::maxs, AABB::mins, BodyData::numBodyParts(), character_s::teamDef, woundInfo_s::woundLevel, and character_s::wounds.

Referenced by G_Damage(), and Touch_HurtTrigger().

void G_SendWoundStats ( Edict *const  ent)
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_s::bodyTemplate, Edict::chr, CHRSH_IsTeamDefAlien(), game_import_s::csi, csi_s::damNormal, csi_s::damShock, csi_s::damStunElectro, fireDef_s::dmgweight, G_ActorCheckRevitalise(), G_SendWoundStats(), G_TakeDamage(), GET_MORALE, Edict::getStun(), Edict::getTeam(), gi, chrScoreMission_s::heal, Actor::isStunned(), Edict::morale, BodyData::numBodyParts(), character_s::score, character_s::scoreMission, Edict::setMorale(), Edict::setStun(), chrScoreGlobal_s::skills, character_s::teamDef, woundInfo_s::treatmentLevel, woundInfo_s::woundLevel, and character_s::wounds.

Referenced by G_Damage().