-void spawnfunc_invasion_spawnpoint()
+#include "gamemode_invasion.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
+#include "../../common/monsters/spawn.qh"
+#include "../../common/monsters/sv_monsters.qh"
+
+spawnfunc(invasion_spawnpoint)
{
if(!g_invasion) { remove(self); return; }
float invasion_PickMonster(float supermonster_count)
{
if(autocvar_g_invasion_zombies_only)
- return MON_ZOMBIE;
+ return MON_ZOMBIE.monsterid;
float i;
entity 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);
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);
}
FOR_EACH_MONSTER(head)
- monster_remove(head);
+ Monster_Remove(head);
if(teamplay)
{
}
MUTATOR_HOOKFUNCTION(invasion_MonsterDies)
-{
+{SELFPARAM();
if(!(self.spawnflags & MONSTERFLAG_RESPAWNED))
{
inv_numkilled += 1;
}
MUTATOR_HOOKFUNCTION(invasion_MonsterSpawn)
-{
+{SELFPARAM();
if(!(self.spawnflags & MONSTERFLAG_SPAWNED))
return true;
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;
}
MUTATOR_HOOKFUNCTION(invasion_OnEntityPreSpawn)
-{
+{SELFPARAM();
if(startsWith(self.classname, "monster_"))
if(!(self.spawnflags & MONSTERFLAG_SPAWNED))
return true;
}
MUTATOR_HOOKFUNCTION(invasion_PlayerSpawn)
-{
+{SELFPARAM();
self.bot_attack = false;
return false;
}
}
MUTATOR_HOOKFUNCTION(invasion_PlayerCommand)
-{
+{SELFPARAM();
if(MUTATOR_RETURNVALUE) // command was already handled?
return false;
MUTATOR_HOOKFUNCTION(invasion_BotShouldAttack)
{
- if(!(checkentity.flags & FL_MONSTER))
+ if(!IS_MONSTER(checkentity))
return true;
return false;
MUTATOR_HOOKFUNCTION(invasion_AccuracyTargetValid)
{
- if(frag_target.flags & FL_MONSTER)
+ if(IS_MONSTER(frag_target))
return MUT_ACCADD_INVALID;
return MUT_ACCADD_INDIFFERENT;
}
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;
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;
}