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 <common/mutators/mutator/waypoints/waypointsprites.qh>
12 #include <lib/warpzone/server.qh>
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;
27 // entity properties of monsterinfo:
28 .bool(int, entity actor, entity targ) monster_attackfunc;
31 .vector anim_blockend;
32 .vector anim_blockstart;
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)
46 ATTRIB(Monster, spawnflags, int, 0)
47 /** human readable name */
48 ATTRIB(Monster, monster_name, string, "Monster")
50 ATTRIB(Monster, netname, string, "")
52 ATTRIB(Monster, m_model, entity, NULL)
54 ATTRIB(Monster, mins, vector, '-0 -0 -0')
56 ATTRIB(Monster, maxs, vector, '0 0 0')
58 /** (SERVER) setup monster data */
59 METHOD(Monster, mr_setup, bool(Monster this, entity actor)) { return false; }
60 /** (SERVER) logic to run every frame */
61 METHOD(Monster, mr_think, bool(Monster this, entity actor)) { return false; }
62 /** (SERVER) called when monster dies */
63 METHOD(Monster, mr_death, bool(Monster this, entity actor)) { 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, entity actor)) { return false; }
68 /** (BOTH?) sets animations for monster */
69 METHOD(Monster, mr_anim, bool(Monster this, entity actor)) { return false; }