Guardian is impressed (untested!)

This commit is contained in:
Shaun Bennett 2016-01-22 18:35:18 -05:00
parent 3f715ab4dd
commit d0e5be9c93

View File

@ -129,6 +129,7 @@ public class SpeedBuilders extends SoloGame
private long _reviewStartTime;
private NautHashMap<Player, Long> _perfectBuild = new NautHashMap<Player, Long>();
private boolean _allPerfect;
private Location _lookTarget;
private ArmorStand _lookStand;
@ -616,11 +617,20 @@ public class SpeedBuilders extends SoloGame
player.playSound(player.getEyeLocation(), Sound.LEVEL_UP, 10F, 1F);
UtilTextMiddle.display("", C.cGreen + "Perfect Match", 0, 30, 10, player);
Announce(F.main("Build", F.name(player.getName()) + " got a perfect build!"));
_perfectBuild.put(player, System.currentTimeMillis());
if (_perfectBuild.size() == GetTeamList().get(0).GetPlayers(false).size())
{
// Everyone has a perfect build
_allPerfect = true;
}
else
{
// Don't display middle text if everyone now has a perfect build
UtilTextMiddle.display("", C.cGreen + "Perfect Match", 0, 30, 10, player);
}
}
}
}, 1L);
@ -744,7 +754,7 @@ public class SpeedBuilders extends SoloGame
}
else if (_state == SpeedBuildersState.BUILDING)
{
if (UtilTime.elapsed(_stateTime, _buildTime * 1000))
if (UtilTime.elapsed(_stateTime, _buildTime * 1000) || _allPerfect)
{
for (RecreationData recreation : _buildRecreations.values())
{
@ -760,18 +770,26 @@ public class SpeedBuilders extends SoloGame
//Sometimes it stops on 0.1 and has one bar green
UtilTextBottom.displayProgress("Time Left:", 0, UtilTime.MakeStr(0), UtilServer.getPlayers());
//Sometimes doesn't show in the update method
UtilTextMiddle.display("", C.cRed + "TIME'S UP!", 0, 30, 10);
Manager.runSyncLater(new Runnable()
if (_allPerfect)
{
@Override
public void run()
UtilTextMiddle.display("", C.cAqua + GUARDIAN_NAME + " is Impressed!", 0, 30, 10);
_allPerfect = false;
}
else
{
//Sometimes doesn't show in the update method
UtilTextMiddle.display("", C.cRed + "TIME'S UP!", 0, 30, 10);
Manager.runSyncLater(new Runnable()
{
UtilTextMiddle.display("", C.cAqua + GUARDIAN_NAME + " is Judging", 0, 30, 10);
}
}, 40L);
@Override
public void run()
{
UtilTextMiddle.display("", C.cAqua + GUARDIAN_NAME + " is Judging", 0, 30, 10);
}
}, 40L);
}
for (Player player : UtilServer.getPlayers())
{