diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java index cf3b57fd3..c3dfc56f5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java @@ -324,9 +324,27 @@ public enum Achievement SKYWARS_ZOMBIE_KILLS("Left For Dead",1000, new String[]{"SkyWars.ZombieKills"}, - new String[]{"Kill 500 Zombies"}, - new int[]{500}, - AchievementCategory.SKYWARS), + new String[]{"Kill 100 Zombie Guardians"}, + new int[]{100}, + AchievementCategory.SKYWARS), + + SKYWARS_PLAYER_KILLS("War Machine",500, + new String[]{"SkyWars.Kills"}, + new String[]{"Kill a total of 250 players"}, + new int[]{250}, + AchievementCategory.SKYWARS), + + SKYWARS_NOCHEST("Survivalist",500, + new String[] {"SkyWars.NoChest"}, + new String[] {"Win a game without opening any chests"}, + new int[] {1}, + AchievementCategory.SKYWARS), + + SKYWARS_NOARMOR("Bare Minimum",750, + new String[] {"SkyWars.NoArmor"}, + new String[] {"Win a game without wearing any armor"}, + new int[] {1}, + AchievementCategory.SKYWARS), //Sheep Quest SHEEP_QUEST_WINS("Hungry Hungry Hippo", 600, diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/ui/page/AchievementMainPage.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/ui/page/AchievementMainPage.java index eaf02d841..4030c76e1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/ui/page/AchievementMainPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/ui/page/AchievementMainPage.java @@ -44,9 +44,9 @@ public class AchievementMainPage extends ShopPageBase mobIterator = this._mobs.iterator(); - while (mobIterator.hasNext()) - { - Creature mob = (Creature) mobIterator.next(); - if (!mob.isValid()) - { - mob.remove(); - mobIterator.remove(); - } - } + for (Location loc : this.WorldData.GetDataLocs("RED")) { if (this._mobs.size() < 15) @@ -188,18 +186,22 @@ public class SkyWars extends SoloGame zombie.setRemoveWhenFarAway(false); zombie.setCustomName(C.cDRed + "Zombie Guardian"); zombie.setCustomNameVisible(true); - zombie.setMaxHealth(25.0D); + zombie.setMaxHealth(20.0D); + UtilEnt.ghost(zombie, true, false); // Armor - Make sure the player can't get it! zombie.getEquipment().setHelmet( new ItemStack(Material.GOLD_HELMET)); zombie.getEquipment().setHelmetDropChance(0F); + zombie.getEquipment().setChestplate( new ItemStack(Material.GOLD_CHESTPLATE)); zombie.getEquipment().setChestplateDropChance(0F); + zombie.getEquipment().setLeggings( new ItemStack(Material.GOLD_LEGGINGS)); zombie.getEquipment().setLeggingsDropChance(0F); + zombie.getEquipment().setBoots( new ItemStack(Material.GOLD_BOOTS)); zombie.getEquipment().setBootsDropChance(0F); @@ -211,13 +213,12 @@ public class SkyWars extends SoloGame // Store which chests are closest to which spawn NautHashMap> islandChests = new NautHashMap>(); - // Allocate chests to their nearest spawn point for (Location chestLoc : WorldData.GetDataLocs("BROWN")) { // Gets the spawn point closest to the current chest - + Location closestSpawn = UtilAlg.findClosest(chestLoc, GetTeam(ChatColor.GREEN).GetSpawns()); @@ -237,7 +238,7 @@ public class SkyWars extends SoloGame { Location chest = UtilAlg.Random(chests); chests.remove(chest); - } + } } for (Location loc : chests) @@ -379,6 +380,9 @@ public class SkyWars extends SoloGame { fillChest(event.getPlayer(), block); } + + Bukkit.getPluginManager().callEvent(new PlayerOpenChestEvent(event.getPlayer())); + } @EventHandler @@ -459,7 +463,6 @@ public class SkyWars extends SoloGame this._tnt.Update(); } - @EventHandler public void noZombieBurn(EntityCombustEvent e) { @@ -497,15 +500,14 @@ public class SkyWars extends SoloGame event.setCancelled(true); } - - @EventHandler - public void onBlockPlaceAdd(BlockPlaceEvent e) { + public void onBlockPlaceAdd(BlockPlaceEvent e) + { Block block = e.getBlock(); - + _worldBlocks.add(block); } - + @EventHandler public void PlayerKillAward(CombatDeathEvent event) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/data/TNTGenerator.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/data/TNTGenerator.java index 3930cfe24..1c98f4812 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/data/TNTGenerator.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/data/TNTGenerator.java @@ -114,9 +114,9 @@ public class TNTGenerator Material.TNT, (byte) 0, 1, - F.item(C.cYellow + C.Bold + "Left Click - Far " + F.item(C.cYellow + C.Bold + "Left Click -"+C.cRed+" Far " + C.cWhite + "/" + C.cYellow + C.Bold - + " Right Click - Short"))); + + " Right Click - "+C.cRed+"Short"))); player.playSound(player.getLocation(), Sound.ENDERDRAGON_HIT, 3F, 1F); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/events/PlayerOpenChestEvent.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/events/PlayerOpenChestEvent.java new file mode 100644 index 000000000..b562ead73 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/events/PlayerOpenChestEvent.java @@ -0,0 +1,36 @@ +package nautilus.game.arcade.game.games.skywars.events; + +import org.bukkit.entity.Player; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + +public class PlayerOpenChestEvent extends Event +{ + + private static final HandlerList handlers = new HandlerList(); + + private Player _who; + + public PlayerOpenChestEvent(Player who) + { + this._who = who; + } + + public static HandlerList getHandlerList() + { + return handlers; + } + + @Override + public HandlerList getHandlers() + { + return getHandlerList(); + } + + public Player getPlayer() { + + return _who; + + } + +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/SkyWarsKillZombieStatTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/SkyWarsKillZombieStatTracker.java index 2cfb37d3d..ace285689 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/SkyWarsKillZombieStatTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/SkyWarsKillZombieStatTracker.java @@ -1,12 +1,13 @@ package nautilus.game.arcade.stats; +import nautilus.game.arcade.game.Game; +import nautilus.game.arcade.game.games.skywars.events.PlayerKillZombieEvent; + +import org.bukkit.entity.Player; +import org.bukkit.entity.Zombie; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; -import nautilus.game.arcade.game.Game; -import nautilus.game.arcade.game.games.sheep.SheepGame; -import nautilus.game.arcade.game.games.skywars.events.PlayerKillZombieEvent; - public class SkyWarsKillZombieStatTracker extends StatTracker { @@ -16,12 +17,22 @@ public class SkyWarsKillZombieStatTracker extends StatTracker } @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) - public void onSheepStolen(PlayerKillZombieEvent event) + public void onKillZombie(PlayerKillZombieEvent event) { if (getGame().GetState() != Game.GameState.Live) return; + if (!(event.getWho() instanceof Player)) + { + return; + } + + if (!(event.getZombie() instanceof Zombie)) + { + return; + } + addStat(event.getWho(), "ZombieKills", 1, false, false); } - + } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/SkyWarsTNTKillStatTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/SkyWarsTNTKillStatTracker.java index f7e8ea4d2..11c9cfe92 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/SkyWarsTNTKillStatTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/SkyWarsTNTKillStatTracker.java @@ -3,6 +3,7 @@ package nautilus.game.arcade.stats; import nautilus.game.arcade.game.Game; import nautilus.game.arcade.game.games.skywars.events.TNTKillEvent; +import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -20,7 +21,17 @@ public class SkyWarsTNTKillStatTracker extends StatTracker if (getGame().GetState() != Game.GameState.Live) return; + if (!(event.getKiller() instanceof Player)) + { + return; + } + + if (!(event.getVictim() instanceof Player)) + { + return; + } + addStat(event.getKiller(), "BombKills", 1, false, false); } - + } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinWithoutOpeningChestStatTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinWithoutOpeningChestStatTracker.java new file mode 100644 index 000000000..5edf4036b --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinWithoutOpeningChestStatTracker.java @@ -0,0 +1,55 @@ +package nautilus.game.arcade.stats; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.UUID; + +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.game.Game; +import nautilus.game.arcade.game.games.skywars.events.PlayerOpenChestEvent; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; + +public class WinWithoutOpeningChestStatTracker extends StatTracker +{ + + private final Set _openChest = new HashSet<>(); + + public WinWithoutOpeningChestStatTracker(Game game) + { + super(game); + } + + + @EventHandler + public void onOpenChest(PlayerOpenChestEvent e) { + + Player player = e.getPlayer(); + UUID uuid = player.getUniqueId(); + + _openChest.add(uuid); + + } + + @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) + public void onGameStateChange(GameStateChangeEvent event) + { + if (event.GetState() == Game.GameState.End) + { + List winners = getGame().getWinners(); + + if (winners != null) + { + for (Player winner : winners) + { + if (!_openChest.contains(winner.getUniqueId())) + addStat(winner, "NoChest", 1, true, false); + } + } + } + } + +}