}
monster = spawnmonster("", mon, spawn_point, spawn_point, spawn_point.origin, FALSE, 2);
+
+ if(roundcnt >= maxrounds)
+ monster.spawnflags |= MONSTERFLAG_MINIBOSS;
}
void invasion_SpawnMonsters(float supermonster_count)
return 1;
}
- float total_alive_monsters = 0, supermonster_count = 0;
-
- FOR_EACH_MONSTER(head) if(head.health > 0)
+ // boss round
+ if(roundcnt >= maxrounds)
{
- if((get_monsterinfo(head.monsterid)).spawnflags & MON_FLAG_SUPERMONSTER)
- ++supermonster_count;
- ++total_alive_monsters;
+ if(numspawned < 1)
+ {
+ maxspawned = 1;
+ invasion_SpawnMonsters(0);
+ }
}
-
- if((total_alive_monsters + numkilled) < maxspawned && maxcurrent < 10) // 10 at a time should be plenty
+ else
{
- if(time >= last_check)
+ float total_alive_monsters = 0, supermonster_count = 0;
+
+ FOR_EACH_MONSTER(head) if(head.health > 0)
{
- invasion_SpawnMonsters(supermonster_count);
- last_check = time + 2;
+ if((get_monsterinfo(head.monsterid)).spawnflags & MON_FLAG_SUPERMONSTER)
+ ++supermonster_count;
+ ++total_alive_monsters;
+ }
+
+ if((total_alive_monsters + numkilled) < maxspawned && maxcurrent < 10) // 10 at a time should be plenty
+ {
+ if(time >= last_check)
+ {
+ invasion_SpawnMonsters(supermonster_count);
+ last_check = time + 2;
+ }
+
+ return 0;
}
-
- return 0;
}
if(numspawned < 1 || numkilled < maxspawned)
MUTATOR_HOOKFUNCTION(invasion_MonsterDies)
{
- numkilled += 1;
- maxcurrent -= 1;
+ if not(self.monster_respawned)
+ {
+ numkilled += 1;
+ maxcurrent -= 1;
- if(IS_PLAYER(frag_attacker))
- PlayerScore_Add(frag_attacker, SP_KILLS, +1);
+ if(IS_PLAYER(frag_attacker))
+ PlayerScore_Add(frag_attacker, SP_KILLS, +1);
+ }
return FALSE;
}
MUTATOR_HOOKFUNCTION(invasion_MonsterSpawn)
{
- if(self.realowner == world)
+ if not(self.spawnflags & MONSTERFLAG_SPAWNED)
{
if(self.weaponentity) remove(self.weaponentity);
if(self.iceblock) remove(self.iceblock);
return FALSE;
}
- numspawned += 1;
- maxcurrent += 1;
+ if(roundcnt < maxrounds && self.spawnflags & MONSTERFLAG_MINIBOSS)
+ self.spawnflags &= ~MONSTERFLAG_MINIBOSS;
+
+ if not(self.monster_respawned)
+ {
+ numspawned += 1;
+ maxcurrent += 1;
+ }
self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_BOTCLIP | DPCONTENTS_MONSTERCLIP;