]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/monsters/monsters.qc
Clean up MENUQC #includes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / monsters.qc
1 #include "monsters.qh"
2
3 #include "all.qh"
4
5 // MONSTER PLUGIN SYSTEM
6 entity monster_info[MON_MAXCOUNT];
7 entity dummy_monster_info;
8
9 void register_monster(int id, float(float) func, int monsterflags, vector min_s, vector max_s, string modelname, string shortname, string mname)
10 {
11         entity e;
12         monster_info[id - 1] = e = spawn();
13         e.classname = "monster_info";
14         e.monsterid = id;
15         e.netname = shortname;
16         e.monster_name = mname;
17         e.monster_func = func;
18         e.mdl = modelname;
19         e.spawnflags = monsterflags;
20         e.mins = min_s;
21         e.maxs = max_s;
22         e.model = strzone(strcat("models/monsters/", modelname));
23 }
24 float m_null(float dummy) { return 0; }
25 void register_monsters_done()
26 {
27         dummy_monster_info = spawn();
28         dummy_monster_info.classname = "monster_info";
29         dummy_monster_info.monsterid = 0; // you can recognize dummies by this
30         dummy_monster_info.netname = "";
31         dummy_monster_info.monster_name = "Monster";
32         dummy_monster_info.monster_func = m_null;
33         dummy_monster_info.mdl = "";
34         dummy_monster_info.mins = '-0 -0 -0';
35         dummy_monster_info.maxs = '0 0 0';
36         dummy_monster_info.model = "";
37 }
38 entity get_monsterinfo(int id)
39 {
40         entity m;
41         if(id < MON_FIRST || id > MON_LAST)
42                 return dummy_monster_info;
43         m = monster_info[id - 1];
44         if(m)
45                 return m;
46         return dummy_monster_info;
47 }