]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/gamemode_invasion.qc
Merge branch 'master' into Mario/vaporizer_damage
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_invasion.qc
index fe0d0a7ecc4094048a9a7b878e2428a0ad258523..c4750d98228fc6279e3bfa2bbe5f2ba9c83ca0bf 100644 (file)
@@ -1,3 +1,11 @@
+#include "gamemode_invasion.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
+#include "../../common/monsters/spawn.qh"
+#include "../../common/monsters/sv_monsters.qh"
+
 void spawnfunc_invasion_spawnpoint()
 {
        if(!g_invasion) { remove(self); return; }
@@ -12,7 +20,7 @@ void spawnfunc_invasion_spawnpoint()
 float invasion_PickMonster(float supermonster_count)
 {
        if(autocvar_g_invasion_zombies_only)
-               return MON_ZOMBIE;
+               return MON_ZOMBIE.monsterid;
 
        float i;
        entity mon;
@@ -54,7 +62,7 @@ void invasion_SpawnChosenMonster(float mon)
 
        if(spawn_point == world)
        {
-               dprint("Warning: couldn't find any invasion_spawnpoint spawnpoints, attempting to spawn monsters in random locations\n");
+               LOG_TRACE("Warning: couldn't find any invasion_spawnpoint spawnpoints, attempting to spawn monsters in random locations\n");
                entity e = spawn();
                setsize(e, (get_monsterinfo(mon)).mins, (get_monsterinfo(mon)).maxs);
 
@@ -118,7 +126,7 @@ float Invasion_CheckWinner()
        if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0)
        {
                FOR_EACH_MONSTER(head)
-                       monster_remove(head);
+                       Monster_Remove(head);
 
                Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER);
                Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_OVER);
@@ -195,7 +203,7 @@ float Invasion_CheckWinner()
        }
 
        FOR_EACH_MONSTER(head)
-               monster_remove(head);
+               Monster_Remove(head);
 
        if(teamplay)
        {
@@ -288,7 +296,7 @@ MUTATOR_HOOKFUNCTION(invasion_MonsterSpawn)
        self.monster_skill = inv_monsterskill;
 
        if((get_monsterinfo(self.monsterid)).spawnflags & MON_FLAG_SUPERMONSTER)
-               Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_INVASION_SUPERMONSTER, M_NAME(self.monsterid));
+               Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_INVASION_SUPERMONSTER, self.monster_name);
 
        self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_BOTCLIP | DPCONTENTS_MONSTERCLIP;
 
@@ -358,7 +366,7 @@ MUTATOR_HOOKFUNCTION(invasion_PlayerCommand)
 
 MUTATOR_HOOKFUNCTION(invasion_BotShouldAttack)
 {
-       if(!(checkentity.flags & FL_MONSTER))
+       if(!IS_MONSTER(checkentity))
                return true;
 
        return false;
@@ -374,7 +382,7 @@ MUTATOR_HOOKFUNCTION(invasion_SetStartItems)
 
 MUTATOR_HOOKFUNCTION(invasion_AccuracyTargetValid)
 {
-       if(frag_target.flags & FL_MONSTER)
+       if(IS_MONSTER(frag_target))
                return MUT_ACCADD_INVALID;
        return MUT_ACCADD_INDIFFERENT;
 }
@@ -423,7 +431,7 @@ void invasion_DelayedInit() // Do this check with a delay so we can wait for tea
 void invasion_Initialize()
 {
        if(autocvar_g_invasion_zombies_only)
-               MON_ACTION(MON_ZOMBIE, MR_PRECACHE);
+               MON_ACTION(MON_ZOMBIE.monsterid, MR_PRECACHE);
        else
        {
                float i;
@@ -475,7 +483,7 @@ MUTATOR_DEFINITION(gamemode_invasion)
 
        MUTATOR_ONREMOVE
        {
-               print("This is a game type and it cannot be removed at runtime.");
+               LOG_INFO("This is a game type and it cannot be removed at runtime.");
                return -1;
        }