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 3428a5941..252b7754d 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 @@ -482,12 +482,19 @@ public class BawkBawkBattles extends TeamGame implements IThrown private void removeSolidBlock(Location location) { Block block = location.getBlock(); + Block upper = block.getRelative(BlockFace.UP); if (!block.isEmpty() && _challenge.getData().isModifiedBlock(block)) { _challenge.resetBlock(block); _challenge.getData().removeModifiedBlock(block); } + + if (!upper.isEmpty() && _challenge.getData().isModifiedBlock(upper)) + { + _challenge.resetBlock(upper); + _challenge.getData().removeModifiedBlock(upper); + } } private void teamTeleport(boolean firstRun) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeZombieInfection.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeZombieInfection.java index aa835d19f..478bc1887 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeZombieInfection.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeZombieInfection.java @@ -37,6 +37,7 @@ import nautilus.game.arcade.game.games.mineware.challenge.other.ZombieWrapper; public class ChallengeZombieInfection extends Challenge { private ZombieWrapper _zombie; + private Set _infected = new HashSet<>(); // The default zombie speed. @@ -133,6 +134,12 @@ public class ChallengeZombieInfection extends Challenge _infected.clear(); } + @Override + protected boolean shouldDie(Player player) + { + return _infected.contains(player); + } + @EventHandler public void onUpdateZombie(UpdateEvent event) { @@ -200,7 +207,7 @@ public class ChallengeZombieInfection extends Challenge if (event.getType() != UpdateType.FASTER) return; - if (_infected.size() >= Math.floor(getPlayersAlive().size() / 2)) + if (_infected.size() >= Settings.getMaxCompletedCount()) { for (Player player : getPlayersAlive()) { @@ -231,12 +238,7 @@ public class ChallengeZombieInfection extends Challenge if (!isChallengeValid()) return; - Player player = event.getPlayer(); - - if (_infected.contains(player)) - { - _infected.remove(player); - } + _infected.remove(event.getPlayer()); } private void spawnZombie() @@ -270,6 +272,12 @@ public class ChallengeZombieInfection extends Challenge private void selectTarget() { Player target = UtilPlayer.getClosest(_zombie.getLocation(), (Entity) null); + + while (_infected.contains(target)) + { + target = UtilMath.randomElement(getPlayersAlive()); + } + _zombie.setTarget(target); _zombie.move(target); } @@ -310,7 +318,7 @@ public class ChallengeZombieInfection extends Challenge Host.WorldData.World.strikeLightningEffect(player.getLocation()); Host.getArcadeManager().GetDisguise().disguise(new DisguiseZombie(player)); - if (_infected.size() < Math.floor(getPlayersAlive().size() / 2)) + if (_infected.size() < Settings.getMaxCompletedCount()) // Check if the challenge is still running after the player is infected. { UtilPlayer.message(player, F.main("Game", "You have been infected, you now have to infect the rest.")); } @@ -319,15 +327,14 @@ public class ChallengeZombieInfection extends Challenge private void damage(Player player) { - if (player.getHealth() <= 5.0) + player.damage(5.0); + + if (player.isDead()) { - System.out.println("Infected"); infect(player); } else { - player.damage(5.0); - if (!player.hasPotionEffect(PotionEffectType.SLOW) && !player.hasPotionEffect(PotionEffectType.CONFUSION)) { player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 20, 1));