UFO: Alien Invasion
|
All parts of the main game logic that are combat related. More...
#include "g_combat.h"
#include "g_actor.h"
#include "g_client.h"
#include "g_edicts.h"
#include "g_health.h"
#include "g_inventory.h"
#include "g_match.h"
#include "g_reaction.h"
#include "g_spawn.h"
#include "g_utils.h"
#include "g_vis.h"
Go to the source code of this file.
Macros | |
#define | MAX_WALL_THICKNESS_FOR_SHOOTING_THROUGH 8 |
#define | GRENADE_DT 0.1f |
#define | GRENADE_STOPSPEED 60.0f |
Enumerations | |
enum | morale_modifiers { ML_SHOOT, ML_WOUND, ML_DEATH } |
Functions | |
static bool | G_TeamPointVis (int team, const vec3_t point) |
Test if point is "visible" from team. More... | |
static void | G_Morale (morale_modifiers type, const Edict *victim, const Edict *attacker, int param) |
Applies morale changes to actors around a wounded or killed actor. More... | |
static void | G_ShotMorale (const Actor *shooter, const fireDef_t *fd, const vec3_t from, const Item *weapon, const vec3_t impact) |
Applies morale changes to actors who find themselves in the general direction of a shot. More... | |
static void | G_UpdateShotMock (shot_mock_t *mock, const Edict *shooter, const Edict *struck, int damage) |
Function to calculate possible damages for mock pseudoaction. More... | |
static void | G_UpdateCharacterBodycount (Edict *attacker, const fireDef_t *fd, const Actor *target) |
Update character stats for this mission after successful shoot. More... | |
static void | G_UpdateHitScore (Edict *attacker, const Edict *target, const fireDef_t *fd, const int splashDamage) |
Increases the 'hit' score by one for all affected teams/skills by one (except splash damage, read below). More... | |
int | G_ApplyProtection (const Edict *target, const byte dmgWeight, int damage) |
Reduces damage by armour and natural protection. More... | |
static bool | G_Damage (Edict *target, const fireDef_t *fd, int damage, Actor *attacker, shot_mock_t *mock, const vec3_t impact) |
Deals damage of a give type and amount to a target. More... | |
void | G_CheckDeathOrKnockout (Actor *target, Actor *attacker, const fireDef_t *fd, int damage) |
static bool | G_FireAffectedSurface (const cBspSurface_t *surface, const fireDef_t *fd) |
Checks surface vulnerability for firedefinition damagetype. More... | |
static void | G_SplashDamage (Actor *ent, const fireDef_t *fd, vec3_t impact, shot_mock_t *mock, const trace_t *tr) |
Deals splash damage to a target and its surroundings. More... | |
static void | G_SpawnItemOnFloor (const pos3_t pos, const Item *item) |
Spawn an item on the floor. A new ET_ITEM edict is created if needed. More... | |
void | G_CalcEffectiveSpread (const Actor *shooter, const fireDef_t *fd, vec2_t effSpread) |
Calculate the effective spread for the given actor and firemode. More... | |
static void | G_ShootGrenade (const Player &player, Actor *shooter, const fireDef_t *fd, const vec3_t from, const pos3_t at, int mask, const Item *weapon, shot_mock_t *mock, int z_align, vec3_t impact) |
A parabola-type shoot (grenade, throw). More... | |
static void | G_ShootSingle (Actor *ent, const fireDef_t *fd, const vec3_t from, const pos3_t at, int mask, const Item *weapon, shot_mock_t *mock, int z_align, int i, shoot_types_t shootType, vec3_t impact) |
Fires straight shots. More... | |
static bool | G_PrepareShot (Edict *ent, shoot_types_t shootType, fireDefIndex_t firemode, Item **weapon, containerIndex_t *container, const fireDef_t **fd) |
Prepares weapon, firemode and container used for shoot. More... | |
bool | G_ClientShoot (const Player &player, Actor *actor, const pos3_t at, shoot_types_t shootType, fireDefIndex_t firemode, shot_mock_t *mock, bool allowReaction, int z_align) |
Setup for shooting, either real or mock. More... | |
All parts of the main game logic that are combat related.
Definition in file g_combat.cpp.
#define GRENADE_DT 0.1f |
Definition at line 690 of file g_combat.cpp.
Referenced by G_ShootGrenade().
#define GRENADE_STOPSPEED 60.0f |
Definition at line 691 of file g_combat.cpp.
Referenced by G_ShootGrenade().
#define MAX_WALL_THICKNESS_FOR_SHOOTING_THROUGH 8 |
Definition at line 38 of file g_combat.cpp.
Referenced by G_ShootSingle().
enum morale_modifiers |
Enumerator | |
---|---|
ML_SHOOT | |
ML_WOUND | |
ML_DEATH |
Definition at line 40 of file g_combat.cpp.
Reduces damage by armour and natural protection.
[in] | target | What we want to damage. |
[in] | dmgWeight | The type of damage is dealt. |
[in] | damage | The value of the damage. |
Definition at line 362 of file g_combat.cpp.
References Edict::chr, Item::def(), Edict::getArmour(), objDef_s::protection, teamDef_s::resistance, and character_s::teamDef.
Referenced by AI_CheckPosition(), G_Damage(), G_SplashDamage(), and Touch_HurtTrigger().
Calculate the effective spread for the given actor and firemode.
[in] | shooter | The shooting actor |
[in] | fd | The firedefinition the actor is shooting with |
[out] | effSpread | The adjusted spread |
Definition at line 671 of file g_combat.cpp.
References ABILITY_ACCURACY, Edict::chr, fireDef_s::crouch, f, G_ActorGetInjuryPenalty(), GET_ACC, Actor::isCrouched(), MODIFIER_ACCURACY, PITCH, character_s::score, SKILL_BALANCE, chrScoreGlobal_s::skills, fireDef_s::spread, WEAPON_BALANCE, fireDef_s::weaponSkill, and YAW.
Referenced by AI_FighterCheckShoot(), G_ShootGrenade(), and G_ShootSingle().
Definition at line 499 of file g_combat.cpp.
References Edict::chr, G_ActorDieOrStun(), G_Morale(), G_PrintActorStats(), G_SendStats(), G_UpdateCharacterBodycount(), Edict::getStun(), Edict::HP, cvar_s::integer, character_s::maxHP, character_s::minHP, ML_DEATH, ML_WOUND, and mor_panic.
Referenced by G_BleedWounds(), G_ClientMove(), G_Damage(), and Touch_HurtTrigger().
bool G_ClientShoot | ( | const Player & | player, |
Actor * | actor, | ||
const pos3_t | at, | ||
shoot_types_t | shootType, | ||
fireDefIndex_t | firemode, | ||
shot_mock_t * | mock, | ||
bool | allowReaction, | ||
int | z_align | ||
) |
Setup for shooting, either real or mock.
[in] | player | The player this action belongs to (i.e. either the ai or the player) |
[in] | actor | the edict that is doing the shot |
[in] | at | Position to fire on. |
[in] | shootType | What type of shot this is (left, right reaction-left etc...). |
[in] | firemode | The firemode index of the ammo for the used weapon. |
[in] | mock | pseudo shooting - only for calculating mock values - nullptr for real shots |
[in] | allowReaction | Set to true to check whether this has forced any reaction fire, otherwise false. |
[in] | z_align | This value may change the target z height - often GROUND_DELTA is used to calculate the alignment. This can be used for splash damage weapons. It's often useful to target the ground close to the victim. That way you don't need a 100 percent chance to hit your target. Even if you don't hit it, the splash damage might reduce the health of your target. |
Reset status.
Reset status.
If loaded ammo is less than needed ammo from firedef then reduce shot-number relative to the difference.
Definition at line 1183 of file g_combat.cpp.
References _, fireDef_s::ammo, Item::ammoDef(), AngleToDir(), Edict::chr, CORE_DIRECTIONS, crand(), game_import_s::csi, fireDef_s::damage, csi_s::damIncendiary, csi_s::damNormal, csi_s::damSmoke, csi_s::damStunGas, Item::def(), objDef_s::deplete, Edict::dir, objDef_s::dmgtype, fireDef_s::dmgweight, InventoryInterface::emptyContainer(), ET_ACTOR, ET_FIRE, ET_SMOKE, ET_SMOKESTUN, f, Edict::fieldSize, chrScoreMission_s::fired, chrScoreMission_s::firedHit, chrScoreMission_s::firedSplash, chrScoreMission_s::firedSplashHit, chrScoreMission_s::firedSplashTUs, chrScoreMission_s::firedTUs, FIRESH_IsMedikit, objDef_s::fireTwoHanded, G_ActionCheckForCurrentTeam(), G_ActionCheckForReaction(), G_ActorGetModifiedTimeForFiredef(), G_ActorSetTU(), G_CheckVisTeamAll(), G_ClientPrintf(), G_EdictsGetLivingActorFromPos(), G_EventActorTurn(), G_EventEnd(), G_EventEndShoot(), G_EventInventoryAmmo(), G_EventInventoryDelete(), G_EventShootHidden(), G_EventStartShoot(), G_FindRadius(), G_IsActorWounded(), G_IsAIPlayer, G_IsVisibleForTeam, G_MatchEndCheck(), G_PrepareShot(), G_ReactionFirePostShot(), G_ReactionFirePreShot(), G_ReactionFireSettingsUpdate(), G_SendStats(), G_ShootGrenade(), G_ShootSingle(), G_ShotMorale(), G_SpawnFireField(), G_SpawnSmokeField(), G_SpawnStunSmokeField(), G_TeamPointVis(), G_TeamToVisMask, G_TouchTriggers(), G_VisToPM(), game, Item::getAmmoLeft(), FiremodeSettings::getFmIdx(), FiremodeSettings::getHand(), Edict::getLeftHandItem(), fireDef_s::getShotOrigin(), Edict::getTeam(), Edict::getTus(), FiremodeSettings::getWeapon(), gi, fireDef_s::gravity, i, objDef_s::id, invDef_s::id, cvar_s::integer, Edict::inuse, character_s::inv, INVDEF, game_locals_s::invi, fireDef_s::irgoggles, Actor::isCrouched(), Actor::isDead(), Edict::isSamePosAs(), Actor::isStunned(), KILLED_NUM_TYPES, MAX_TEAMS, mor_panic, fireDef_s::obj, objDef_s::oneshot, Edict::origin, Edict::pos, PRINT_HUD, fireDef_s::range, character_s::RFmode, fireDef_s::rounds, character_s::scoreMission, Item::setAmmoLeft(), fireDef_s::shots, invDef_s::single, fireDef_s::splrad, objDef_s::thrown, todeg, type, VectorDist, VectorMA(), VectorSubtract, Edict::visflags, and fireDef_s::weaponSkill.
Referenced by actorL_shoot(), actorL_throwgrenade(), AI_ActorThink(), AI_CalcShotDamage(), G_ClientAction(), and ReactionFire::shoot().
|
static |
Deals damage of a give type and amount to a target.
[in,out] | target | What we want to damage. |
[in] | fd | The fire definition that defines what type of damage is dealt. |
[in] | damage | The value of the damage. |
[in] | attacker | The attacker. |
[in] | mock | pseudo shooting - only for calculating mock values - nullptr for real shots |
[in] | impact | impact location - nullptr for splash damage |
true
if damage could be dealt (even if it was 0) false
otherwise < Check for >0 and splrad to not count this as direct hit.
Definition at line 389 of file g_combat.cpp.
References Edict::addStun(), Edict::chr, CHRSH_IsTeamDefRobot(), Com_DPrintf(), chrReservations_s::crouch, game_import_s::csi, csi_s::damShock, csi_s::damSmoke, csi_s::damStunElectro, csi_s::damStunGas, DEBUG_GAME, Edict::destroy, objDef_s::dmgtype, fireDef_s::dmgweight, f, G_ActorReserveTUs(), G_ActorSetTU(), G_ApplyProtection(), G_CheckDeathOrKnockout(), G_CheckVis(), G_CheckVisTeamAll(), G_DamageActor(), g_difficulty, G_EventSendState(), G_IsAlien, G_IsBreakable, G_IsBrushModel, G_IsLivingActor(), G_IsSinglePlayer, g_nodamage, G_SendStats(), G_TakeDamage(), G_TreatActor(), G_UpdateHitScore(), G_UpdateShotMock(), G_VisToPM(), Edict::getTeam(), gi, Edict::HP, cvar_s::integer, Edict::isSameTeamAs(), makeActor(), MAX_TEAMS, fireDef_s::obj, Actor::removeReaction(), character_s::reservedTus, Actor::setDazed(), chrReservations_s::shot, fireDef_s::splrad, character_s::teamDef, cvar_s::value, and Edict::visflags.
Referenced by G_ShootSingle(), and G_SplashDamage().
|
inlinestatic |
Checks surface vulnerability for firedefinition damagetype.
[in] | surface | The collision surface to check the surface flag for |
[in] | fd | The firedef to check the dmgtype for |
Definition at line 536 of file g_combat.cpp.
References game_import_s::csi, csi_s::damBlast, csi_s::damFire, csi_s::damIncendiary, objDef_s::dmgtype, gi, fireDef_s::obj, SURF_BURN, and cBspSurface_s::surfaceFlags.
Referenced by G_ShootSingle(), and G_SplashDamage().
|
static |
Applies morale changes to actors around a wounded or killed actor.
[in] | type | Type of morale modifier ( |
[in] | victim | An actor being a victim of the attack. |
[in] | attacker | An actor being attacker in this attack. |
[in] | param | Used to modify morale changes, for G_Damage() it is value of damage. |
Definition at line 98 of file g_combat.cpp.
References ABILITY_MIND, Edict::chr, ET_ACTOR, f, G_ActorVis(), G_EdictsGetNextLivingActor(), G_FrustumVis(), G_IsAlien, G_IsCivilian, G_IsSinglePlayer, G_SendStats(), GET_MORALE, Edict::getTeam(), int(), Edict::isSameTeamAs(), level, ML_DEATH, ML_SHOOT, mob_death, mob_shoot, mob_wound, mof_civilian, mof_enemy, mof_teamkill, mof_watching, mon_teamfactor, mor_attacker, mor_default, mor_distance, mor_pain, mor_victim, Edict::morale, MORALE_RANDOM, level_locals_s::num_alive, level_locals_s::num_spawned, Edict::origin, character_s::score, Edict::setMorale(), chrScoreGlobal_s::skills, Edict::type, cvar_s::value, and VectorDist.
Referenced by G_CheckDeathOrKnockout(), and G_ShotMorale().
|
static |
Prepares weapon, firemode and container used for shoot.
[in] | ent | Pointer to attacker. |
[in] | shootType | Type of shot. |
[in] | firemode | An index of used firemode. |
[in,out] | weapon | Weapon being used. It is nullptr when calling this function. |
[in,out] | container | Container with weapon being used. It is 0 when calling this function. |
[in,out] | fd | Firemode being used. It is nullptr when calling this function. |
Definition at line 1132 of file g_combat.cpp.
References Edict::chr, CID_HEADGEAR, CID_LEFT, CID_RIGHT, Item::getFiredefs(), Inventory::getHeadgear(), Edict::getLeftHandItem(), Edict::getRightHandItem(), gi, character_s::inv, IS_SHOT_HEADGEAR, IS_SHOT_RIGHT, and ST_NUM_SHOOT_TYPES.
Referenced by G_ClientShoot().
|
static |
A parabola-type shoot (grenade, throw).
[in] | player | The shooting player |
[in] | shooter | The shooting actor |
[in] | fd | The firedefinition the actor is shooting with |
[in] | from | The position the actor is shooting from |
[in] | at | The grid position the actor is shooting to (or trying to shoot to) |
[in] | mask | The team visibility mask (who's seeing the event) |
[in] | weapon | The weapon to shoot with |
[in] | mock | pseudo shooting - only for calculating mock values - nullptr for real shots |
[in] | z_align | This value may change the target z height |
[out] | impact | The location of the target (-center?) |
Definition at line 707 of file g_combat.cpp.
References _, level_locals_s::activeTeam, fireDef_s::ammo, AngleVectors(), fireDef_s::bounce, fireDef_s::bounceFac, Item::def(), fireDef_s::delay, DotProduct, trace_s::endpos, trace_s::entNum, Edict::fieldSize, trace_s::fraction, G_CalcEffectiveSpread(), G_ClientPrintf(), G_EdictsGetByNum(), G_EventShootHidden(), G_EventThrow(), G_IsActor, G_IsCivilian, G_IsCrouched, G_SpawnItemOnFloor(), G_SplashDamage(), G_TeamPointVis(), G_Trace(), gaussrand(), gi, GRAVITY, GRENADE_DT, GRENADE_STOPSPEED, GROUND_DELTA, i, Actor::isDead(), Edict::isSameTeamAs(), fireDef_s::launched, level, MASK_SHOT, MAX_TEAMS, cBspSurface_s::name, oldPos, PITCH, trace_s::plane, PRINT_HUD, fireDef_s::range, fireDef_s::rolled, SF_BODY, SF_BOUNCED, SF_BOUNCING, SF_IMPACT, fireDef_s::splrad, trace_s::surface, objDef_s::thrown, tr, VecToAngles(), VecToPos, VectorAdd, VectorCopy, VectorLength(), VectorMA(), VectorScale, and YAW.
Referenced by G_ClientShoot().
|
static |
Fires straight shots.
[in] | ent | The attacker. |
[in] | fd | The fire definition that is used for the shot. |
[in] | from | Location of the gun muzzle. |
[in] | at | Grid coordinate of the target. |
[in] | mask | Visibility bit-mask (who's seeing the event) |
[in] | weapon | The weapon the actor is shooting with |
[in] | mock | pseudo shooting - only for calculating mock values - nullptr for real shots |
[in] | z_align | This value may change the target z height |
[in] | i | The ith shot |
[in] | shootType | The firemode (ST_NUM_SHOOT_TYPES) |
[out] | impact | The location of the target (-center?) |
Definition at line 930 of file g_combat.cpp.
References fireDef_s::ammo, AngleVectors(), fireDef_s::bounce, Com_DPrintf(), trace_s::contentFlags, CONTENTS_SOLID, crand(), fireDef_s::damage, DEBUG_GAME, Item::def(), fireDef_s::delay, objDef_s::deplete, DotProduct, trace_s::endpos, trace_s::entNum, f, Edict::fieldSize, FIRESH_IsMedikit, trace_s::fraction, G_CalcEffectiveSpread(), G_Damage(), G_EdictsGetByNum(), G_EventShoot(), G_EventShootHidden(), G_FireAffectedSurface(), G_IsActor, G_IsBreakable, G_IsCivilian, G_IsCrouched, G_SpawnItemOnFloor(), G_SpawnParticle(), G_SplashDamage(), G_TeamToVisMask, G_Trace(), G_UpdateHitScore(), gaussrand(), Edict::getTeam(), gi, Actor::isDead(), Edict::isSamePosAs(), Edict::isSameTeamAs(), MASK_SHOT, MAX_WALL_THICKNESS_FOR_SHOOTING_THROUGH, PITCH, trace_s::plane, fireDef_s::range, SF_BODY, SF_BOUNCED, SF_BOUNCING, SF_IMPACT, fireDef_s::splrad, trace_s::startsolid, trace_s::surface, sv_shot_origin, fireDef_s::throughWall, objDef_s::thrown, UNIT_SIZE, cvar_s::value, VecToAngles(), VecToPos, VectorAdd, VectorCompare, VectorCopy, VectorMA(), VectorNormalizeFast(), VectorScale, VectorSubtract, and YAW.
Referenced by G_ClientShoot().
|
static |
Applies morale changes to actors who find themselves in the general direction of a shot.
shooter | The shooting actor. |
fd | The firedef used to shoot. |
from | The weapon's muzzle location. |
weapon | The weapon used to shoot. |
impact | The shoot's impact location. |
Definition at line 171 of file g_combat.cpp.
References game_import_s::csi, fireDef_s::damage, csi_s::damLaser, Item::def(), objDef_s::dmgtype, DotProduct, f, G_EdictsGetNextLivingActor(), G_Morale(), gi, fireDef_s::irgoggles, Edict::isSamePosAs(), Edict::isSameTeamAs(), ML_SHOOT, Edict::origin, UNIT_SIZE, VecToPos, VectorDistSqr, VectorLength(), VectorLengthSqr, VectorScale, and VectorSubtract.
Referenced by G_ClientShoot().
Spawn an item on the floor. A new ET_ITEM edict is created if needed.
[in] | pos | The grid position to spawn the item at |
[in] | item | The item to spawn |
Definition at line 638 of file g_combat.cpp.
References Edict::chr, CID_FLOOR, G_CheckVis(), G_EdictsGetLivingActorFromPos(), G_EventPerish(), G_FreeEdict(), G_GetFloorItemFromPos(), G_GetFloorItems(), G_SpawnFloor(), G_VisFlagsReset(), game, character_s::inv, INVDEF, game_locals_s::invi, and InventoryInterface::tryAddToInventory().
Referenced by G_ShootGrenade(), and G_ShootSingle().
|
static |
Deals splash damage to a target and its surroundings.
[in] | ent | The shooting actor |
[in] | fd | The fire definition that defines what type of damage is dealt and how big the splash radius is. |
[in] | impact | The impact vector where the grenade is exploding |
[in,out] | mock | pseudo shooting - only for calculating mock values - nullptr for real shots |
[in] | tr | The trace where the grenade hits something (or not) |
Definition at line 558 of file g_combat.cpp.
References Edict::absBox, shot_mock_s::allow_self, Edict::chr, trace_s::contentFlags, game_import_s::csi, csi_s::damShock, objDef_s::dmgtype, fireDef_s::dmgweight, G_ActorGetEyeVector(), G_AppearPerishEvent(), G_ApplyProtection(), G_Damage(), G_EdictsGetNextInUse(), G_EventSpawnSound(), G_FireAffectedSurface(), G_FrustumVis(), G_IsBreakable, G_IsBrushModel, G_IsLivingActor(), G_PMToVis(), G_SmokeVis(), G_SpawnParticle(), G_TeamToPM(), G_TestLine(), G_VisFlagsAdd(), G_VisToPM(), character_s::gender, teamDef_s::getActorSound(), AABB::getCenter(), Edict::getTeam(), gi, fireDef_s::irgoggles, fireDef_s::obj, Edict::origin, trace_s::plane, SND_HURT, fireDef_s::spldmg, fireDef_s::splrad, trace_s::surface, character_s::teamDef, UNIT_SIZE, VectorCopy, VectorDist, VectorMA(), and Edict::visflags.
Referenced by G_ShootGrenade(), and G_ShootSingle().
Test if point is "visible" from team.
[in] | team | A team to test. |
[in] | point | A point to check. |
Definition at line 52 of file g_combat.cpp.
References Edict::absBox, G_ActorGetEyeVector(), G_EdictsGetNextInUse(), G_EdictsGetNextLivingActorOfTeam(), G_FrustumVis(), G_IsSmoke, G_TestLine(), Edict::origin, RayIntersectAABB(), UNIT_SIZE, and VectorDist.
Referenced by G_ClientShoot(), and G_ShootGrenade().
|
static |
Update character stats for this mission after successful shoot.
[in,out] | attacker | Pointer to attacker. |
[in] | fd | Pointer to fireDef_t used in shoot. |
[in] | target | Pointer to target. |
Definition at line 257 of file g_combat.cpp.
References Edict::chr, Edict::getTeam(), Actor::isDead(), Actor::isStunned(), KILLED_CIVILIANS, KILLED_ENEMIES, KILLED_TEAM, chrScoreMission_s::kills, chrScoreGlobal_s::kills, lengthof, character_s::score, scoreMission, character_s::scoreMission, chrScoreMission_s::skillKills, chrScoreMission_s::stuns, chrScoreGlobal_s::stuns, TEAM_ALIEN, TEAM_CIVILIAN, TEAM_PHALANX, type, and fireDef_s::weaponSkill.
Referenced by G_CheckDeathOrKnockout().
|
static |
Increases the 'hit' score by one for all affected teams/skills by one (except splash damage, read below).
[in,out] | attacker | The soldier to update (he/she dealt the damage) |
[in] | target | The hit target. |
[in] | fd | the used fire definition. |
[in] | splashDamage | Do we count it as splashdamage? If this value is not zero the stats well be counted as splashdamage and the value will be added to the overall splash-damage count. |
Definition at line 304 of file g_combat.cpp.
References Edict::chr, chrScoreMission_s::firedHit, chrScoreMission_s::firedSplashHit, Edict::getTeam(), chrScoreMission_s::hits, chrScoreMission_s::hitsSplash, chrScoreMission_s::hitsSplashDamage, Edict::isSameTeamAs(), KILLED_CIVILIANS, KILLED_ENEMIES, KILLED_TEAM, character_s::scoreMission, TEAM_ALIEN, TEAM_CIVILIAN, type, and fireDef_s::weaponSkill.
Referenced by G_Damage(), and G_ShootSingle().
|
static |
Function to calculate possible damages for mock pseudoaction.
[in,out] | mock | Pseudo action - only for calculating mock values - nullptr for real action. |
[in] | shooter | Pointer to attacker for this mock pseudoaction. |
[in] | struck | Pointer to victim of this mock pseudoaction. |
[in] | damage | Updates mock value of damage. |
Definition at line 224 of file g_combat.cpp.
References shot_mock_s::allow_self, shot_mock_s::civilian, shot_mock_s::damage, shot_mock_s::enemyCount, shot_mock_s::friendCount, G_IsActor, G_IsAI, G_IsCivilian, G_IsDead, G_IsVisibleForTeam, Edict::getTeam(), Edict::inuse, Edict::isSameAs(), and Edict::isSameTeamAs().
Referenced by G_Damage().