This commit is contained in:
Mini-Chiss 2015-05-03 15:39:15 -05:00
parent a07132df49
commit 97a86fde90
2 changed files with 35 additions and 17 deletions

View File

@ -32,6 +32,8 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.block.Action;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockFromToEvent;
import org.bukkit.event.block.BlockIgniteEvent;
import org.bukkit.event.block.BlockIgniteEvent.IgniteCause;
import org.bukkit.event.block.BlockPistonExtendEvent;
import org.bukkit.event.block.BlockPistonRetractEvent;
import org.bukkit.event.block.BlockPlaceEvent;
@ -80,6 +82,7 @@ import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.events.PlayerPrepareTeleportEvent;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.build.gui.MobShop;
import nautilus.game.arcade.game.games.build.gui.OptionsShop;
@ -159,10 +162,13 @@ public class Build extends SoloGame
this.PrepareFreeze = false;
this.CreatureAllow = true;
this.WorldFireSpread = true;
_words = new String[]
{
"Rollercoaster", "Archery Range", "Pokemon", "Pirates", "Vikings", "Dinosaur", "Dragon", "Toilet", "Farm", "Tree House", "Snail", "Burger", "Cat", "Truck", "Bicycle", "Soda", "Music Instrument", "Squid", "Statue", "Cannon", "Catapult", "Sailing Boat", "Grim Reaper", "Star Wars", "Elephant", "Penguin", "Ninja", "Pot of Gold", "Shrek", "Fruit", "Breakfast", "Toaster", "Robot", "Camping", "Spaceship"
"Rollercoaster", "Archery Range", "Pokemon", "Pirates", "Vikings", "Dinosaur", "Dragon", "Toilet", "Farm", "Tree House", "Burger", "Cat", "Truck", "Bicycle", "Soda", "Music Instrument", "Statue", "Cannon", "Catapult", "Sailing Boat", "Grim Reaper", "Star Wars", "Elephant", "Penguin", "Ninja", "Pot of Gold", "Shrek", "Fruit", "Breakfast", "Toaster", "Robot", "Camping", "Rocket", "Aliens", "Shipwreck", "Cannibals", "Flying Creature", "Beach Creature", "Sea Creature",
};
_mobShop = new MobShop(getArcadeManager(), getArcadeManager().GetClients(), getArcadeManager().GetDonation());
@ -227,54 +233,54 @@ public class Build extends SoloGame
UtilTextMiddle.display(null, C.cYellow + "4 Minutes Remaining", 0, 60, 5);
_countdownTimerState++;
}
else if (_countdownTimerState == 0 && UtilTime.elapsed(GetStateTime(), 120000))
else if (_countdownTimerState == 1 && UtilTime.elapsed(GetStateTime(), 120000))
{
UtilTextMiddle.display(null, C.cYellow + "3 Minutes Remaining", 0, 60, 5);
_countdownTimerState++;
}
else if (_countdownTimerState == 0 && UtilTime.elapsed(GetStateTime(), 180000))
else if (_countdownTimerState == 2 && UtilTime.elapsed(GetStateTime(), 180000))
{
UtilTextMiddle.display(null, C.cYellow + "2 Minutes Remaining", 0, 60, 5);
_countdownTimerState++;
}
else if (_countdownTimerState == 0 && UtilTime.elapsed(GetStateTime(), 240000))
else if (_countdownTimerState == 3 && UtilTime.elapsed(GetStateTime(), 240000))
{
UtilTextMiddle.display(null, C.cYellow + "1 Minutes Remaining", 0, 60, 5);
UtilTextMiddle.display(null, C.cYellow + "1 Minute Remaining", 0, 60, 5);
_countdownTimerState++;
}
else if (_countdownTimerState == 0 && UtilTime.elapsed(GetStateTime(), 270000))
else if (_countdownTimerState == 4 && UtilTime.elapsed(GetStateTime(), 270000))
{
UtilTextMiddle.display(null, C.cYellow + "30 Seconds Remaining", 0, 60, 5);
_countdownTimerState++;
}
else if (_countdownTimerState == 0 && UtilTime.elapsed(GetStateTime(), 285000))
else if (_countdownTimerState == 5 && UtilTime.elapsed(GetStateTime(), 285000))
{
UtilTextMiddle.display(null, C.cYellow + "15 Seconds Remaining", 0, 60, 5);
_countdownTimerState++;
}
else if (_countdownTimerState == 0 && UtilTime.elapsed(GetStateTime(), 295000))
else if (_countdownTimerState == 6 && UtilTime.elapsed(GetStateTime(), 295000))
{
UtilTextMiddle.display(null, C.cYellow + "5 Seconds Remaining", 0, 60, 5);
_countdownTimerState++;
}
else if (_countdownTimerState == 0 && UtilTime.elapsed(GetStateTime(), 296000))
else if (_countdownTimerState == 7 && UtilTime.elapsed(GetStateTime(), 296000))
{
UtilTextMiddle.display(null, C.cYellow + "4 Seconds Remaining", 0, 60, 5);
_countdownTimerState++;
}
else if (_countdownTimerState == 0 && UtilTime.elapsed(GetStateTime(), 297000))
else if (_countdownTimerState == 8 && UtilTime.elapsed(GetStateTime(), 297000))
{
UtilTextMiddle.display(null, C.cYellow + "3 Seconds Remaining", 0, 60, 5);
_countdownTimerState++;
}
else if (_countdownTimerState == 0 && UtilTime.elapsed(GetStateTime(), 298000))
else if (_countdownTimerState == 9 && UtilTime.elapsed(GetStateTime(), 298000))
{
UtilTextMiddle.display(null, C.cYellow + "2 Seconds Remaining", 0, 60, 5);
_countdownTimerState++;
}
else if (_countdownTimerState == 0 && UtilTime.elapsed(GetStateTime(), 299000))
else if (_countdownTimerState == 10 && UtilTime.elapsed(GetStateTime(), 299000))
{
UtilTextMiddle.display(null, C.cYellow + "1 Seconds Remaining", 0, 60, 5);
UtilTextMiddle.display(null, C.cYellow + "1 Second Remaining", 0, 60, 5);
_countdownTimerState++;
}
@ -379,10 +385,10 @@ public class Build extends SoloGame
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(160, (byte)5, 1, C.Bold + "+3 " + C.cGreen + C.Bold + "Good"));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(160, (byte)3, 1, C.Bold + "+4 " + C.cAqua + C.Bold + "Amazing"));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(160, (byte)10, 1, C.Bold + "+5 " + C.cPurple + C.Bold + "WOW! EVERYTHING IS AWESOME!"));
}
}
//Text
UtilTextMiddle.display(null, C.cGreen + "Right-Click" + C.cYellow + " to Vote!", 0, 60, 5);
UtilTextMiddle.display(null, C.cYellow + "Click to Vote", 0, 60, 5);
_buildStateTime = System.currentTimeMillis();
}
@ -428,7 +434,6 @@ public class Build extends SoloGame
if (first)
{
teleportPlayers(data);
first = false;
}
@ -754,6 +759,9 @@ public class Build extends SoloGame
@EventHandler
public void itemDrop(PlayerDropItemEvent event)
{
if (_buildGameState != 0)
return;
BuildData data = _data.get(event.getPlayer());
if (data == null)
@ -768,6 +776,9 @@ public class Build extends SoloGame
@EventHandler
public void itemPickup(PlayerPickupItemEvent event)
{
if (_buildGameState != 0)
return;
event.setCancelled(true);
BuildData data = _data.get(event.getPlayer());
@ -963,6 +974,13 @@ public class Build extends SoloGame
data.removeEntity(event.getVehicle());
}
@EventHandler
public void fireAllow(BlockIgniteEvent event)
{
if (event.getCause() != IgniteCause.FLINT_AND_STEEL && event.getCause() != IgniteCause.FIREBALL)
event.setCancelled(true);
}
@Override
@EventHandler
public void ScoreboardUpdate(UpdateEvent event)

View File

@ -52,7 +52,7 @@ public class MiscManager implements Listener
//BoneMeal
if (event.getPlayer().getItemInHand().getType() == Material.INK_SACK && event.getPlayer().getItemInHand().getData().getData() == (byte)15)
{
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && Manager.GetGame().GetType() != GameType.UHC)
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && Manager.GetGame().GetType() != GameType.UHC && Manager.GetGame().GetType() != GameType.Build)
event.setCancelled(true);
}
else if (Manager.GetGame().GetState() != GameState.Live)