]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/arena.qc
YAY found a way to block player movement, but still allow him to be pushed around
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / arena.qc
index 046743151dbc02fd27dbd706a77d8065418397b6..dbd7e964b1b00b2425238467dc23313a11e26498 100644 (file)
@@ -39,6 +39,10 @@ void reset_map(float dorespawn)
                warmup = time + cvar("g_ca_warmup");
                allowed_to_spawn = 1;
        }
+       else if(g_freezetag)
+       {
+               warmup = time + cvar("g_freezetag_warmup");
+       }
 
        lms_lowest_lives = 999;
        lms_next_place = player_count;
@@ -92,6 +96,11 @@ void reset_map(float dorespawn)
                                self.classname = "player";
                                PutClientInServer();
                        }
+                       else if(g_freezetag)
+                       {
+                               if(self.classname == "player")
+                                       PutClientInServer();
+                       }
                        else
                        {
                                /*
@@ -192,7 +201,7 @@ void Arena_Warmup()
        float f;
        string msg;
 
-       if((!g_arena && !g_ca) || (g_arena && !arena_roundbased) || (time < game_starttime))
+       if((!g_arena && !g_ca && !g_freezetag) || (g_arena && !arena_roundbased) || (time < game_starttime))
                return;
 
        f = ceil(warmup - time);
@@ -256,14 +265,14 @@ void Arena_Warmup()
                }
        }
 
-       if(self.classname == "player" && self.health > 0)
+       if(self.classname == "player" && self.health > 0 && self.movetype == MOVETYPE_NONE)
                self.movetype = MOVETYPE_WALK;
 }
 
 float next_round;
 float stopalivecheck;
-float redalive, bluealive;
-.float redalive_stat, bluealive_stat;
+float redalive, bluealive, yellowalive, pinkalive;
+.float redalive_stat, bluealive_stat, yellowalive_stat, pinkalive_stat;
 /**
  * This function finds out whether an arena round is over 1 player is left.
  * It determines the last player who's still alive and saves it's entity reference
@@ -289,6 +298,22 @@ void Spawnqueue_Check()
                        self.bluealive_stat = bluealive;
                }
        }
+       else if(g_freezetag)
+       {
+               redalive = 0; bluealive = 0;
+               FOR_EACH_PLAYER(self) {
+                       if (self.team == COLOR_TEAM1 && self.freezetag_frozen == 0 && self.health >= 1) redalive += 1;
+                       else if (self.team == COLOR_TEAM2 && self.freezetag_frozen == 0 && self.health >= 1) bluealive += 1;
+                       else if (self.team == COLOR_TEAM3 && self.freezetag_frozen == 0 && self.health >= 1) yellowalive += 1;
+                       else if (self.team == COLOR_TEAM4 && self.freezetag_frozen == 0 && self.health >= 1) pinkalive += 1;
+               }
+               FOR_EACH_PLAYER(self) {
+                       self.redalive_stat = redalive;
+                       self.bluealive_stat = bluealive;
+                       self.yellowalive_stat = yellowalive;
+                       self.pinkalive_stat = pinkalive;
+               }
+       }
        if(time < warmup + 1 || inWarmupStage)
                return;
 
@@ -348,6 +373,12 @@ void Spawnqueue_Check()
                        next_round = 0;
                        reset_map(TRUE);
                }
+       } else if(g_freezetag) {
+               if((next_round && next_round < time))
+               {
+                       next_round = 0;
+                       reset_map(TRUE);
+               }
        } else { // arena
                //extend next_round if it isn't set yet and only 1 player is spawned
                if(!next_round)