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