#include "sv_invasion.qh"
+#include <common/mapobjects/triggers.qh>
#include <common/monsters/sv_spawn.qh>
#include <common/monsters/sv_spawner.qh>
#include <common/monsters/sv_monsters.qh>
+#include <server/bot/api.qh>
+#include <server/world.qh>
#include <server/teamplay.qh>
IntrusiveList g_invasion_roundends;
{
if(!g_invasion) { delete(this); return; }
- this.classname = "invasion_spawnpoint";
IL_PUSH(g_invasion_spawns, this);
}
setsize(e, mon.m_mins, mon.m_maxs);
if(MoveToRandomMapLocation(e, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, 10, 1024, 256))
- monster = spawnmonster(e, tospawn, mon.monsterid, NULL, NULL, e.origin, false, false, 2);
+ monster = spawnmonster(e, tospawn, mon, NULL, NULL, e.origin, false, false, 2);
else
{
delete(e);
}
}
else // if spawnmob field falls through (unset), fallback to mon (relying on spawnmonster for that behaviour)
- monster = spawnmonster(spawn(), ((spawn_point.spawnmob && spawn_point.spawnmob != "") ? spawn_point.spawnmob : tospawn), mon.monsterid, spawn_point, spawn_point, spawn_point.origin, false, false, 2);
+ monster = spawnmonster(spawn(), ((spawn_point.spawnmob && spawn_point.spawnmob != "") ? spawn_point.spawnmob : tospawn), mon, spawn_point, spawn_point, spawn_point.origin, false, false, 2);
if(!monster)
return;
float total_alive_monsters = 0, supermonster_count = 0, red_alive = 0, blue_alive = 0, yellow_alive = 0, pink_alive = 0;
- IL_EACH(g_monsters, GetResourceAmount(it, RESOURCE_HEALTH) > 0,
+ IL_EACH(g_monsters, GetResource(it, RES_HEALTH) > 0,
{
- if((get_monsterinfo(it.monsterid)).spawnflags & MON_FLAG_SUPERMONSTER)
+ if(it.monsterdef.spawnflags & MON_FLAG_SUPERMONSTER)
++supermonster_count;
++total_alive_monsters;
{
if(red_alive > 0) { winner_team = NUM_TEAM_1; }
if(blue_alive > 0)
- if(winner_team) { winner_team = 0; }
- else { winner_team = NUM_TEAM_2; }
+ {
+ if(winner_team) { winner_team = 0; }
+ else { winner_team = NUM_TEAM_2; }
+ }
if(yellow_alive > 0)
- if(winner_team) { winner_team = 0; }
- else { winner_team = NUM_TEAM_3; }
+ {
+ if(winner_team) { winner_team = 0; }
+ else { winner_team = NUM_TEAM_3; }
+ }
if(pink_alive > 0)
- if(winner_team) { winner_team = 0; }
- else { winner_team = NUM_TEAM_4; }
+ {
+ if(winner_team) { winner_team = 0; }
+ else { winner_team = NUM_TEAM_4; }
+ }
}
else
{
if(teamplay) { inv_monsters_perteam[frag_target.team] -= 1; }
if(IS_PLAYER(frag_attacker))
- if(SAME_TEAM(frag_attacker, frag_target)) // in non-teamplay modes, same team = same player, so this works
- GameRules_scoring_add(frag_attacker, KILLS, -1);
- else
{
- GameRules_scoring_add(frag_attacker, KILLS, +1);
- if(teamplay)
- TeamScore_AddToTeam(frag_attacker.team, ST_INV_KILLS, +1);
+ if(SAME_TEAM(frag_attacker, frag_target)) // in non-teamplay modes, same team = same player, so this works
+ GameRules_scoring_add(frag_attacker, KILLS, -1);
+ else
+ {
+ GameRules_scoring_add(frag_attacker, KILLS, +1);
+ if(teamplay)
+ TeamScore_AddToTeam(frag_attacker.team, ST_INV_KILLS, +1);
+ }
}
}
}
mon.monster_skill = inv_monsterskill;
- if((get_monsterinfo(mon.monsterid)).spawnflags & MON_FLAG_SUPERMONSTER)
+ if(mon.monsterdef.spawnflags & MON_FLAG_SUPERMONSTER)
Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_INVASION_SUPERMONSTER, mon.monster_name);
}