]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/monsters/monsters.qc
Rename defs to qh
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / monsters.qc
1 #if defined(CSQC)
2         #include "../../dpdefs/csprogsdefs.qh"
3         #include "../weapons/weapons.qh"
4         #include "monsters.qh"
5 #elif defined(MENUQC)
6 #elif defined(SVQC)
7         #include "../../dpdefs/progsdefs.qh"
8     #include "../../dpdefs/dpextensions.qh"
9     #include "../../warpzonelib/server.qh"
10     #include "../constants.qh"
11     #include "../util.qh"
12     #include "monsters.qh"
13     #include "sv_monsters.qh"
14     #include "../weapons/weapons.qh"
15     #include "../../server/t_items.qh"
16     #include "../../server/autocvars.qh"
17     #include "../../server/constants.qh"
18     #include "../../server/defs.qh"
19     #include "../deathtypes.qh"
20     #include "../../server/mutators/mutators_include.qh"
21     #include "../../csqcmodellib/sv_model.qh"
22 #endif
23 #include "all.qh"
24
25 // MONSTER PLUGIN SYSTEM
26 entity monster_info[MON_MAXCOUNT];
27 entity dummy_monster_info;
28
29 void register_monster(int id, float(float) func, int monsterflags, vector min_s, vector max_s, string modelname, string shortname, string mname)
30 {
31         entity e;
32         monster_info[id - 1] = e = spawn();
33         e.classname = "monster_info";
34         e.monsterid = id;
35         e.netname = shortname;
36         e.monster_name = mname;
37         e.monster_func = func;
38         e.mdl = modelname;
39         e.spawnflags = monsterflags;
40         e.mins = min_s;
41         e.maxs = max_s;
42         e.model = strzone(strcat("models/monsters/", modelname));
43 }
44 float m_null(float dummy) { return 0; }
45 void register_monsters_done()
46 {
47         dummy_monster_info = spawn();
48         dummy_monster_info.classname = "monster_info";
49         dummy_monster_info.monsterid = 0; // you can recognize dummies by this
50         dummy_monster_info.netname = "";
51         dummy_monster_info.monster_name = "Monster";
52         dummy_monster_info.monster_func = m_null;
53         dummy_monster_info.mdl = "";
54         dummy_monster_info.mins = '-0 -0 -0';
55         dummy_monster_info.maxs = '0 0 0';
56         dummy_monster_info.model = "";
57 }
58 entity get_monsterinfo(int id)
59 {
60         entity m;
61         if(id < MON_FIRST || id > MON_LAST)
62                 return dummy_monster_info;
63         m = monster_info[id - 1];
64         if(m)
65                 return m;
66         return dummy_monster_info;
67 }