]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/gamemode_assault.qc
Tabs to spaces (to make merging a little less painful)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_assault.qc
index bf2594785cff6bbb9b70e426bbd79f23902fcf8d..fa12b8bdb3dd0624564faf2a9ecf5948e6fba55c 100644 (file)
@@ -63,20 +63,13 @@ void assault_objective_decrease_use()
                        PlayerTeamScore_Add(activator, SP_ASSAULT_OBJECTIVES, ST_ASSAULT_OBJECTIVES, 1);
                        self.enemy.health = -1;
 
-                       entity oldself, oldactivator;
+                       entity oldself, oldactivator, head;
 
                        oldself = self;
                        self = oldself.enemy;
                        if(self.message)
-                       {
-                               entity player;
-                               string s;
-                               FOR_EACH_PLAYER(player)
-                               {
-                                       s = strcat(self.message, "\n");
-                                       centerprint(player, s);
-                               }
-                       }
+                       FOR_EACH_PLAYER(head)
+                               centerprint(head, self.message);
 
                        oldactivator = activator;
                        activator = oldself;
@@ -178,10 +171,10 @@ void assault_roundstart_use()
        ent = find(world, classname, "turret_main");
        while(ent) {
                // Swap turret teams
-               if(ent.team == COLOR_TEAM1)
-                       ent.team = COLOR_TEAM2;
+               if(ent.team == NUM_TEAM_1)
+                       ent.team = NUM_TEAM_2;
                else
-                       ent.team = COLOR_TEAM1;
+                       ent.team = NUM_TEAM_1;
 
                self = ent;
 
@@ -241,20 +234,20 @@ void assault_new_round()
        self.winning = self.winning + 1;
 
        // swap attacker/defender roles
-       if(assault_attacker_team == COLOR_TEAM1)
-               assault_attacker_team = COLOR_TEAM2;
+       if(assault_attacker_team == NUM_TEAM_1)
+               assault_attacker_team = NUM_TEAM_2;
        else
-               assault_attacker_team = COLOR_TEAM1;
+               assault_attacker_team = NUM_TEAM_1;
 
        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 == NUM_TEAM_1)
+                               ent.team_saved = NUM_TEAM_2;
+                       else if(ent.team_saved == NUM_TEAM_2)
+                               ent.team_saved = NUM_TEAM_1;
                }
        }
 
@@ -268,7 +261,7 @@ void spawnfunc_info_player_attacker()
 {
        if not(g_assault) { remove(self); return; }
        
-       self.team = COLOR_TEAM1; // red, gets swapped every round
+       self.team = NUM_TEAM_1; // red, gets swapped every round
        spawnfunc_info_player_deathmatch();
 }
 
@@ -276,7 +269,7 @@ void spawnfunc_info_player_defender()
 {
        if not(g_assault) { remove(self); return; }
        
-       self.team = COLOR_TEAM2; // blue, gets swapped every round
+       self.team = NUM_TEAM_2; // blue, gets swapped every round
        spawnfunc_info_player_deathmatch();
 }
 
@@ -316,10 +309,10 @@ void spawnfunc_func_assault_destructible()
        self.spawnflags = 3;
        self.classname = "func_assault_destructible";
        
-       if(assault_attacker_team == COLOR_TEAM1)
-               self.team = COLOR_TEAM2;
+       if(assault_attacker_team == NUM_TEAM_1)
+               self.team = NUM_TEAM_2;
        else
-               self.team = COLOR_TEAM1;
+               self.team = NUM_TEAM_1;
 
        spawnfunc_func_breakable();
 }
@@ -352,7 +345,7 @@ void spawnfunc_target_assault_roundstart()
 {
        if not(g_assault) { remove(self); return; }
        
-       assault_attacker_team = COLOR_TEAM1;
+       assault_attacker_team = NUM_TEAM_1;
        self.classname = "target_assault_roundstart";
        self.use = assault_roundstart_use;
        self.reset2 = assault_roundstart_use;
@@ -546,9 +539,9 @@ void havocbot_ast_reset_role(entity bot)
 MUTATOR_HOOKFUNCTION(assault_PlayerSpawn)
 {
        if(self.team == assault_attacker_team)
-               centerprint(self, "You are attacking!");
+               Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_ASSAULT_ATTACKING);
        else
-               centerprint(self, "You are defending!");
+               Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_ASSAULT_DEFENDING);
                
        return FALSE;
 }