end game fixes

This commit is contained in:
Chiss 2014-07-26 20:53:48 +10:00
parent 4f46ccc8aa
commit f090ed9313

View File

@ -130,7 +130,7 @@ public class Bridge extends TeamGame implements OreObsfucation
_ore = new OreHider();
// Flags
GameTimeout = Manager.IsTournamentServer() ? 120000 : 3600000; //5400000
GameTimeout = Manager.IsTournamentServer() ? 5400000 : 3600000;
DamageSelf = true;
@ -645,6 +645,9 @@ public class Bridge extends TeamGame implements OreObsfucation
if (!UtilTime.elapsed(this.GetStateTime(), _bridgeTime))
return;
if (!_bridgesDown)
this.Announce(C.cRed + C.Bold + "ALERT: " + ChatColor.RESET + C.Bold + "THE BRIDGES ARE SPAWNING!");
_bridgesDown = true;
@ -1159,7 +1162,7 @@ public class Bridge extends TeamGame implements OreObsfucation
else
{
Scoreboard.Write(C.cYellow + C.Bold + "Time Left");
Scoreboard.Write(UtilTime.MakeStr(5400000 - this.GetStateTime(), 0));
Scoreboard.Write(UtilTime.MakeStr(5400000 - (System.currentTimeMillis() - this.GetStateTime()), 0));
}
Scoreboard.Draw();
@ -1270,6 +1273,7 @@ public class Bridge extends TeamGame implements OreObsfucation
}
}
@Override
public void HandleTimeout()
{
if (!_tournament)
@ -1277,7 +1281,7 @@ public class Bridge extends TeamGame implements OreObsfucation
SetState(GameState.End);
return;
}
ArrayList<GameTeam> bestTeams = new ArrayList<GameTeam>();
int bestKills = 0;
@ -1302,19 +1306,19 @@ public class Bridge extends TeamGame implements OreObsfucation
}
//Many Teams Alive
if (bestTeams.size() > 1)
if (bestTeams.size() != 1)
{
if (UtilTime.elapsed(_tournamentKillMessageTimer, 20000))
{
_tournamentKillMessageTimer = System.currentTimeMillis();
this.Announce(C.cRed + C.Bold + "ALERT: " + ChatColor.RESET + C.Bold + "FIRST TEAM TO TAKE THE LEAD WINS!");
this.Announce(C.cRed + C.Bold + "ALERT: " + ChatColor.RESET + C.Bold + "FIRST TEAM TO HAVE MOST KILLS WINS!");
}
}
//Team Won
else if (bestTeams.size() == 1)
{
else
{
AnnounceEnd(bestTeams.get(0));
for (GameTeam team : GetTeamList())
@ -1333,11 +1337,5 @@ public class Bridge extends TeamGame implements OreObsfucation
//End
SetState(GameState.End);
}
//No One Wins :'(
else
{
SetState(GameState.End);
}
}
}