From f36d7774cc2ab3add45f4f67cf9f378068c7af34 Mon Sep 17 00:00:00 2001 From: Mini-Chiss Date: Sun, 3 May 2015 18:32:57 -0500 Subject: [PATCH 1/2] Gravity update --- .../game/arcade/game/games/build/Build.java | 2 +- .../arcade/game/games/gravity/Gravity.java | 28 +++++++++++++------ .../game/games/gravity/GravityObject.java | 12 ++++++-- .../games/gravity/objects/GravityDebris.java | 1 + .../games/gravity/objects/GravityPlayer.java | 13 ++++++--- 5 files changed, 41 insertions(+), 15 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java index 66c7c9a95..89c9fe45c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java @@ -90,7 +90,7 @@ import nautilus.game.arcade.game.games.build.gui.OptionsShop; import nautilus.game.arcade.game.games.draw.kits.*; import nautilus.game.arcade.kit.Kit; -public class Build extends SoloGame +public class Build extends SoloGame { private NautHashMap _data = new NautHashMap(); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gravity/Gravity.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gravity/Gravity.java index c9d1929e3..8de4e68fc 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gravity/Gravity.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gravity/Gravity.java @@ -5,6 +5,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; +import org.bukkit.Bukkit; import org.bukkit.Color; import org.bukkit.FireworkEffect; import org.bukkit.Location; @@ -41,6 +42,7 @@ import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilWorld; import mineplex.core.common.util.UtilParticle.ParticleType; @@ -95,7 +97,7 @@ public class Gravity extends SoloGame _help = new String[] { - "Push DROP to launch yourself off platforms.", + "Drop Item to launch yourself off platforms.", "You automatically grab onto nearby platforms.", "Hold Block to use your Jetpack", "Your Experience Bar is your Jetpack Fuel", @@ -137,10 +139,20 @@ public class Gravity extends SoloGame @EventHandler public void AnnounceBoost(GameStateChangeEvent event) { - if (event.GetState() != GameState.Live) - return; - - Announce(C.Bold + C.cPurple + "Press " + C.Bold + C.cWhite + "DROP WEAPON" + C.Bold + C.cPurple + " to boost yourself off platforms!"); + if (event.GetState() == GameState.Prepare) + { + UtilTextMiddle.display(null, C.cGreen + "Drop Weapon" + C.cWhite + " to boost off Platforms", 0, 120, 0); + + Bukkit.getScheduler().runTaskLater(Manager.getPlugin(), new Runnable() + { + @Override + public void run() + { + UtilTextMiddle.display(null, C.cGreen + "Hold Block" + C.cWhite + " to use Jetpack", 0, 80, 5); + } + }, 120); + } + } @EventHandler @@ -161,8 +173,7 @@ public class Gravity extends SoloGame if (!isInsideMap(o.Base.getLocation())) { - o.Base.remove(); - oIter.remove(); + o.remove(); } } @@ -698,7 +709,8 @@ public class Gravity extends SoloGame { if (UtilMath.offset(player.getLocation(), _powerup) < 3) { - UtilPlayer.message(player, F.main("Game", "You collected " + F.skill("Jetpack Fuel") + "!")); + UtilTextMiddle.display(null, "Collected Jetpack Fuel", 0, 80, 5, player); + player.setExp(Math.min(0.9999f, player.getExp() + 0.25f)); player.getWorld().playSound(player.getLocation(), Sound.DRINK, 1f, 0.5f); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gravity/GravityObject.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gravity/GravityObject.java index 1df5889d9..34c83e330 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gravity/GravityObject.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gravity/GravityObject.java @@ -90,8 +90,8 @@ public abstract class GravityObject { if (this instanceof GravityPlayer) { - Base.getWorld().playEffect(Ent.getLocation().subtract(0, 0.5, 0), Effect.FIREWORKS_SPARK, 0, 100); - //UtilParticle.PlayParticle(ParticleType.FIREWORKS_SPARK, Ent.getLocation().subtract(0, 0.5, 0), 0, 0, 0, 0, 1); + UtilParticle.PlayParticle(ParticleType.FIREWORKS_SPARK, Ent.getLocation().subtract(0, 0.5, 0), 0, 0, 0, 0, 1, + ViewDist.MAX, UtilServer.getPlayers()); } else if (this instanceof GravityBomb) { @@ -221,4 +221,12 @@ public abstract class GravityObject Bat.setSitting(!moving); //Host.Manager.GetDisguise().updateDisguise(Bat); } + + public void remove() + { + if (Base.getPassenger() != null) + Base.getPassenger().remove(); + + Base.remove(); + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gravity/objects/GravityDebris.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gravity/objects/GravityDebris.java index 674ac04fd..68cd2a333 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gravity/objects/GravityDebris.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gravity/objects/GravityDebris.java @@ -17,6 +17,7 @@ public class GravityDebris extends GravityObject super(host, ent, mass, 2, vel); CollideDelay = System.currentTimeMillis() + 500; + SetMovingBat(true); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gravity/objects/GravityPlayer.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gravity/objects/GravityPlayer.java index 98fc47ef3..f2d05569b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gravity/objects/GravityPlayer.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gravity/objects/GravityPlayer.java @@ -3,6 +3,7 @@ package nautilus.game.arcade.game.games.gravity.objects; import java.util.Collection; import java.util.HashSet; +import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilParticle; @@ -10,6 +11,7 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.recharge.Recharge; import nautilus.game.arcade.game.games.gravity.Gravity; @@ -140,7 +142,10 @@ public class GravityPlayer extends GravityObject if (player.getExp() <= 0) { if (Recharge.Instance.use(player, "Fuel", 1000, false, false)) - UtilPlayer.message(Ent, F.main("Skill", "You have no more " + F.skill("Jetpack Fuel") + ".")); + { + UtilTextMiddle.display(C.cRed + "Jetpack Empty", "Collect Fuel at Gold Blocks with Fireworks", 0, 80, 5, (Player)Ent); + } + return; } @@ -171,7 +176,8 @@ public class GravityPlayer extends GravityObject //Restore if (near) { - UtilPlayer.message(Ent, F.main("Game", "Restoring Oxygen...")); + UtilTextMiddle.display(null, "Refilling Oxygen...", 0, 60, 5, (Player)Ent); + Ent.getWorld().playSound(Ent.getLocation(), Sound.CAT_HISS, 0.2f, 0.5f); Base.setHealth(Math.min(60, Base.getHealth() + 10)); @@ -189,8 +195,7 @@ public class GravityPlayer extends GravityObject DamageCause.CUSTOM, 2, false, true, false, "Oxygen Depleted", "Oxygen Depleted"); - UtilPlayer.message(Ent, F.main("Game", "You are suffocating!")); - UtilPlayer.message(Ent, F.main("Game", "Get more Oxygen from the Emerald Blocks!")); + UtilTextMiddle.display(C.cRed + "Suffocating", "Refill Oxygen at Emerald Blocks", 0, 60, 5, (Player)Ent); } } From 1576085d8740f683c685e20129993b743d22a82b Mon Sep 17 00:00:00 2001 From: Mini-Chiss Date: Sun, 3 May 2015 18:33:31 -0500 Subject: [PATCH 2/2] more words --- .../src/nautilus/game/arcade/game/games/build/Build.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java index 5d2c937d2..15c49b1dd 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java @@ -168,7 +168,7 @@ public class Build extends SoloGame _words = new String[] { - "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", + "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", "Spongebob", "Car", "Pot Plant", "Weapons", "Christmas", "King", "Queen", "Angel", "Demon" };