]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/monsters/monster.qh
Merge branch 'TimePath/unified_weapons' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / monster.qh
1 #ifndef MONSTER_H
2 #define MONSTER_H
3
4 // special spawn flags
5 const int MONSTER_RESPAWN_DEATHPOINT = 16; // re-spawn where we died
6 const int MONSTER_TYPE_FLY = 32;
7 const int MONSTER_TYPE_SWIM = 64;
8 const int MONSTER_SIZE_BROKEN = 128; // TODO: remove when bad models are replaced
9 const int MON_FLAG_SUPERMONSTER = 256; // incredibly powerful monster
10 const int MON_FLAG_RANGED = 512; // monster shoots projectiles
11 const int MON_FLAG_MELEE = 1024;
12 const int MON_FLAG_CRUSH = 2048; // monster can be stomped in special modes
13 const int MON_FLAG_RIDE = 4096; // monster can be ridden in special modes
14
15 // entity properties of monsterinfo:
16 .bool(int, entity targ) monster_attackfunc;
17
18 // animations
19 .vector anim_blockend;
20 .vector anim_blockstart;
21 .vector anim_melee1;
22 .vector anim_melee2;
23 .vector anim_melee3;
24 .vector anim_pain3;
25 .vector anim_pain4;
26 .vector anim_pain5;
27 .vector anim_walk;
28 .vector anim_spawn;
29
30 /** If you register a new monster, make sure to add it to all.inc */
31 CLASS(Monster, Object)
32     ATTRIB(Monster, monsterid, int, 0)
33     /** attributes */
34     ATTRIB(Monster, spawnflags, int, 0)
35     /** human readable name */
36     ATTRIB(Monster, monster_name, string, "Monster")
37     /** short name */
38     ATTRIB(Monster, netname, string, "")
39     /** model */
40     ATTRIB(Monster, m_model, entity, NULL)
41     /** hitbox size */
42     ATTRIB(Monster, mins, vector, '-0 -0 -0')
43     /** hitbox size */
44     ATTRIB(Monster, maxs, vector, '0 0 0')
45     
46     /** (SERVER) setup monster data */
47     METHOD(Monster, mr_setup, bool(Monster this)) { return false; }
48     /** (SERVER) logic to run every frame */
49     METHOD(Monster, mr_think, bool(Monster this)) { return false; }
50     /** (SERVER) called when monster dies */
51     METHOD(Monster, mr_death, bool(Monster this)) { return false; }
52     /** (BOTH) precaches models/sounds used by this monster */
53     METHOD(Monster, mr_precache, bool(Monster this)) { return false; }
54     /** (SERVER) called when monster is damaged */
55     METHOD(Monster, mr_pain, bool(Monster this)) { return false; }
56     /** (BOTH?) sets animations for monster */
57     METHOD(Monster, mr_anim, bool(Monster this)) { return false; }
58
59 ENDCLASS(Monster)
60
61 #endif