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);
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))
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; \
22 this.model = strzone(strcat("models/monsters/", modelname)); \
24 REGISTER_INIT(MON, id)
25 REGISTER_REGISTRY(RegisterMonsters)
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
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
45 .vector mins, maxs; // monster hitbox size
46 .bool(int) monster_attackfunc;
49 .vector anim_blockend;
50 .vector anim_blockstart;