g_events.c File Reference

#include "g_local.h"
Include dependency graph for g_events.c:

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.

Detailed Description

Definition in file g_events.c.


Function Documentation

void G_EventActorDie ( const edict_t ent  ) 

Announce the actor die event for the clients that are seeing the actor.

Parameters:
[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  ) 
void G_EventActorRevitalise ( const edict_t ent  ) 

Announce the actor die event for the clients that are seeing the actor.

Parameters:
[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.

Parameters:
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  ) 
void G_EventActorTurn ( const edict_t ent  ) 

Send the turn event for the given entity.

Parameters:
ent The entity to send the turn event for
Note:
Every player that can see this ent will reveive the turn event data
Make sure that the direction to turn into is already set

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.

Parameters:
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.

Note:
This event is send to every connected client

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.

Parameters:
[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.
Note:
This event must be followed by a 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.

Parameters:
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.

Parameters:
[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 
)
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.

Parameters:
[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.

Parameters:
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  ) 
void G_EventResetClientAction ( const edict_t ent  ) 

Reset the client actions for the given entity.

Parameters:
[in] ent The entity to reset the client action for
Note:
This event is send to the player this edict belongs to

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.

Parameters:
[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.

Note:
It's assumed that the clientAction is already set
Parameters:
[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.

Parameters:
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().

void G_EventShootHidden ( int  visMask,
const fireDef_t fd,
qboolean  firstShoot 
)

Start the shooting event for hidden actors.

Parameters:
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().

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).

Parameters:
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.

References gi, and PM_ALL.

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.

Parameters:
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 
)
Parameters:
[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().


Generated by  doxygen 1.6.2