REGISTER_MONSTER(
/* MON_##id */ SHAMBLER,
/* function */ m_shambler,
-/* spawnflags */ MONSTER_SIZE_BROKEN,
+/* spawnflags */ MONSTER_SIZE_BROKEN | MON_FLAG_SUPERMONSTER,
/* mins,maxs */ '-41 -41 -31', '41 41 65',
/* model */ "shambler.mdl",
/* netname */ "shambler",
const float MONSTER_TYPE_FLY = 256;
const float MONSTER_TYPE_SWIM = 512;
const float MONSTER_SIZE_BROKEN = 1024; // TODO: remove when bad models are replaced
+const float MON_FLAG_SUPERMONSTER = 2048; // incredibly powerful monster
// entity properties of monsterinfo:
.float monsterid; // MON_...
self.classname = "invasion_spawnpoint";
}
-float invasion_PickMonster(float have_shamblers)
+float invasion_PickMonster(float supermonster_count)
{
if(autocvar_g_invasion_zombies_only)
return MON_ZOMBIE;
for(i = MON_FIRST; i <= MON_LAST; ++i)
{
mon = get_monsterinfo(i);
- if((mon.spawnflags & MONSTER_TYPE_FLY) || (mon.spawnflags & MONSTER_TYPE_SWIM) || (i == MON_SHAMBLER && have_shamblers >= 1))
+ 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(float have_shamblers)
+void invasion_SpawnMonsters(float supermonster_count)
{
- float chosen_monster = invasion_PickMonster(have_shamblers);
+ float chosen_monster = invasion_PickMonster(supermonster_count);
invasion_SpawnChosenMonster(chosen_monster);
}
return 1;
}
- float total_alive_monsters = 0, shamblers = 0;
+ float total_alive_monsters = 0, supermonster_count = 0;
FOR_EACH_MONSTER(head) if(head.health > 0)
{
- if(head.monsterid == MON_SHAMBLER)
- ++shamblers;
+ if((get_monsterinfo(head.monsterid)).spawnflags & MON_FLAG_SUPERMONSTER)
+ ++supermonster_count;
++total_alive_monsters;
}
{
if(time >= last_check)
{
- invasion_SpawnMonsters(shamblers);
+ invasion_SpawnMonsters(supermonster_count);
last_check = time + 2;
}