diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/addons/compass/CompassAddon.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/addons/compass/CompassAddon.java index 732df5661..eb003303f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/addons/compass/CompassAddon.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/addons/compass/CompassAddon.java @@ -99,7 +99,7 @@ public class CompassAddon extends MiniPlugin if (target != null) { - if (Manager.GetGame().CompassGiveItem || Manager.isSpectator(player)) + if (Manager.GetGame().CompassGiveItem || (Manager.GetGame().CompassGiveItemSpectators && Manager.isSpectator(player))) if (!player.getInventory().contains(Material.COMPASS)) { if (player.getOpenInventory() == null || player.getOpenInventory().getCursor() == null || player.getOpenInventory().getCursor().getType() != Material.COMPASS) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java index af6c71a69..c094769bb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java @@ -240,6 +240,7 @@ public abstract class Game implements Listener // Addons public boolean CompassEnabled = false; public boolean CompassGiveItem = true; + public boolean CompassGiveItemSpectators = true; public boolean SoupEnabled = true; public boolean TeamArmor = false; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/BawkBawkBattles.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/BawkBawkBattles.java index 2459db9e1..69fb0b72d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/BawkBawkBattles.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/BawkBawkBattles.java @@ -261,6 +261,7 @@ public class BawkBawkBattles extends TeamGame implements IThrown // TODO: Temporary CompassEnabled = false; CompassGiveItem = false; + CompassGiveItemSpectators = false; Manager.GetCreature().SetDisableCustomDrops(true); @@ -956,7 +957,7 @@ public class BawkBawkBattles extends TeamGame implements IThrown int lost = _challenge.getData().getLostPlayers().size(); int current = getPlayersAlive().size(); - return !_settings.isCrumbling() && lost > current / CRUMBLE_DIVIDER && lost != current; + return !_settings.isCrumbling() && lost > current / CRUMBLE_DIVIDER; } private void announceCrumbling() diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/Challenge.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/Challenge.java index 1fa99922d..384ab9280 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/Challenge.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/Challenge.java @@ -89,7 +89,7 @@ public abstract class Challenge implements Listener private static final double BLOCK_CENTER_ADD = 0.5; private static final int CRUMBLE_CHANCE = 4; - private static final int PLAYER_COUNT_FOR_EFFECTS = 2; + private static final int PLAYER_COUNT_FOR_GAME_END = 1; private static final int COMPLETION_TITLE_STAY_TICKS = 30; private static final float COMPLETION_SOUND_VOLUME = 2.0F; private static final float COMPLETION_SOUND_PITCH = 1.0F; @@ -385,7 +385,7 @@ public abstract class Challenge implements Listener { if (Data.isCompleted(player)) { - Host.AddGems(player, COMPLETION_GEMS, "Completed Challenge", true, true); + Host.AddGems(player, COMPLETION_GEMS, "Completed Challenges", true, true); } } @@ -479,7 +479,7 @@ public abstract class Challenge implements Listener if (Data.isDone(player)) return; - if (Host.getPlayersWithRemainingLives() >= PLAYER_COUNT_FOR_EFFECTS) // Check if the game is not about to end. + if (shouldShowEffects()) // Check if the game is not about to end. { if (cloak) { @@ -501,6 +501,25 @@ public abstract class Challenge implements Listener UtilInv.Clear(player); } + private boolean shouldShowEffects() + { + if (Host.getPlayersWithRemainingLives() == PLAYER_COUNT_FOR_GAME_END) + { + int playerOneLives = Host.lives(getPlayersAlive().get(0)); + int playerTwoLives = Host.lives(getPlayersAlive().get(1)); + + boolean playerOneCompleted = Data.isDone(getPlayersAlive().get(0)); + boolean playerTwoCompleted = Data.isDone(getPlayersAlive().get(1)); + + if (!playerOneCompleted && !playerTwoCompleted && (playerOneLives == 1 || playerTwoLives == 2)) + { + return false; + } + } + + return true; + } + protected void setCompleted(Player player) { setCompleted(player, false); @@ -514,18 +533,15 @@ public abstract class Challenge implements Listener Data.addLostPlayer(player); loseLife(player); - if (Host.getPlayersWithRemainingLives() >= PLAYER_COUNT_FOR_EFFECTS) // Check if the game is not about to end. + if (cloak) { - if (cloak) - { - cloak(player, false); - } - - UtilPlayer.message(player, F.main("Game", C.cRed + "You failed to complete the task.")); - Host.showLivesLeft(player); - player.playSound(player.getLocation(), Sound.NOTE_BASS, LOST_SOUND_VOLUME, LOST_SOUND_PITCH); + cloak(player, false); } + UtilPlayer.message(player, F.main("Game", C.cRed + "You failed to complete the task.")); + Host.showLivesLeft(player); + player.playSound(player.getLocation(), Sound.NOTE_BASS, LOST_SOUND_VOLUME, LOST_SOUND_PITCH); + Host.Manager.GetDisguise().undisguise(player); UtilPlayer.clearPotionEffects(player); UtilInv.Clear(player); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/ChallengeData.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/ChallengeData.java index 6c320174a..45fca3e1a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/ChallengeData.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/ChallengeData.java @@ -87,14 +87,9 @@ public class ChallengeData public void removePlayer(Player player) { - if (_lost.contains(player)) - _lost.remove(player); - - if (_completed.contains(player)) - _completed.remove(player); - - if (_invisible.contains(player)) - _invisible.remove(player); + _lost.remove(player); + _completed.remove(player); + _invisible.remove(player); } public boolean isCompleted(Player player) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeTreasureDigger.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeTreasureDigger.java index f22d7cf53..2290d7452 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeTreasureDigger.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeTreasureDigger.java @@ -65,7 +65,7 @@ public class ChallengeTreasureDigger extends Challenge "Find weapons to kill the others!"); Settings.setUseMapHeight(); - //Settings.setMinPlayers(CHALLENGE_PLAYERS_MIN); + Settings.setMinPlayers(CHALLENGE_PLAYERS_MIN); _lootChance.put(Material.BONE, 0.2); _lootChance.put(Material.STRING, 0.2);