5 #include "sv_monsters.qh"
6 #include <server/g_damage.qh>
7 #include <server/bot/api.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>
16 #include "../animdecide.qh"
18 vector animfixfps(entity e, vector a, vector b);
21 // special spawn flags
22 const int MONSTER_RESPAWN_DEATHPOINT = 16; // re-spawn where we died
23 const int MONSTER_TYPE_FLY = 32;
24 const int MONSTER_TYPE_SWIM = 64;
25 const int MONSTER_SIZE_BROKEN = 128; // TODO: remove when bad models are replaced
26 const int MON_FLAG_SUPERMONSTER = 256; // incredibly powerful monster
27 const int MON_FLAG_RANGED = 512; // monster shoots projectiles
28 const int MON_FLAG_MELEE = 1024;
29 const int MON_FLAG_CRUSH = 2048; // monster can be stomped in special modes
30 const int MON_FLAG_RIDE = 4096; // monster can be ridden in special modes
31 const int MONSTER_SIZE_QUAKE = 8192;
33 // entity properties of monsterinfo:
34 .bool(int, entity actor, entity targ) monster_attackfunc;
37 .vector anim_blockend;
38 .vector anim_blockstart;
48 CLASS(Monster, Object)
49 ATTRIB(Monster, monsterid, int, 0)
51 ATTRIB(Monster, spawnflags, int, 0)
52 /** human readable name */
53 ATTRIB(Monster, monster_name, string, "Monster")
55 ATTRIB(Monster, netname, string, "")
57 ATTRIB(Monster, m_model, entity, NULL)
59 ATTRIB(Monster, mins, vector, '-0 -0 -0')
61 ATTRIB(Monster, maxs, vector, '0 0 0')
63 /** (SERVER) setup monster data */
64 METHOD(Monster, mr_setup, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
65 /** (SERVER) logic to run every frame */
66 METHOD(Monster, mr_think, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
67 /** (SERVER) called when monster dies */
68 METHOD(Monster, mr_death, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
69 /** (BOTH) precaches models/sounds used by this monster */
70 METHOD(Monster, mr_precache, bool(Monster this)) { TC(Monster, this); return false; }
71 /** (SERVER) called when monster is damaged */
72 METHOD(Monster, mr_pain, float(Monster this, entity actor, float damage_take, entity attacker, float deathtype)) { TC(Monster, this); return damage_take; }
73 /** (BOTH?) sets animations for monster */
74 METHOD(Monster, mr_anim, bool(Monster this, entity actor)) { TC(Monster, this); return false; }