]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/monsters/monster.qh
Type check class methods
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / monster.qh
index 0a78b7772292bbb884b9fce938b6a5b384375c0c..f1a5ee3d46f473a558e67f4ac1ec7beb67789707 100644 (file)
@@ -1,6 +1,17 @@
 #ifndef MONSTER_H
 #define MONSTER_H
 
+#ifdef SVQC
+#include "sv_monsters.qh"
+#include <server/g_damage.qh>
+#include <server/bot/bot.qh>
+#include <server/weapons/common.qh>
+#include <server/weapons/tracing.qh>
+#include <server/weapons/weaponsystem.qh>
+#include <common/mutators/mutator/waypoints/waypointsprites.qh>
+#include <lib/warpzone/server.qh>
+#endif
+
 // special spawn flags
 const int MONSTER_RESPAWN_DEATHPOINT = 16; // re-spawn where we died
 const int MONSTER_TYPE_FLY = 32;
@@ -11,9 +22,10 @@ const int MON_FLAG_RANGED = 512; // monster shoots projectiles
 const int MON_FLAG_MELEE = 1024;
 const int MON_FLAG_CRUSH = 2048; // monster can be stomped in special modes
 const int MON_FLAG_RIDE = 4096; // monster can be ridden in special modes
+const int MONSTER_SIZE_QUAKE = 8192;
 
 // entity properties of monsterinfo:
-.bool(int, entity targ) monster_attackfunc;
+.bool(int, entity actor, entity targ) monster_attackfunc;
 
 // animations
 .vector anim_blockend;
@@ -42,19 +54,19 @@ CLASS(Monster, Object)
     ATTRIB(Monster, mins, vector, '-0 -0 -0')
     /** hitbox size */
     ATTRIB(Monster, maxs, vector, '0 0 0')
-    
+
     /** (SERVER) setup monster data */
-    METHOD(Monster, mr_setup, bool(Monster this)) { return false; }
+    METHOD(Monster, mr_setup, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
     /** (SERVER) logic to run every frame */
-    METHOD(Monster, mr_think, bool(Monster this)) { return false; }
+    METHOD(Monster, mr_think, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
     /** (SERVER) called when monster dies */
-    METHOD(Monster, mr_death, bool(Monster this)) { return false; }
+    METHOD(Monster, mr_death, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
     /** (BOTH) precaches models/sounds used by this monster */
-    METHOD(Monster, mr_precache, bool(Monster this)) { return false; }
+    METHOD(Monster, mr_precache, bool(Monster this)) { TC(Monster, this); return false; }
     /** (SERVER) called when monster is damaged */
-    METHOD(Monster, mr_pain, bool(Monster this)) { return false; }
+    METHOD(Monster, mr_pain, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
     /** (BOTH?) sets animations for monster */
-    METHOD(Monster, mr_anim, bool(Monster this)) { return false; }
+    METHOD(Monster, mr_anim, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
 
 ENDCLASS(Monster)