]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/monsters/all.qh
ea1eb5158658c00ec967fa412af45016c9e98e21
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / all.qh
1 #ifndef MONSTERS_ALL_H
2 #define MONSTERS_ALL_H
3
4 void RegisterMonsters();
5 const int MON_MAXCOUNT = 24;
6 entity monster_info[MON_MAXCOUNT], monster_info_first, monster_info_last;
7 entity get_monsterinfo(float id);
8 int MON_COUNT;
9 const int MON_FIRST = 1;
10 #define MON_LAST (MON_FIRST + MON_COUNT - 1)
11 /** If you register a new monster, make sure to add it to all.inc */
12 #define REGISTER_MONSTER(id, class) REGISTER(RegisterMonsters, MON, monster_info, MON_COUNT, id, monsterid, NEW(class))
13 #include "monster.qh"
14 #define REGISTER_MONSTER_SIMPLE(id, monsterflags, min_s, max_s, modelname, shortname, mname) \
15     REGISTER_MONSTER(id, Monster) {                                     \
16         this.netname = shortname;                                       \
17         this.monster_name = mname;                                      \
18         this.mdl = modelname;                                           \
19         this.spawnflags = monsterflags;                                 \
20         this.mins = min_s;                                              \
21         this.maxs = max_s;                                              \
22         this.model = strzone(strcat("models/monsters/", modelname));    \
23     }                                                                   \
24     REGISTER_INIT(MON, id)
25 REGISTER_REGISTRY(RegisterMonsters)
26
27 #include "../util.qh"
28
29 // special spawn flags
30 const int MONSTER_RESPAWN_DEATHPOINT = 16; // re-spawn where we died
31 const int MONSTER_TYPE_FLY = 32;
32 const int MONSTER_TYPE_SWIM = 64;
33 const int MONSTER_SIZE_BROKEN = 128; // TODO: remove when bad models are replaced
34 const int MON_FLAG_SUPERMONSTER = 256; // incredibly powerful monster
35 const int MON_FLAG_RANGED = 512; // monster shoots projectiles
36 const int MON_FLAG_MELEE = 1024;
37 const int MON_FLAG_CRUSH = 2048; // monster can be stomped in special modes
38 const int MON_FLAG_RIDE = 4096; // monster can be ridden in special modes
39
40 // entity properties of monsterinfo:
41 .string netname; // short name
42 .string mdl; // currently a copy of the model
43 .string model; // full name of model
44 .int spawnflags;
45 .vector mins, maxs; // monster hitbox size
46 .bool(int) monster_attackfunc;
47
48 // animations
49 .vector anim_blockend;
50 .vector anim_blockstart;
51 .vector anim_melee1;
52 .vector anim_melee2;
53 .vector anim_melee3;
54 .vector anim_pain3;
55 .vector anim_pain4;
56 .vector anim_pain5;
57 .vector anim_walk;
58 .vector anim_spawn;
59
60 #endif