5 #include "../util-pre.qh"
6 #include "../../client/sys-pre.qh"
7 #include "../../dpdefs/csprogsdefs.qh"
8 #include "../../client/sys-post.qh"
9 #include "../../client/defs.qh"
10 #include "../../dpdefs/keycodes.qh"
11 #include "../constants.qh"
12 #include "../stats.qh"
13 #include "../../warpzonelib/anglestransform.qh"
14 #include "../../warpzonelib/mathlib.qh"
15 #include "../../warpzonelib/common.qh"
16 #include "../../warpzonelib/client.qh"
17 #include "../playerstats.qh"
18 #include "../teams.qh"
20 #include "../nades.qh"
21 #include "../buffs.qh"
23 #include "../counting.qh"
24 #include "../weapons/weapons.qh"
25 #include "../mapinfo.qh"
26 #include "../command/markup.qh"
27 #include "../command/rpn.qh"
28 #include "../command/generic.qh"
29 #include "../command/shared_defs.qh"
30 #include "../urllib.qh"
31 #include "../animdecide.qh"
32 #include "../../client/command/cl_cmd.qh"
34 #include "../util-pre.qh"
35 #include "../../menu/sys-pre.qh"
36 #include "../../dpdefs/menudefs.qh"
37 #include "../../dpdefs/keycodes.qh"
38 #include "../../menu/sys-post.qh"
39 #include "../../menu/config.qh"
40 #include "../../warpzonelib/mathlib.qh"
43 #include "../../menu/oo/base.qh"
44 #include "../playerstats.qh"
45 #include "../teams.qh"
46 #include "../constants.qh"
47 #include "../mapinfo.qh"
48 #include "../campaign_common.qh"
49 #include "../weapons/weapons.qh"
50 #include "../counting.qh"
51 #include "../command/markup.qh"
52 #include "../command/rpn.qh"
53 #include "../command/generic.qh"
54 #include "../command/shared_defs.qh"
55 #include "../urllib.qh"
57 #include "../util-pre.qh"
58 #include "../../server/sys-pre.qh"
59 #include "../../dpdefs/progsdefs.qh"
60 #include "../../dpdefs/dpextensions.qh"
61 #include "../../server/sys-post.qh"
62 #include "../../warpzonelib/anglestransform.qh"
63 #include "../../warpzonelib/mathlib.qh"
64 #include "../../warpzonelib/common.qh"
65 #include "../../warpzonelib/util_server.qh"
66 #include "../../warpzonelib/server.qh"
67 #include "../constants.qh"
68 #include "../stats.qh"
69 #include "../teams.qh"
71 #include "../nades.qh"
72 #include "../buffs.qh"
74 #include "../counting.qh"
75 #include "../urllib.qh"
76 #include "../command/markup.qh"
77 #include "../command/rpn.qh"
78 #include "../command/generic.qh"
79 #include "../command/shared_defs.qh"
80 #include "../net_notice.qh"
81 #include "../animdecide.qh"
85 const int MR_SETUP = 1; // (SERVER) setup monster data
86 const int MR_THINK = 2; // (SERVER) logic to run every frame
87 const int MR_DEATH = 3; // (SERVER) called when monster dies
88 const int MR_PRECACHE = 4; // (BOTH) precaches models/sounds used by this monster
91 entity get_monsterinfo(float id);
93 // special spawn flags
94 const int MONSTER_RESPAWN_DEATHPOINT = 16; // re-spawn where we died
95 const int MONSTER_TYPE_FLY = 32;
96 const int MONSTER_TYPE_SWIM = 64;
97 const int MONSTER_SIZE_BROKEN = 128; // TODO: remove when bad models are replaced
98 const int MON_FLAG_SUPERMONSTER = 256; // incredibly powerful monster
99 const int MON_FLAG_RANGED = 512; // monster shoots projectiles
100 const int MON_FLAG_MELEE = 1024;
102 // entity properties of monsterinfo:
103 .float monsterid; // MON_...
104 .string netname; // short name
105 .string monster_name; // human readable name
106 .float(float) monster_func; // m_...
107 .string mdl; // currently a copy of the model
108 .string model; // full name of model
110 .vector mins, maxs; // monster hitbox size
112 // other useful macros
113 #define MON_ACTION(monstertype,mrequest) (get_monsterinfo(monstertype)).monster_func(mrequest)
114 #define M_NAME(monstertype) (get_monsterinfo(monstertype)).monster_name
116 // =====================
117 // Monster Registration
118 // =====================
120 float m_null(float dummy);
121 void register_monster(float id, float(float) func, float monsterflags, vector min_s, vector max_s, string modelname, string shortname, string mname);
122 void register_monsters_done();
124 const int MON_MAXCOUNT = 24;
125 const int MON_FIRST = 1;
129 #define REGISTER_MONSTER_2(id,func,monsterflags,min_s,max_s,modelname,shortname,mname) \
132 void RegisterMonsters_##id() \
134 MON_LAST = (id = MON_FIRST + MON_COUNT); \
136 register_monster(id,func,monsterflags,min_s,max_s,modelname,shortname,mname); \
138 ACCUMULATE_FUNCTION(RegisterMonsters, RegisterMonsters_##id)
140 #define REGISTER_MONSTER(id,func,monsterflags,min_s,max_s,modelname,shortname,mname) \
141 REGISTER_MONSTER_2(MON_##id,m_null,monsterflags,min_s,max_s,modelname,shortname,mname)
143 #define REGISTER_MONSTER(id,func,monsterflags,min_s,max_s,modelname,shortname,mname) \
144 REGISTER_MONSTER_2(MON_##id,func,monsterflags,min_s,max_s,modelname,shortname,mname)
149 #undef REGISTER_MONSTER
150 ACCUMULATE_FUNCTION(RegisterMonsters, register_monsters_done);