#include "g_local.h"
Go to the source code of this file.
Functions | |
void | G_EventSpawnSound (const edict_t *ent, const vec3_t origin, const char *sound) |
Spawns a sound for all connected clients (that will be spatialized on the client side). | |
void | G_EventActorTurn (const edict_t *ent) |
Send the turn event for the given entity. | |
void | G_EventActorDie (const edict_t *ent) |
Announce the actor die event for the clients that are seeing the actor. | |
void | G_EventActorRevitalise (const edict_t *ent) |
Announce the actor die event for the clients that are seeing the actor. | |
void | G_EventActorSendReservations (const edict_t *ent) |
Will inform the player about the real TU reservation. | |
void | G_EventInventoryDelete (const edict_t *ent, int playerMask, const invDef_t *invDef, int x, int y) |
Tell the client to remove the item from the container. | |
void | G_EventInventoryAdd (const edict_t *ent, int playerMask, int itemAmount) |
Tell the client to add the item from the container. | |
void | G_EventPerish (const edict_t *ent) |
Send an event to all clients that are seeing the given edict, that it just has disappeared. | |
void | G_EventDestroyEdict (const edict_t *ent) |
Unregister an edict at the client. | |
void | G_EventInventoryAmmo (const edict_t *ent, const objDef_t *ammo, int amount, shoot_types_t shootType) |
Change the amount of available ammo for the given entity. | |
void | G_EventStartShoot (const edict_t *ent, int visMask, shoot_types_t shootType, const pos3_t at) |
Start the shooting event. | |
void | G_EventShootHidden (int visMask, const fireDef_t *fd, qboolean firstShoot) |
Start the shooting event for hidden actors. | |
void | G_EventShoot (const edict_t *ent, int visMask, const fireDef_t *fd, qboolean firstShoot, shoot_types_t shootType, int flags, const trace_t *trace, const vec3_t from, const vec3_t impact) |
Do the shooting. | |
void | G_EventReactionFireChange (const edict_t *ent) |
void | G_EventParticleSpawn (int playerMask, const char *name, int levelFlags, const vec3_t s, const vec3_t v, const vec3_t a) |
Spawn a new particle for the client. | |
void | G_EventActorFall (const edict_t *ent) |
void | G_EventSetClientAction (const edict_t *ent) |
Informs the client that an interaction with the world is possible. | |
void | G_EventResetClientAction (const edict_t *ent) |
Reset the client actions for the given entity. | |
void | G_EventActorStats (const edict_t *ent) |
void | G_EventEndRound (void) |
End of round event for the current active team. | |
void | G_EventInventoryReload (const edict_t *ent, int playerMask, const item_t *item, const invDef_t *invDef, const invList_t *ic) |
void | G_EventThrow (int visMask, const fireDef_t *fd, float dt, byte flags, const vec3_t position, const vec3_t velocity) |
void | G_EventSendEdict (const edict_t *ent) |
Send the bounding box info to the client. |
Definition in file g_events.c.
void G_EventActorDie | ( | const edict_t * | ent | ) |
Announce the actor die event for the clients that are seeing the actor.
[in] | ent | The actor that is dying |
Definition at line 57 of file g_events.c.
References EV_ACTOR_DIE, G_VisToPM(), gi, edict_s::number, edict_s::state, and edict_s::visflags.
Referenced by G_ActorDieOrStun().
void G_EventActorFall | ( | const edict_t * | ent | ) |
Definition at line 261 of file g_events.c.
References DIRECTION_FALL, EV_ACTOR_MOVE, G_VisToPM(), gi, GRAVITY, makeDV, edict_s::number, edict_s::pos, and edict_s::visflags.
Referenced by G_ActorFall().
void G_EventActorRevitalise | ( | const edict_t * | ent | ) |
Announce the actor die event for the clients that are seeing the actor.
[in] | ent | The actor that was healed and woke up again |
Definition at line 68 of file g_events.c.
References EV_ACTOR_REVITALISED, G_VisToPM(), gi, edict_s::number, edict_s::state, and edict_s::visflags.
Referenced by G_ActorCheckRevitalise().
void G_EventActorSendReservations | ( | const edict_t * | ent | ) |
Will inform the player about the real TU reservation.
ent | The actors edict. |
Definition at line 79 of file g_events.c.
References edict_s::chr, chrReservations_s::crouch, EV_ACTOR_RESERVATIONCHANGE, G_PLAYER_FROM_ENT, G_PlayerToPM, gi, edict_s::number, chrReservations_s::reaction, character_s::reservedTus, and chrReservations_s::shot.
Referenced by G_ActorReserveTUs().
void G_EventActorStats | ( | const edict_t * | ent | ) |
Definition at line 301 of file g_events.c.
References EV_ACTOR_STATS, G_TeamToPM(), gi, edict_s::HP, edict_s::morale, edict_s::number, edict_s::STUN, edict_s::team, and edict_s::TU.
Referenced by G_SendStats().
void G_EventActorTurn | ( | const edict_t * | ent | ) |
Send the turn event for the given entity.
ent | The entity to send the turn event for |
Definition at line 46 of file g_events.c.
References edict_s::dir, EV_ACTOR_TURN, G_VisToPM(), gi, edict_s::number, and edict_s::visflags.
Referenced by G_ActorDoTurn(), G_ClientMove(), G_ClientShoot(), and G_ClientTurn().
void G_EventDestroyEdict | ( | const edict_t * | ent | ) |
Unregister an edict at the client.
ent | The edict to unregister |
Definition at line 136 of file g_events.c.
References EV_ENT_DESTROY, gi, edict_s::number, and PM_ALL.
Referenced by G_FreeEdict().
void G_EventEndRound | ( | void | ) |
End of round event for the current active team.
Definition at line 315 of file g_events.c.
References level_locals_t::activeTeam, EV_ENDROUND, gi, level, and PM_ALL.
Referenced by G_ClientEndRound().
void G_EventInventoryAdd | ( | const edict_t * | ent, | |
int | playerMask, | |||
int | itemAmount | |||
) |
Tell the client to add the item from the container.
[in] | ent | Pointer to entity having given inventory. |
[in] | playerMask | The player mask to determine which clients should receive the event (e.g. G_VisToPM (ent->visflags)) |
[in] | itemAmount | How many items to add. |
G_WriteItem
call Definition at line 115 of file g_events.c.
References EV_INV_ADD, gi, INV_INVENTORY_BYTES, and edict_s::number.
Referenced by G_ActorInvMove(), and G_SendInventory().
void G_EventInventoryAmmo | ( | const edict_t * | ent, | |
const objDef_t * | ammo, | |||
int | amount, | |||
shoot_types_t | shootType | |||
) |
Change the amount of available ammo for the given entity.
ent | The entity to change the amount of ammo for | |
ammo | The ammo to change | |
amount | The new amount of the left ammo | |
shootType | The shooting type to determine which container to use |
Definition at line 149 of file g_events.c.
References game_import_t::csi, EV_INV_AMMO, G_VisToPM(), gi, csi_s::idLeft, csi_s::idRight, objDef_s::idx, IS_SHOT_RIGHT, edict_s::number, and edict_s::visflags.
Referenced by G_ClientShoot().
void G_EventInventoryDelete | ( | const edict_t * | ent, | |
int | playerMask, | |||
const invDef_t * | invDef, | |||
int | x, | |||
int | y | |||
) |
Tell the client to remove the item from the container.
[in] | ent | Pointer to entity having given inventory. |
[in] | playerMask | The player mask to determine which clients should receive the event (e.g. G_VisToPM (ent->visflags)) |
[in] | invDef | Pointer to inventory definition having given container. |
[in] | x | Position of item in container. |
[in] | y | Position of item in container. |
Definition at line 99 of file g_events.c.
References EV_INV_DEL, gi, invDef_s::id, and edict_s::number.
Referenced by G_ActorInvMove(), G_ClientShoot(), and G_InventoryRemoveItemByID().
void G_EventInventoryReload | ( | const edict_t * | ent, | |
int | playerMask, | |||
const item_t * | item, | |||
const invDef_t * | invDef, | |||
const invList_t * | ic | |||
) |
Definition at line 321 of file g_events.c.
References objDef_s::ammo, EV_INV_RELOAD, gi, invDef_s::id, objDef_s::idx, item_s::m, edict_s::number, item_s::t, invList_s::x, and invList_s::y.
Referenced by G_ActorInvMove().
void G_EventParticleSpawn | ( | int | playerMask, | |
const char * | name, | |||
int | levelFlags, | |||
const vec3_t | s, | |||
const vec3_t | v, | |||
const vec3_t | a | |||
) |
Spawn a new particle for the client.
[in] | name | The id of the particle (see ptl_*.ufo script files in base/ufos) |
[in] | levelFlags | Show at which levels |
[in] | s | starting/location vector |
[in] | v | velocity vector |
[in] | a | acceleration vector |
Definition at line 251 of file g_events.c.
References EV_PARTICLE_SPAWN, and gi.
Referenced by G_TraceDraw().
void G_EventPerish | ( | const edict_t * | ent | ) |
Send an event to all clients that are seeing the given edict, that it just has disappeared.
ent | The edict that disappeared |
Definition at line 126 of file g_events.c.
References EV_ENT_PERISH, G_VisToPM(), gi, edict_s::number, and edict_s::visflags.
Referenced by Destroy_Breakable(), G_ActorInvMove(), G_InventoryToFloor(), and G_SpawnItemOnFloor().
void G_EventReactionFireChange | ( | const edict_t * | ent | ) |
Definition at line 229 of file g_events.c.
References edict_s::chr, EV_ACTOR_REACTIONFIRECHANGE, chrFiremodeSettings_s::fmIdx, G_PLAYER_FROM_ENT, G_PlayerToPM, gi, chrFiremodeSettings_s::hand, objDef_s::idx, NONE, edict_s::number, character_s::RFmode, and chrFiremodeSettings_s::weapon.
Referenced by G_ReactionFireSetDefault(), and G_ReactionFireUpdate().
void G_EventResetClientAction | ( | const edict_t * | ent | ) |
Reset the client actions for the given entity.
[in] | ent | The entity to reset the client action for |
Definition at line 295 of file g_events.c.
References EV_RESET_CLIENT_ACTION, G_PLAYER_FROM_ENT, G_PlayerToPM, gi, and edict_s::number.
Referenced by G_ActorSetClientAction().
void G_EventSendEdict | ( | const edict_t * | ent | ) |
Send the bounding box info to the client.
[in] | ent | The edict to send the bounding box for |
Definition at line 356 of file g_events.c.
References edict_s::absmax, edict_s::absmin, EV_ADD_EDICT, gi, edict_s::number, PM_ALL, and edict_s::type.
Referenced by G_SendBoundingBoxes().
void G_EventSetClientAction | ( | const edict_t * | ent | ) |
Informs the client that an interaction with the world is possible.
[in] | ent | The edict that can execute the action (an actor) |
Definition at line 279 of file g_events.c.
References edict_s::clientAction, EV_DOOR_ACTION, G_TeamToPM(), gi, edict_s::number, and edict_s::team.
Referenced by G_ActorSetClientAction().
void G_EventShoot | ( | const edict_t * | ent, | |
int | visMask, | |||
const fireDef_t * | fd, | |||
qboolean | firstShoot, | |||
shoot_types_t | shootType, | |||
int | flags, | |||
const trace_t * | trace, | |||
const vec3_t | from, | |||
const vec3_t | impact | |||
) |
Do the shooting.
ent | The entity that is doing the shooting | |
visMask | the vis mask to determine the clients from this event is send to | |
fd | The firedefinition to use for the shoot | |
firstShoot | Is this the first shoot | |
shootType | The type of the shoot | |
flags | Define some flags in a bitmask: SF_BODY , SF_IMPACT , SF_BOUNCING and SF_BOUNCING | |
trace | The trace what was used to determine whether this shot has hit something | |
from | The position the entity shoots from | |
impact | The impact world vector for the shot |
Definition at line 207 of file g_events.c.
References trace_s::contentFlags, trace_s::ent, EV_ACTOR_SHOOT, fireDef_s::fdIdx, G_IsBreakable, G_VisToPM(), gi, objDef_s::idx, edict_s::number, fireDef_s::obj, trace_s::plane, SKIP_LOCAL_ENTITY, and fireDef_s::weapFdsIdx.
Referenced by G_ShootSingle().
Start the shooting event for hidden actors.
visMask | the vis mask to determine the clients from this event is send to | |
fd | The firedefinition to use for the shoot | |
firstShoot | Is this the first shoot |
Definition at line 186 of file g_events.c.
References EV_ACTOR_SHOOT_HIDDEN, fireDef_s::fdIdx, G_VisToPM(), gi, objDef_s::idx, fireDef_s::obj, and fireDef_s::weapFdsIdx.
Referenced by G_ClientShoot(), and G_ShootSingle().
Spawns a sound for all connected clients (that will be spatialized on the client side).
ent | The edict that is causing the sound | |
origin | The origin of the sound | |
sound | The sound file, path relative to sounds/. If there is a + at the end of the path, a random sound will be taken. |
Definition at line 35 of file g_events.c.
Referenced by Destroy_Breakable(), and Door_Use().
void G_EventStartShoot | ( | const edict_t * | ent, | |
int | visMask, | |||
shoot_types_t | shootType, | |||
const pos3_t | at | |||
) |
Start the shooting event.
ent | The entity that starts the shooting | |
visMask | the vis mask of the teams to determine the clients from this event is send to | |
shootType | The type of the shoot | |
at | The grid position to target to |
Definition at line 171 of file g_events.c.
References EV_ACTOR_START_SHOOT, G_VisToPM(), gi, edict_s::number, and edict_s::pos.
Referenced by G_ClientShoot().
void G_EventThrow | ( | int | visMask, | |
const fireDef_t * | fd, | |||
float | dt, | |||
byte | flags, | |||
const vec3_t | position, | |||
const vec3_t | velocity | |||
) |
[in] | visMask | the vis mask to determine the clients from this event is send to |
[in] | fd | The firedefinition to use |
[in] | dt | Delta time |
[in] | flags | bitmask of the following values: SF_BODY , SF_IMPACT , SF_BOUNCING and SF_BOUNCED |
[in] | position | The current position |
[in] | velocity | The velocity of the throw |
Definition at line 340 of file g_events.c.
References EV_ACTOR_THROW, fireDef_s::fdIdx, G_VisToPM(), gi, objDef_s::idx, fireDef_s::obj, and fireDef_s::weapFdsIdx.
Referenced by G_ShootGrenade().