]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/monsters/all.qh
De-stringify particle effects
[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 // monster requests
30 const int MR_SETUP = 1; // (SERVER) setup monster data
31 const int MR_THINK = 2; // (SERVER) logic to run every frame
32 const int MR_DEATH = 3; // (SERVER) called when monster dies
33 const int MR_PRECACHE = 4; // (BOTH) precaches models/sounds used by this monster
34
35 // special spawn flags
36 const int MONSTER_RESPAWN_DEATHPOINT = 16; // re-spawn where we died
37 const int MONSTER_TYPE_FLY = 32;
38 const int MONSTER_TYPE_SWIM = 64;
39 const int MONSTER_SIZE_BROKEN = 128; // TODO: remove when bad models are replaced
40 const int MON_FLAG_SUPERMONSTER = 256; // incredibly powerful monster
41 const int MON_FLAG_RANGED = 512; // monster shoots projectiles
42 const int MON_FLAG_MELEE = 1024;
43
44 // entity properties of monsterinfo:
45 .string netname; // short name
46 .string mdl; // currently a copy of the model
47 .string model; // full name of model
48 .int spawnflags;
49 .vector mins, maxs; // monster hitbox size
50
51 // other useful macros
52 #define MON_ACTION(monstertype,mrequest) (get_monsterinfo(monstertype)).monster_func(mrequest)
53 #define M_NAME(monstertype) (get_monsterinfo(monstertype)).monster_name
54
55 #endif