1 /**
2  * @file
3  * @brief Event related headers
4  */
5 
6 /*
7 All original material Copyright (C) 2002-2013 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);
40 void G_EventActorAppear(playermask_t playerMask, const Edict &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);
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