From a6d7cccbe5a64850797c7fea5bbe495e52a6fc2b Mon Sep 17 00:00:00 2001 From: Mysticate Date: Wed, 30 Sep 2015 22:31:03 -0400 Subject: [PATCH] Fixes --- .../core/achievement/Achievement.java | 2 +- .../arcade/game/games/monstermaze/Maze.java | 46 ++++++++++++++----- .../game/games/monstermaze/SafePad.java | 5 +- .../monstermaze/trackers/PilotTracker.java | 2 +- 4 files changed, 39 insertions(+), 16 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java index 07dab815f..0d2e2e0c4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java @@ -736,7 +736,7 @@ public enum Achievement MONSTER_MAZE_SURVIVAL("Die Already!", 1200, new String[]{"Monster Maze.ToughCompetition"}, - new String[]{"Survive past the 15th Safe Pad"}, + new String[]{"Survive past the 10th Safe Pad"}, new int[]{1}, AchievementCategory.MONSTER_MAZE), diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java index 4f551332b..2781adba7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/Maze.java @@ -141,12 +141,36 @@ public class Maze implements Listener return _curSafe; } - public boolean isOnPad(Player player) + public boolean isOnPad(Player player, boolean checkNotActive ) { if (_safePad == null) return false; - return _safePad.isOn(player); + if (_safePad.isOn(player)) + return true; + + if (checkNotActive) + { + for (SafePad pad : _oldSafePads) + { + if (pad.isOn(player)) + { + return true; + } + } + + if (_nextSafePad != null) + { + if (_nextSafePad.isOn(player)) + { + return true; + } + } + + return false; + } + + return false; } @EventHandler @@ -252,8 +276,8 @@ public class Maze implements Listener } return; } - - float percentage = (float) Math.min(Math.max(_phaseTimer / 15, 0), 1); + + float percentage = (float) Math.min(Math.max(_phaseTimer / Math.max(6, 16 - (_curSafe - 1)), 0), 1); for (Player p : _host.GetPlayers(true)) { p.setExp(percentage); @@ -297,7 +321,7 @@ public class Maze implements Listener if (!Recharge.Instance.usable(player, "Monster Hit")) continue; - if (isOnPad(player)) + if (isOnPad(player, true)) continue; //Hit Snowman @@ -893,33 +917,33 @@ public class Maze implements Listener _phaseTimer--; if(_phaseTimer == 20) // only gets to this by running out of time naturally, not by player { - UtilTextMiddle.display("", C.cGreen + C.Bold + (int) _phaseTimer, 5, 40, 5, _host.GetPlayers(true).toArray(new Player[_host.GetPlayers(true).size()])); + UtilTextMiddle.display("", C.cGreen + C.Bold + (int) _phaseTimer, 5, 40, 5); } if(_phaseTimer == 15 || _phaseTimer == 10) { - UtilTextMiddle.display("", C.cGreen + C.Bold + (int) _phaseTimer, 5, 40, 5, _host.GetPlayers(true).toArray(new Player[_host.GetPlayers(true).size()])); + UtilTextMiddle.display("", C.cGreen + C.Bold + (int) _phaseTimer, 5, 40, 5); } if(_phaseTimer == 5 || _phaseTimer == 4) { - UtilTextMiddle.display("", C.cGreen + C.Bold + (int) _phaseTimer, 5, 40, 5, _host.GetPlayers(true).toArray(new Player[_host.GetPlayers(true).size()])); + UtilTextMiddle.display("", C.cGreen + C.Bold + (int) _phaseTimer, 5, 40, 5); } if(_phaseTimer == 3) { - UtilTextMiddle.display("", C.cYellow + C.Bold + (int) _phaseTimer, 5, 40, 5, _host.GetPlayers(true).toArray(new Player[_host.GetPlayers(true).size()])); + UtilTextMiddle.display("", C.cYellow + C.Bold + (int) _phaseTimer, 5, 40, 5); } if(_phaseTimer == 2) { - UtilTextMiddle.display("", C.cGold + C.Bold + (int) _phaseTimer, 5, 40, 5, _host.GetPlayers(true).toArray(new Player[_host.GetPlayers(true).size()])); + UtilTextMiddle.display("", C.cGold + C.Bold + (int) _phaseTimer, 5, 40, 5); spawnSafePad(); } if(_phaseTimer == 1) { - UtilTextMiddle.display("", C.cRed + C.Bold + (int) _phaseTimer, 5, 40, 5, _host.GetPlayers(true).toArray(new Player[_host.GetPlayers(true).size()])); + UtilTextMiddle.display("", C.cRed + C.Bold + (int) _phaseTimer, 5, 40, 5); } if(_phaseTimer == 0) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/SafePad.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/SafePad.java index eb0a6b4e0..5c95ebd37 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/SafePad.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/SafePad.java @@ -12,7 +12,6 @@ import mineplex.core.common.util.UtilPlayer; import net.minecraft.server.v1_7_R4.Packet; import net.minecraft.server.v1_7_R4.PacketPlayOutBlockBreakAnimation; -import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.Entity; @@ -138,14 +137,14 @@ public class SafePad public void build() { MapUtil.QuickChangeBlockAt(_loc, _tempMat.getId(), _tempData); - _loc.getWorld().playEffect(_loc, Effect.STEP_SOUND, _loc.getBlock().getTypeId()); +// _loc.getWorld().playEffect(_loc, Effect.STEP_SOUND, _loc.getBlock().getTypeId()); } @SuppressWarnings("deprecation") public void restore() { MapUtil.QuickChangeBlockAt(_loc, _origM.getId(), _origD); - _loc.getWorld().playEffect(_loc, Effect.STEP_SOUND, _loc.getBlock().getTypeId()); +// _loc.getWorld().playEffect(_loc, Effect.STEP_SOUND, _loc.getBlock().getTypeId()); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/trackers/PilotTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/trackers/PilotTracker.java index 3889590db..1e665963a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/trackers/PilotTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/trackers/PilotTracker.java @@ -71,7 +71,7 @@ public class PilotTracker extends StatTracker { _launched.remove(player); - if (getGame().getMaze().isOnPad(player)) + if (getGame().getMaze().isOnPad(player, false)) { addStat(player); }