UFO: Alien Invasion
g_events.h
Go to the documentation of this file.
1 
6 /*
7 All original material Copyright (C) 2002-2022 UFO: Alien Invasion.
8 
9 Original file from Quake 2 v3.21: quake2-2.31/game/g_local.h
10 Copyright (C) 1997-2001 Id Software, Inc.
11 
12 This program is free software; you can redistribute it and/or
13 modify it under the terms of the GNU General Public License
14 as published by the Free Software Foundation; either version 2
15 of the License, or (at your option) any later version.
16 
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 
21 See the GNU General Public License for more details.
22 
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 
27 */
28 
29 #pragma once
30 
31 #include "g_vis.h"
32 
33 /* A bit mask. One bit for each affected player. */
34 typedef unsigned int playermask_t;
35 /* Bitmask for all players */
36 #define PM_ALL 0xFFFFFFFF
37 #define G_PlayerToPM(player) ((player).getNum() < game.sv_maxplayersperteam ? 1 << ((player).getNum()) : 0)
38 
39 void G_EventActorAdd(playermask_t playerMask, const Edict& ent, const bool instant = false);
40 void G_EventActorAppear(playermask_t playerMask, const Actor& check, const Edict* ent);
41 void G_EventActorDie(const Edict& ent, bool attacker);
42 void G_EventActorFall(const Edict& ent);
43 void G_EventActorRevitalise(const Edict& ent);
44 void G_EventActorSendReservations(const Edict& ent);
45 void G_EventActorStateChange(playermask_t playerMask, const Edict& ent);
46 void G_EventActorStats(const Edict& ent, playermask_t playerMask);
47 void G_EventActorTurn(const Edict& ent);
48 void G_EventAddBrushModel(playermask_t playerMask, const Edict& ent);
49 void G_EventCenterView(const Edict& ent);
50 void G_EventCenterViewAt(playermask_t playerMask, const pos3_t pos);
51 void G_EventMoveCameraTo(playermask_t playerMask, const pos3_t pos);
52 void G_EventDoorClose(const Edict& door);
53 void G_EventDoorOpen(const Edict& door);
54 void G_EventDestroyEdict(const Edict& ent);
55 void G_EventEdictAppear(playermask_t playerMask, const Edict& ent);
56 void G_EventEdictPerish(playermask_t playerMask, const Edict& ent);
57 void G_EventCameraAppear(playermask_t playerMask, const Edict& ent);
58 void G_EventEndRound(void);
59 void G_EventEndRoundAnnounce(const Player& player);
60 void G_EventInventoryAdd(const Edict& ent, playermask_t playerMask, int itemAmount);
61 void G_EventInventoryAmmo(const Edict& ent, const objDef_t* ammo, int amount, shoot_types_t shootType);
62 void G_EventInventoryDelete(const Edict& ent, playermask_t playerMask, const containerIndex_t containerId, int x, int y);
63 void G_EventInventoryReload(const Edict& ent, playermask_t playerMask, const Item* item, const invDef_t* invDef, const Item* ic);
64 void G_EventModelExplodeTriggered(const Edict& ent, const char* sound);
65 void G_EventModelExplode(const Edict& ent, const char* sound);
66 void G_EventParticleSpawn(playermask_t playerMask, const char* name, int levelFlags, const vec3_t s, const vec3_t v, const vec3_t a);
67 void G_EventPerish(const Edict& ent);
68 void G_EventReactionFireChange(const Edict& ent);
69 void G_EventReset(const Player& player, int activeTeam);
70 void G_EventResetClientAction(const Edict& ent);
71 void G_EventSendEdict(const Edict& ent);
72 void G_EventSendParticle(playermask_t playerMask, const Edict& ent);
73 void G_EventSendState(playermask_t playerMask, const Edict& ent);
74 void G_EventSetClientAction(const Edict& ent);
75 void G_EventShootHidden(teammask_t teamMask, const fireDef_t* fd, bool firstShoot, const vec3_t impact, int flags, const Edict* targetEdict);
76 void G_EventShoot(const Edict& ent, teammask_t teamMask, const fireDef_t* fd, bool firstShoot, shoot_types_t shootType, int flags, const trace_t* trace, const vec3_t from, const vec3_t impact);
77 void G_EventSpawnSound(playermask_t playerMask, const Edict& ent, const vec3_t origin, const char* sound);
78 void G_EventSpawnFootstepSound(const Edict& ent, const char* sound);
79 void G_EventStart(const Player& player, bool teamplay);
80 void G_EventStartShoot(const Edict& ent, teammask_t teamMask, shoot_types_t shootType, const pos3_t at);
81 void G_EventEndShoot(const Edict& ent, teammask_t teamMask);
82 void G_EventThrow(teammask_t teamMask, const fireDef_t* fd, float dt, byte flags, const vec3_t position, const vec3_t velocity);
83 void G_EventAdd(playermask_t playerMask, int eType, int entnum);
84 void G_EventEnd(void);
85 void G_EventActorWound(const Edict& ent, const int bodyPart);
86 void G_EventReactionFireAddTarget(const Edict& shooter, const Edict& target, int tusG_EventReactionFireAddTarget, int step);
87 void G_EventReactionFireRemoveTarget(const Edict& shooter, const Edict& target, int step);
88 void G_EventReactionFireTargetUpdate(const Edict& shooter, const Edict& target, int tus, int step);
89 void G_EventReactionFireAbortShot(const Edict& shooter, const Edict& target, int step);
void G_EventActorSendReservations(const Edict &ent)
Will inform the player about the real TU reservation.
Definition: g_events.cpp:113
void G_EventParticleSpawn(playermask_t 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.
Definition: g_events.cpp:334
void G_EventReactionFireChange(const Edict &ent)
Definition: g_events.cpp:282
void G_EventDoorClose(const Edict &door)
Definition: g_events.cpp:683
void G_EventAddBrushModel(playermask_t playerMask, const Edict &ent)
Definition: g_events.cpp:639
void G_EventShootHidden(teammask_t teamMask, const fireDef_t *fd, bool firstShoot, const vec3_t impact, int flags, const Edict *targetEdict)
Start the shooting event for hidden actors.
Definition: g_events.cpp:232
Defines all attributes of objects used in the inventory.
Definition: inv_shared.h:264
void G_EventCameraAppear(playermask_t playerMask, const Edict &ent)
Send an appear event to the client.
Definition: g_events.cpp:543
voidpf uLong int origin
Definition: ioapi.h:45
unsigned int playermask_t
Definition: g_events.h:34
void G_EventReactionFireAddTarget(const Edict &shooter, const Edict &target, int tusG_EventReactionFireAddTarget, int step)
Definition: g_events.cpp:295
void G_EventSpawnSound(playermask_t playerMask, const Edict &ent, const vec3_t origin, const char *sound)
Spawns a sound (that will be spatialized on the client side)
Definition: g_events.cpp:40
void G_EventPerish(const Edict &ent)
Send an event to all clients that are seeing the given edict, that it just has disappeared.
Definition: g_events.cpp:158
this is a fire definition for our weapons/ammo
Definition: inv_shared.h:110
void G_EventSendEdict(const Edict &ent)
Send the bounding box info to the client.
Definition: g_events.cpp:457
void G_EventEndRound(void)
End of turn event for the current active team.
Definition: g_events.cpp:414
void G_EventActorTurn(const Edict &ent)
Send the turn event for the given entity.
Definition: g_events.cpp:77
void G_EventStart(const Player &player, bool teamplay)
Definition: g_events.cpp:662
item instance data, with linked list capability
Definition: inv_shared.h:402
void G_EventEdictPerish(playermask_t playerMask, const Edict &ent)
Send disappear event.
Definition: g_events.cpp:624
void G_EventActorWound(const Edict &ent, const int bodyPart)
Send info about an actor&#39;s wounds to the client.
Definition: g_events.cpp:399
void G_EventActorStateChange(playermask_t playerMask, const Edict &ent)
Definition: g_events.cpp:632
void G_EventReactionFireTargetUpdate(const Edict &shooter, const Edict &target, int tus, int step)
Definition: g_events.cpp:310
void G_EventSpawnFootstepSound(const Edict &ent, const char *sound)
Definition: g_events.cpp:62
int32_t shoot_types_t
Available shoot types - also see the ST_ constants.
Definition: q_shared.h:206
void G_EventActorAppear(playermask_t playerMask, const Actor &check, const Edict *ent)
Definition: g_events.cpp:571
void G_EventReset(const Player &player, int activeTeam)
Definition: g_events.cpp:669
void G_EventModelExplodeTriggered(const Edict &ent, const char *sound)
Definition: g_events.cpp:689
void G_EventActorStats(const Edict &ent, playermask_t playerMask)
Definition: g_events.cpp:383
void G_EventShoot(const Edict &ent, teammask_t teamMask, const fireDef_t *fd, bool firstShoot, shoot_types_t shootType, int flags, const trace_t *trace, const vec3_t from, const vec3_t impact)
Do the shooting.
Definition: g_events.cpp:260
An Edict of type Actor.
Definition: g_edict.h:348
void G_EventSendParticle(playermask_t playerMask, const Edict &ent)
Definition: g_events.cpp:529
void G_EventResetClientAction(const Edict &ent)
Reset the client actions for the given entity.
Definition: g_events.cpp:376
void G_EventEnd(void)
Definition: g_events.cpp:711
pos_t pos3_t[3]
Definition: ufotypes.h:58
inventory definition for our menus
Definition: inv_shared.h:371
void G_EventActorFall(const Edict &ent)
Definition: g_events.cpp:345
void G_EventSetClientAction(const Edict &ent)
Informs the client that an interaction with the world is possible.
Definition: g_events.cpp:360
void G_EventEndShoot(const Edict &ent, teammask_t teamMask)
Ends the shooting event.
Definition: g_events.cpp:217
void G_EventEndRoundAnnounce(const Player &player)
Definition: g_events.cpp:654
void G_EventCenterView(const Edict &ent)
Centers the view for all clients that are seeing the given edict on the world position of the edict...
Definition: g_events.cpp:479
void G_EventInventoryDelete(const Edict &ent, playermask_t playerMask, const containerIndex_t containerId, int x, int y)
Tell the client to remove the item from the container.
Definition: g_events.cpp:131
void G_EventThrow(teammask_t teamMask, const fireDef_t *fd, float dt, byte flags, const vec3_t position, const vec3_t velocity)
Definition: g_events.cpp:440
int32_t containerIndex_t
Definition: inv_shared.h:46
void G_EventReactionFireAbortShot(const Edict &shooter, const Edict &target, int step)
Definition: g_events.cpp:318
void G_EventActorRevitalise(const Edict &ent)
Announce the actor revitalize event for the clients that are seeing the actor.
Definition: g_events.cpp:102
void G_EventReactionFireRemoveTarget(const Edict &shooter, const Edict &target, int step)
Definition: g_events.cpp:303
void G_EventStartShoot(const Edict &ent, teammask_t teamMask, shoot_types_t shootType, const pos3_t at)
Start the shooting event.
Definition: g_events.cpp:203
void G_EventInventoryAdd(const Edict &ent, playermask_t playerMask, int itemAmount)
Tell the client to add the item from the container.
Definition: g_events.cpp:147
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition: r_gl.h:110
void G_EventDoorOpen(const Edict &door)
Definition: g_events.cpp:677
vec_t vec3_t[3]
Definition: ufotypes.h:39
unsigned int teammask_t
Definition: g_vis.h:30
void G_EventActorAdd(playermask_t playerMask, const Edict &ent, const bool instant=false)
Definition: g_events.cpp:511
void G_EventInventoryAmmo(const Edict &ent, const objDef_t *ammo, int amount, shoot_types_t shootType)
Change the amount of available ammo for the given entity.
Definition: g_events.cpp:181
void G_EventDestroyEdict(const Edict &ent)
Unregister an edict at the client.
Definition: g_events.cpp:167
void G_EventAdd(playermask_t playerMask, int eType, int entnum)
Definition: g_events.cpp:705
void G_EventCenterViewAt(playermask_t playerMask, const pos3_t pos)
Centers the view for all clients that are seeing the given edict on the world position of the edict...
Definition: g_events.cpp:489
Definition: g_edict.h:45
void G_EventInventoryReload(const Edict &ent, playermask_t playerMask, const Item *item, const invDef_t *invDef, const Item *ic)
Definition: g_events.cpp:421
uint8_t byte
Definition: ufotypes.h:34
QGL_EXTERN int GLboolean GLfloat * v
Definition: r_gl.h:120
void G_EventModelExplode(const Edict &ent, const char *sound)
Definition: g_events.cpp:697
void G_EventEdictAppear(playermask_t playerMask, const Edict &ent)
Send an appear event to the client.
Definition: g_events.cpp:563
void G_EventMoveCameraTo(playermask_t playerMask, const pos3_t pos)
Centers the view for all clients that are seeing the given edict on the world position of the edict...
Definition: g_events.cpp:501
void G_EventSendState(playermask_t playerMask, const Edict &ent)
Definition: g_events.cpp:466
void G_EventActorDie(const Edict &ent, bool attacker)
Announce the actor die event for the clients that are seeing the actor.
Definition: g_events.cpp:89