BH updates

This commit is contained in:
Chiss 2013-11-16 17:53:42 +11:00
parent d71a8002d3
commit b8e1c22967
4 changed files with 64 additions and 4 deletions

View File

@ -121,6 +121,7 @@ public class HideSeek extends TeamGame
C.cRed + "Seekers" + C.cWhite + " Find and kill the Hiders!", C.cRed + "Seekers" + C.cWhite + " Find and kill the Hiders!",
}); });
this.DamageSelf = false;
this.DeathOut = false; this.DeathOut = false;
this.InventoryOpen = false; this.InventoryOpen = false;
this.HungerSet = 20; this.HungerSet = 20;
@ -764,6 +765,21 @@ public class HideSeek extends TeamGame
this.AddGems(player, 4, "Fireworks", true); this.AddGems(player, 4, "Fireworks", true);
} }
@EventHandler
public void HiderTimeGems(UpdateEvent event)
{
if (GetState() != GameState.Live)
return;
if (event.getType() != UpdateType.SEC)
return;
for (Player player : _hiders.GetPlayers(true))
{
this.AddGems(player, 5d/60d, "Seconds Alive", true);
}
}
@EventHandler @EventHandler
public void UpdateSeekers(UpdateEvent event) public void UpdateSeekers(UpdateEvent event)
{ {
@ -876,6 +892,8 @@ public class HideSeek extends TeamGame
Announce(C.cAqua + C.Bold + "Hiders have 20 Seconds to hide!"); Announce(C.cAqua + C.Bold + "Hiders have 20 Seconds to hide!");
} }
@EventHandler @EventHandler
public void Timer(UpdateEvent event) public void Timer(UpdateEvent event)
{ {

View File

@ -7,6 +7,7 @@ import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.disguise.disguises.DisguiseCat;
import mineplex.core.disguise.disguises.DisguiseChicken; import mineplex.core.disguise.disguises.DisguiseChicken;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.recharge.Recharge; import mineplex.core.recharge.Recharge;

View File

@ -30,6 +30,7 @@ import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilTime.TimeUnit;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
@ -54,6 +55,8 @@ public class HungerGames extends SoloGame
private Location _spreadSafe = null; private Location _spreadSafe = null;
private HashMap<Player, Long> _redOutTime = new HashMap<Player, Long>(); private HashMap<Player, Long> _redOutTime = new HashMap<Player, Long>();
private long totalTime = 0;
public HungerGames(ArcadeManager manager) public HungerGames(ArcadeManager manager)
{ {
super(manager, GameType.HungerGames, super(manager, GameType.HungerGames,
@ -374,8 +377,15 @@ public class HungerGames extends SoloGame
if (!IsLive()) if (!IsLive())
return; return;
long time = System.currentTimeMillis();
if (_redLocations.isEmpty()) if (_redLocations.isEmpty())
{
if (UtilTime.elapsed(GetStateTime(), 6000))
SetState(GameState.End);
return; return;
}
int max = Math.max(5, Math.min(100, _redLocations.size()/100)); int max = Math.max(5, Math.min(100, _redLocations.size()/100));
@ -426,6 +436,26 @@ public class HungerGames extends SoloGame
RedSpread(block.getRelative(BlockFace.WEST).getRelative(BlockFace.DOWN)); RedSpread(block.getRelative(BlockFace.WEST).getRelative(BlockFace.DOWN));
} }
} }
totalTime += System.currentTimeMillis() - time;
}
@EventHandler
public void RedTimer(UpdateEvent event)
{
if (event.getType() != UpdateType.SEC)
return;
if (!IsLive())
return;
System.out.println(" ");
System.out.println("Game Time: " + UtilTime.MakeStr(System.currentTimeMillis() - this.GetStateTime()));
System.out.println("Creep Size: " + _redLocations.size());
System.out.println("Creep Time: " + UtilTime.convertString(totalTime, 4, TimeUnit.SECONDS));
totalTime = 0;
} }
public boolean RedSpread(Block block) public boolean RedSpread(Block block)
@ -666,4 +696,11 @@ public class HungerGames extends SoloGame
{ {
} }
//XXX REMOVE ME
@Override
public void EndCheck()
{
}
} }

View File

@ -99,7 +99,7 @@ public class GameManager implements Listener
//Stop Countdown! //Stop Countdown!
if (game.GetCountdown() != -1 && if (game.GetCountdown() != -1 &&
UtilServer.getPlayers().length < Manager.GetPlayerMin() && UtilServer.getPlayers().length < Manager.GetPlayerMin() &&
!game.GetCountdownForce()) !game.GetCountdownForce() && game.GetType() != GameType.HungerGames) //XXX REMOVE ME
{ {
game.SetCountdown(-1); game.SetCountdown(-1);
Manager.GetLobby().DisplayWaiting(); Manager.GetLobby().DisplayWaiting();
@ -107,7 +107,11 @@ public class GameManager implements Listener
if (game.GetCountdown() != -1) if (game.GetCountdown() != -1)
StateCountdown(game, -1, false); StateCountdown(game, -1, false);
else if (game.GetType() == GameType.HungerGames) //XXX REMOVE ME
{
StateCountdown(game, 1, false);
return;
}
else if (game.AutoStart) else if (game.AutoStart)
{ {
if (UtilServer.getPlayers().length >= Manager.GetPlayerFull()) if (UtilServer.getPlayers().length >= Manager.GetPlayerFull())
@ -124,7 +128,7 @@ public class GameManager implements Listener
for (Player player : UtilServer.getPlayers()) for (Player player : UtilServer.getPlayers())
player.playSound(player.getLocation(), Sound.NOTE_PLING, 2f, 2f); player.playSound(player.getLocation(), Sound.NOTE_PLING, 2f, 2f);
if (game.GetPlayers(true).size() < 2) if (game.GetPlayers(true).size() < 2 && false) // XXX REMOVE FALSE
{ {
game.Announce(C.cWhite + C.Bold + game.GetName() + " ended, not enough players!"); game.Announce(C.cWhite + C.Bold + game.GetName() + " ended, not enough players!");
game.SetState(GameState.Dead); game.SetState(GameState.Dead);