]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/monsters/all.qc
Reintroduce the T-virus
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / all.qc
1 #include "all.qh"
2
3 #include "all.inc"
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(float) attackfunc, 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.monster_attackfunc = attackfunc;
19         e.mdl = modelname;
20         e.spawnflags = monsterflags;
21         e.mins = min_s;
22         e.maxs = max_s;
23         e.model = strzone(strcat("models/monsters/", modelname));
24 }
25 float m_null(float dummy) { return 0; }
26 void register_monsters_done()
27 {
28         dummy_monster_info = spawn();
29         dummy_monster_info.classname = "monster_info";
30         dummy_monster_info.monsterid = 0; // you can recognize dummies by this
31         dummy_monster_info.netname = "";
32         dummy_monster_info.monster_name = "Monster";
33         dummy_monster_info.monster_func = m_null;
34         dummy_monster_info.monster_attackfunc = m_null;
35         dummy_monster_info.mdl = "";
36         dummy_monster_info.mins = '-0 -0 -0';
37         dummy_monster_info.maxs = '0 0 0';
38         dummy_monster_info.model = "";
39 }
40 entity get_monsterinfo(int id)
41 {
42         entity m;
43         if(id < MON_FIRST || id > MON_LAST)
44                 return dummy_monster_info;
45         m = monster_info[id - 1];
46         if(m)
47                 return m;
48         return dummy_monster_info;
49 }