remove(self);
return;
}
- self.team = COLOR_TEAM1; // red, gets swapped every round
+ self.team = FL_TEAM_1; // red, gets swapped every round
spawnfunc_info_player_deathmatch();
}
remove(self);
return;
}
- self.team = COLOR_TEAM2; // blue, gets swapped every round
+ self.team = FL_TEAM_2; // blue, gets swapped every round
spawnfunc_info_player_deathmatch();
}
self = oldself;
}
+vector target_objective_spawn_evalfunc(entity player, entity spot, vector current)
+{
+ if(self.health < 0 || self.health >= ASSAULT_VALUE_INACTIVE)
+ return '-1 0 0';
+ return current;
+}
+
void spawnfunc_target_objective() {
if(!g_assault)
{
self.use = assault_objective_use;
assault_objective_reset();
self.reset = assault_objective_reset;
+ self.spawn_evalfunc = target_objective_spawn_evalfunc;
}
centerprint(player, s);
}
}
-
+
oldactivator = activator;
activator = oldself;
SUB_UseTargets();
void assault_setenemytoobjective()
{
- local entity objective;
+ entity objective;
for(objective = world; (objective = find(objective, targetname, self.target)); ) {
if(objective.classname == "target_objective") {
if(self.enemy == world)
ent.sprite = world;
}
- spr = WaypointSprite_SpawnFixed("<placeholder>", 0.5 * (ent.absmin + ent.absmax), ent, assault_sprite);
+ spr = WaypointSprite_SpawnFixed("<placeholder>", 0.5 * (ent.absmin + ent.absmax), ent, assault_sprite, RADARICON_OBJECTIVE, '1 0.5 0');
spr.assault_decreaser = self;
spr.waypointsprite_visible_for_player = assault_decreaser_sprite_visible;
spr.classname = "sprite_waypoint";
}
else
WaypointSprite_UpdateSprites(spr, "as-defend", "as-push", "as-push");
- WaypointSprite_UpdateTeamRadar(spr, RADARICON_OBJECTIVE, '1 0.5 0');
}
}
return;
}
self.spawnflags = 3;
- if(assault_attacker_team == COLOR_TEAM1) {
- self.team = COLOR_TEAM2;
+ self.classname = "func_assault_destructible";
+ if(assault_attacker_team == FL_TEAM_1) {
+ self.team = FL_TEAM_2;
} else {
- self.team = COLOR_TEAM1;
+ self.team = FL_TEAM_1;
}
spawnfunc_func_breakable();
}
activator = self;
SUB_UseTargets();
-
+
#ifdef TTURRETS_ENABLED
entity ent, oldself;
ent = find(world, classname, "turret_main");
while(ent) {
// Swap turret teams
- if(ent.team == COLOR_TEAM1)
- ent.team = COLOR_TEAM2;
+ if(ent.team == FL_TEAM_1)
+ ent.team = FL_TEAM_2;
else
- ent.team = COLOR_TEAM1;
+ ent.team = FL_TEAM_1;
self = ent;
remove(self);
return;
}
- assault_attacker_team = COLOR_TEAM1;
+ assault_attacker_team = FL_TEAM_1;
self.classname = "target_assault_roundstart";
self.use = assault_roundstart_use;
self.reset2 = assault_roundstart_use;
// trigger new round
// reset objectives, toggle spawnpoints, reset triggers, ...
-void assault_new_round() {
+void vehicles_clearrturn();
+void vehicles_spawn();
+void assault_new_round()
+{
+ entity oldself;
//bprint("ASSAULT: new round\n");
+ oldself = self;
+ // Eject players from vehicles
+ FOR_EACH_PLAYER(self)
+ {
+ if(self.vehicle)
+ vehicles_exit(VHEF_RELESE);
+ }
+
+ self = findchainflags(vehicle_flags, VHF_ISVEHICLE);
+ while(self)
+ {
+ vehicles_clearrturn();
+ vehicles_spawn();
+ self = self.chain;
+ }
+
+ self = oldself;
+
// up round counter
self.winning = self.winning + 1;
// swap attacker/defender roles
- if(assault_attacker_team == COLOR_TEAM1) {
- assault_attacker_team = COLOR_TEAM2;
+ if(assault_attacker_team == FL_TEAM_1) {
+ assault_attacker_team = FL_TEAM_2;
} else {
- assault_attacker_team = COLOR_TEAM1;
+ assault_attacker_team = FL_TEAM_1;
}
- local entity ent;
+ entity ent;
for(ent = world; (ent = nextent(ent)); )
{
if(clienttype(ent) == CLIENTTYPE_NOTACLIENT)
{
- if(ent.team_saved == COLOR_TEAM1)
- ent.team_saved = COLOR_TEAM2;
- else if(ent.team_saved == COLOR_TEAM2)
- ent.team_saved = COLOR_TEAM1;
+ if(ent.team_saved == FL_TEAM_1)
+ ent.team_saved = FL_TEAM_2;
+ else if(ent.team_saved == FL_TEAM_2)
+ ent.team_saved = FL_TEAM_1;
}
}
// reset the level with a countdown
cvar_set("timelimit", ftos(ceil(time - game_starttime) / 60));
- ReadyRestartForce(); // sets game_starttime
+ ReadyRestart_force(); // sets game_starttime
}