self.classname = "invasion_spawnpoint";
}
-float invasion_PickMonster()
+float invasion_PickMonster(float supermonster_count)
{
if(autocvar_g_invasion_zombies_only)
- return MONSTER_ZOMBIE;
+ return MON_ZOMBIE;
float i;
+ entity mon;
RandomSelection_Init();
- for(i = MONSTER_FIRST + 1; i < MONSTER_LAST; ++i)
+ for(i = MON_FIRST; i <= MON_LAST; ++i)
{
- if(i == MONSTER_STINGRAY || i == MONSTER_WYVERN)
+ mon = get_monsterinfo(i);
+ if((mon.spawnflags & MONSTER_TYPE_FLY) || (mon.spawnflags & MONSTER_TYPE_SWIM) || (mon.spawnflags & MON_FLAG_SUPERMONSTER && supermonster_count >= 1))
continue; // flying/swimming monsters not yet supported
RandomSelection_Add(world, i, "", 1, 1);
monster = spawnmonster("", mon, spawn_point, spawn_point, spawn_point.origin, FALSE, 2);
}
-void invasion_SpawnMonsters()
+void invasion_SpawnMonsters(float supermonster_count)
{
- float chosen_monster = invasion_PickMonster();
+ float chosen_monster = invasion_PickMonster(supermonster_count);
invasion_SpawnChosenMonster(chosen_monster);
}
if(head.iceblock) remove(head.iceblock);
remove(head);
}
+
+ if(roundcnt >= maxrounds)
+ {
+ NextLevel();
+ return 1;
+ }
Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER);
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_OVER);
return 1;
}
- float total_alive_monsters = 0;
+ float total_alive_monsters = 0, supermonster_count = 0;
FOR_EACH_MONSTER(head) if(head.health > 0)
+ {
+ if((get_monsterinfo(head.monsterid)).spawnflags & MON_FLAG_SUPERMONSTER)
+ ++supermonster_count;
++total_alive_monsters;
+ }
- if((total_alive_monsters + numkilled) < maxspawned)
+ if((total_alive_monsters + numkilled) < maxspawned && maxcurrent < 10) // 10 at a time should be plenty
{
if(time >= last_check)
{
- invasion_SpawnMonsters();
+ invasion_SpawnMonsters(supermonster_count);
last_check = time + 2;
}
roundcnt += 1;
+ maxcurrent = 0;
numspawned = 0;
numkilled = 0;
MUTATOR_HOOKFUNCTION(invasion_MonsterDies)
{
numkilled += 1;
+ maxcurrent -= 1;
if(IS_PLAYER(frag_attacker))
PlayerScore_Add(frag_attacker, SP_KILLS, +1);
}
numspawned += 1;
+ maxcurrent += 1;
self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_BOTCLIP | DPCONTENTS_MONSTERCLIP;
return FALSE;
}
+MUTATOR_HOOKFUNCTION(invasion_SetStartItems)
+{
+ start_armorvalue = 100;
+
+ return FALSE;
+}
+
void invasion_ScoreRules()
{
ScoreRules_basics(0, 0, 0, FALSE);
MUTATOR_HOOK(PlayerSpawn, invasion_PlayerSpawn, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerDamage_Calculate, invasion_PlayerDamage, CBC_ORDER_ANY);
MUTATOR_HOOK(SV_ParseClientCommand, invasion_PlayerCommand, CBC_ORDER_ANY);
+ MUTATOR_HOOK(SetStartItems, invasion_SetStartItems, CBC_ORDER_ANY);
MUTATOR_ONADD
{