#include "g_local.h"
Go to the source code of this file.
Functions | |
qboolean | G_IsLivingActor (const edict_t *ent) |
Checks whether the given edict is a living actor. | |
void | G_ActorUseDoor (edict_t *actor, edict_t *door) |
Make the actor use (as in open/close) a door edict. | |
qboolean | G_ActorIsInRescueZone (const edict_t *actor) |
Checks whether the given actor is currently standing in a rescue zone. | |
void | G_ActorSetInRescueZone (edict_t *actor, qboolean inRescueZone) |
Set the rescue zone data. | |
void | G_ActorSetClientAction (edict_t *actor, edict_t *ent) |
Handles the client actions (interaction with the world). | |
int | G_ActorGetReservedTUs (const edict_t *ent) |
Calculates the amount of all currently reserved TUs. | |
int | G_ActorUsableTUs (const edict_t *ent) |
Calculates the amount of usable TUs. This is without the reserved TUs. | |
int | G_ActorGetTUForReactionFire (const edict_t *ent) |
Calculates the amount of TUs that are needed for the current selected reaction fire mode. | |
void | G_ActorReserveTUs (edict_t *ent, int resReaction, int resShot, int resCrouch) |
Reserves TUs for different actor actions. | |
edict_t * | G_ActorGetByUCN (const int ucn, const int team) |
Searches an actor by a unique character number. | |
int | G_ActorDoTurn (edict_t *ent, byte dir) |
Turns an actor around. | |
void | G_ActorSetMaxs (edict_t *ent) |
Sets correct bounding box for actor (state dependent). | |
void | G_ActorGiveTimeUnits (edict_t *ent) |
Set time units for the given edict. Based on speed skills. | |
void | G_ActorSetTU (edict_t *ent, int tus) |
void | G_ActorUseTU (edict_t *ent, int tus) |
static void | G_ActorStun (edict_t *ent, const edict_t *attacker) |
static void | G_ActorRevitalise (edict_t *ent) |
void | G_ActorCheckRevitalise (edict_t *ent) |
static void | G_ActorDie (edict_t *ent, const edict_t *attacker) |
void | G_ActorDieOrStun (edict_t *ent, edict_t *attacker) |
Reports and handles death or stun of an actor. If the HP of an actor is zero the actor will die, otherwise the actor will get stunned. | |
void | G_ActorInvMove (edict_t *ent, const invDef_t *from, invList_t *fItem, const invDef_t *to, int tx, int ty, qboolean checkaction) |
Moves an item inside an inventory. Floors are handled special. | |
void | G_ActorReload (edict_t *ent, const invDef_t *invDef) |
Reload weapon with actor. |
Definition in file g_actor.c.
void G_ActorCheckRevitalise | ( | edict_t * | ent | ) |
Definition at line 327 of file g_actor.c.
References G_ActorRevitalise(), G_EventActorRevitalise(), G_IsStunned, G_SendStats(), edict_s::HP, and edict_s::STUN.
Referenced by G_Damage(), and G_UpdateStunState().
Definition at line 336 of file g_actor.c.
References G_ActorSetMaxs(), G_RemoveStunned, G_SetState, level, MAX_DEATH, level_locals_t::num_kills, and edict_s::team.
Referenced by G_ActorDieOrStun(), and G_ClientDisconnect().
Reports and handles death or stun of an actor. If the HP of an actor is zero the actor will die, otherwise the actor will get stunned.
[in] | ent | Pointer to an entity being killed or stunned actor. |
[in] | attacker | Pointer to attacker - it must be notified about state of victim. |
Definition at line 353 of file g_actor.c.
References FLOOR, G_ActorDie(), G_ActorStun(), G_CheckVis(), G_CheckVisTeamAll(), G_EventActorDie(), G_InventoryToFloor(), edict_s::HP, level, level_locals_t::num_alive, qfalse, qtrue, and edict_s::team.
Referenced by G_ClientMove(), G_Damage(), G_MatchSendResults(), and G_ThinkActorDieAfterSpawn().
Turns an actor around.
[in] | ent | the actor (edict) we are talking about |
[in] | dir | the direction to turn the edict into, might be an action |
Definition at line 191 of file g_actor.c.
References byte, CORE_DIRECTIONS, edict_s::dir, directionAngles, dvleft, dvright, FLYING_DIRECTIONS, G_CheckVisTeamAll(), G_EventActorTurn(), i, PATHFINDING_DIRECTIONS, qfalse, edict_s::team, and VIS_STOP.
Referenced by AI_TurnIntoDirection(), G_ClientMove(), and G_ClientTurn().
edict_t* G_ActorGetByUCN | ( | const int | ucn, | |
const int | team | |||
) |
Searches an actor by a unique character number.
[in] | ucn | The unique character number |
[in] | team | The team to get the actor with the ucn from |
NULL
Definition at line 173 of file g_actor.c.
References edict_s::chr, G_EdictsGetNextActor(), edict_s::team, and character_s::ucn.
Referenced by G_ClientInitActorStates().
int G_ActorGetReservedTUs | ( | const edict_t * | ent | ) |
Calculates the amount of all currently reserved TUs.
ent | The actor to calculate the reserved TUs for |
Definition at line 108 of file g_actor.c.
References edict_s::chr, chrReservations_s::crouch, chrReservations_s::reaction, character_s::reservedTus, and chrReservations_s::shot.
Referenced by G_ActorInvMove(), and G_ActorUsableTUs().
int G_ActorGetTUForReactionFire | ( | const edict_t * | ent | ) |
Calculates the amount of TUs that are needed for the current selected reaction fire mode.
[in] | ent | The actors edict |
Definition at line 134 of file g_actor.c.
References ACTOR_GET_INV, edict_s::chr, FIRESH_FiredefForWeapon(), chrFiremodeSettings_s::fmIdx, chrFiremodeSettings_s::hand, invList_s::item, character_s::RFmode, item_s::t, and fireDef_s::time.
Referenced by G_ActorHasEnoughTUsReactionFire(), and G_ClientStateChange().
void G_ActorGiveTimeUnits | ( | edict_t * | ent | ) |
Set time units for the given edict. Based on speed skills.
ent | The actor edict |
Definition at line 283 of file g_actor.c.
References ABILITY_SPEED, edict_s::chr, G_ActorSetTU(), G_IsDazed, G_RemoveDazed, GET_TU, character_s::score, and chrScoreGlobal_s::skills.
Referenced by AI_SetStats(), and G_GiveTimeUnits().
void G_ActorInvMove | ( | edict_t * | ent, | |
const invDef_t * | from, | |||
invList_t * | fItem, | |||
const invDef_t * | to, | |||
int | tx, | |||
int | ty, | |||
qboolean | checkaction | |||
) |
Moves an item inside an inventory. Floors are handled special.
[in] | ent | The pointer to the selected/used edict/soldier. |
[in] | from | The container (-id) the item should be moved from. |
[in] | fItem | The item you want to move. |
[in] | to | The container (-id) the item should be moved to. |
[in] | tx | x position where you want the item to go in the destination container |
[in] | ty | y position where you want the item to go in the destination container |
[in] | checkaction | Set this to qtrue if you want to check for TUs, otherwise qfalse. |
Definition at line 393 of file g_actor.c.
References _, edict_s::chr, FLOOR, chrFiremodeSettings_s::fmIdx, G_ActionCheckForCurrentTeam(), G_ActorGetReservedTUs(), G_ActorSetTU(), G_ActorUseTU(), G_CheckVis(), G_ClientPrintf(), G_EventInventoryAdd(), G_EventInventoryDelete(), G_EventInventoryReload(), G_EventPerish(), G_FreeEdict(), G_GetFloorItems(), G_PLAYER_FROM_ENT, G_ReactionFireUpdate(), G_SendStats(), G_SpawnFloor(), G_TeamToPM(), G_VisToPM(), G_WriteItem(), game, gi, chrFiremodeSettings_s::hand, game_locals_t::i, character_s::i, IA_NONE, IA_NORELOAD, IA_NOTIME, IA_RELOAD, IA_RELOAD_SWAP, INV_IsFloorDef(), INV_IsLeftDef(), INV_IsRightDef(), INVSH_FindSpace(), INVSH_GetFirstShapePosition(), INVSH_SearchInInventory(), invList_s::item, inventoryInterface_s::MoveInInventory, NONE, edict_s::pos, PRINT_HUD, qfalse, qtrue, character_s::RFmode, item_s::t, edict_s::team, edict_s::TU, edict_s::visflags, chrFiremodeSettings_s::weapon, invList_s::x, and invList_s::y.
Referenced by AI_TryToReloadWeapon(), G_ActorReload(), G_ClientAction(), G_ClientGetWeaponFromInventory(), G_MissionTouch(), and G_MoralePanic().
Checks whether the given actor is currently standing in a rescue zone.
[in] | actor | The actor to check |
true
if the actor is standing in a rescue zone, false
otherwise. Definition at line 62 of file g_actor.c.
References edict_s::inRescueZone.
Referenced by G_ActorSetInRescueZone(), and G_MatchSendResults().
Reload weapon with actor.
[in] | ent | Pointer to an actor reloading weapon. |
[in] | invDef | Reloading weapon in right or left hand. |
Definition at line 567 of file g_actor.c.
References CONTAINER, game_import_t::csi, G_ActorInvMove(), gi, invDef_s::id, csi_s::idRight, INV_IsLeftDef(), INVDEF, INVSH_LoadableInWeapon(), invList_s::item, invList_s::next, csi_s::numIDs, invDef_s::out, qtrue, RIGHT, and item_s::t.
Referenced by AI_TryToReloadWeapon(), and AIL_reload().
void G_ActorReserveTUs | ( | edict_t * | ent, | |
int | resReaction, | |||
int | resShot, | |||
int | resCrouch | |||
) |
Reserves TUs for different actor actions.
[in,out] | ent | The actor to reserve TUs for. Might not be NULL . |
[in] | resReaction | TUs for reaction fire |
[in] | resShot | TUs for shooting |
[in] | resCrouch | TUs for going into crouch mode |
Definition at line 156 of file g_actor.c.
References edict_s::chr, chrReservations_s::crouch, G_EventActorSendReservations(), chrReservations_s::reaction, character_s::reservedTus, chrReservations_s::shot, and edict_s::TU.
Referenced by G_ClientAction(), G_ClientStateChange(), and G_Damage().
static void G_ActorRevitalise | ( | edict_t * | ent | ) | [static] |
Definition at line 308 of file g_actor.c.
References G_ActorSetMaxs(), G_CheckVis(), G_CheckVisTeamAll(), G_GetFloorItems(), G_IsStunned, G_RemoveStunned, level, level_locals_t::num_alive, qfalse, qtrue, and edict_s::team.
Referenced by G_ActorCheckRevitalise().
Handles the client actions (interaction with the world).
actor | The actors' edict | |
ent | The edict that can be used by the actor |
Definition at line 90 of file g_actor.c.
References edict_s::clientAction, G_EventResetClientAction(), and G_EventSetClientAction().
Referenced by Reset_DoorTrigger(), and Touch_DoorTrigger().
Set the rescue zone data.
[out] | actor | The actor to set the rescue zone flag for |
[in] | inRescueZone | true if the actor is in the rescue zone, false otherwise |
Definition at line 72 of file g_actor.c.
References _, G_ActorIsInRescueZone(), G_ClientPrintf(), G_PLAYER_FROM_ENT, edict_s::inRescueZone, and PRINT_HUD.
Referenced by Reset_RescueTrigger(), and Touch_RescueTrigger().
void G_ActorSetMaxs | ( | edict_t * | ent | ) |
Sets correct bounding box for actor (state dependent).
[in] | ent | Pointer to entity for which bounding box is being set. |
Definition at line 266 of file g_actor.c.
References G_IsCrouched, G_IsDead, gi, edict_s::maxs, PLAYER_CROUCH, PLAYER_DEAD, PLAYER_STAND, PLAYER_WIDTH, and VectorSet.
Referenced by G_ActorDie(), G_ActorRevitalise(), G_ClientStateChange(), G_MoraleBehaviour(), and G_MoralePanic().
void G_ActorSetTU | ( | edict_t * | ent, | |
int | tus | |||
) |
Definition at line 290 of file g_actor.c.
References edict_s::TU.
Referenced by G_ActorGiveTimeUnits(), G_ActorInvMove(), G_ActorUseTU(), G_ClientInitActorStates(), G_ClientMove(), G_ClientShoot(), G_Damage(), G_MoralePanic(), and SP_func_door().
Definition at line 300 of file g_actor.c.
References level, level_locals_t::num_stuns, edict_s::state, STATE_STUN, and edict_s::team.
Referenced by G_ActorDieOrStun().
int G_ActorUsableTUs | ( | const edict_t * | ent | ) |
Calculates the amount of usable TUs. This is without the reserved TUs.
[in] | ent | The actor to calculate the amount of usable TUs for. If ent is NULL , we return zero here |
Definition at line 120 of file g_actor.c.
References G_ActorGetReservedTUs(), and edict_s::TU.
Referenced by G_ActionCheck().
Make the actor use (as in open/close) a door edict.
actor | The actor that is using the door | |
door | The door that should be opened/closed |
Definition at line 44 of file g_actor.c.
References ET_ACTOR, G_ClientUseEdict(), G_FindRadius(), G_PLAYER_FROM_ENT, G_TouchTriggers(), edict_s::origin, and UNIT_SIZE.
Referenced by G_ClientAction(), and Touch_DoorTrigger().
void G_ActorUseTU | ( | edict_t * | ent, | |
int | tus | |||
) |
Definition at line 295 of file g_actor.c.
References G_ActorSetTU(), and edict_s::TU.
Referenced by G_ActorInvMove(), G_ClientStateChange(), G_ClientTurn(), and G_ClientUseEdict().
Checks whether the given edict is a living actor.
[in] | ent | The edict to perform the check for |
Definition at line 32 of file g_actor.c.
References G_IsActor, G_IsDead, and G_IsStunned.
Referenced by Door_Use(), G_Damage(), G_EdictsGetNextLivingActor(), G_ReactionFireCanBeEnabled(), G_SplashDamage(), G_TouchTriggers(), G_Vis(), and G_VisShouldStop().