4 #include "sv_monsters.qh"
5 #include <server/g_damage.qh>
6 #include <server/bot/api.qh>
7 #include <server/weapons/common.qh>
8 #include <server/weapons/tracing.qh>
9 #include <server/weapons/weaponsystem.qh>
10 #include <common/mutators/mutator/waypoints/waypointsprites.qh>
11 #include <lib/warpzone/server.qh>
15 #include "../animdecide.qh"
17 vector animfixfps(entity e, vector a, vector b);
20 // special spawn flags
21 const int MONSTER_RESPAWN_DEATHPOINT = 16; // re-spawn where we died
22 const int MONSTER_TYPE_FLY = 32;
23 const int MONSTER_TYPE_SWIM = 64;
24 const int MONSTER_SIZE_BROKEN = 128; // TODO: remove when bad models are replaced
25 const int MON_FLAG_SUPERMONSTER = 256; // incredibly powerful monster
26 const int MON_FLAG_RANGED = 512; // monster shoots projectiles
27 const int MON_FLAG_MELEE = 1024;
28 const int MON_FLAG_CRUSH = 2048; // monster can be stomped in special modes
29 const int MON_FLAG_RIDE = 4096; // monster can be ridden in special modes
30 const int MONSTER_SIZE_QUAKE = 8192;
32 // entity properties of monsterinfo:
33 .bool(int, entity actor, entity targ) monster_attackfunc;
36 .vector anim_blockend;
37 .vector anim_blockstart;
47 CLASS(Monster, Object)
48 ATTRIB(Monster, monsterid, int, 0);
50 ATTRIB(Monster, spawnflags, int, 0);
51 /** human readable name */
52 ATTRIB(Monster, monster_name, string, "Monster");
54 ATTRIB(Monster, netname, string, "");
56 ATTRIB(Monster, m_model, entity);
58 ATTRIB(Monster, mins, vector, '-0 -0 -0');
60 ATTRIB(Monster, maxs, vector, '0 0 0');
62 /** (SERVER) setup monster data */
63 METHOD(Monster, mr_setup, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
64 /** (SERVER) logic to run every frame */
65 METHOD(Monster, mr_think, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
66 /** (SERVER) called when monster dies */
67 METHOD(Monster, mr_death, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
68 /** (BOTH) precaches models/sounds used by this monster */
69 METHOD(Monster, mr_precache, bool(Monster this)) { TC(Monster, this); return false; }
70 /** (SERVER) called when monster is damaged */
71 METHOD(Monster, mr_pain, float(Monster this, entity actor, float damage_take, entity attacker, float deathtype)) { TC(Monster, this); return damage_take; }
72 /** (BOTH?) sets animations for monster */
73 METHOD(Monster, mr_anim, bool(Monster this, entity actor)) { TC(Monster, this); return false; }