diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java index 1c4690608..6e4163c90 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java @@ -1376,10 +1376,46 @@ public enum Achievement new String[] {"II","III","IV","V","X"}, AchievementCategory.MOBA), - CAKE_WARS_KILLS("Cake Slayer", 5000, + CAKE_WARS_WIN("Cake Dinners", 0, + new String[]{"Cake Wars.Wins"}, + new String[]{"+1 for each Win"}, + new int[][] {new int[] {500,0,500}, new int[] {500,0,500}, new int[]{1000,0,1000}, new int[]{1000,0,1000}, new int[]{1000,0,1000}, new int[]{2500,0,2500}, new int[]{5000,0,5000}}, + new int[]{1,5,10,25,50,75,100}, + "I", + new String[] {"II","III","IV","V","VI","VII","VIII","Complete"}, + AchievementCategory.CAKE_WARS), + + CAKE_WARS_KILLS("Cake Slayer", 0, new String[]{"Cake Wars.Kills"}, - new String[]{"+1 for each kill"}, - new int[]{50,100,200,400,1000}, + new String[]{"+1 for each Kill"}, + new int[][] {new int[] {500,0,500}, new int[] {500,0,500}, new int[]{1000,0,1000}, new int[]{1000,0,1000}, new int[]{1000,0,1000}, new int[]{2500,0,2500}, new int[]{5000,0,5000}}, + new int[]{10,50,100,250,500,750,1000}, + "I", + new String[] {"II","III","IV","V","VI","VII","VIII","Complete"}, + AchievementCategory.CAKE_WARS), + + CAKE_WARS_BITES("Big Appetite", 0, + new String[]{"Cake Wars.Bites"}, + new String[]{"+1 for each Cake Bite"}, + new int[][] {new int[] {500,0,500}, new int[] {500,0,500}, new int[]{1000,0,1000}, new int[]{1000,0,1000}, new int[]{1000,0,1000}, new int[]{2500,0,2500}, new int[]{5000,0,5000}}, + new int[]{5,25,50,125,250,375,500}, + "I", + new String[] {"II","III","IV","V","VI","VII","VIII","Complete"}, + AchievementCategory.CAKE_WARS), + + CAKE_WARS_CHESTS("Loot Fanatic", 0, + new String[]{"Cake Wars.ChestsOpened"}, + new String[]{"+1 for each Floating Island", "chest opened"}, + new int[][] {new int[] {500,0,500}, new int[] {500,0,500}, new int[]{1000,0,1000}, new int[]{1000,0,1000}, new int[]{1000,0,1000}, new int[]{2500,0,2500}, new int[]{5000,0,5000}}, + new int[]{5,25,50,125,250,375,500}, + "I", + new String[] {"II","III","IV","V","VI","VII","VIII","Complete"}, + AchievementCategory.CAKE_WARS), + + CAKE_WARS_GET_GOOD("Get Good", 0, + new String[]{"Cake Wars.GetGood"}, + new String[]{"Kill a player while falling", "from a great height.", "Then save yourself from dieing."}, + new int[]{1}, AchievementCategory.CAKE_WARS), ; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java index 7053ef6d1..59d888862 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java @@ -254,7 +254,7 @@ public enum AchievementCategory StatDisplay.DEATHS, StatDisplay.GEMS_EARNED, }, - Material.CAKE, 0, GameCategory.ARCADE, null, false, GameDisplay.CakeWars.getGameId()); + Material.CAKE, 0, GameCategory.CLASSICS, null, false, GameDisplay.CakeWars.getGameId()); private String _name; private String[] _statsToPull; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/CakeWars.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/CakeWars.java index 411dbba16..9540c56bc 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/CakeWars.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/CakeWars.java @@ -36,6 +36,7 @@ import nautilus.game.arcade.game.games.cakewars.module.CakePointModule; import nautilus.game.arcade.game.games.cakewars.module.CakeShopModule; import nautilus.game.arcade.game.games.cakewars.module.CakeSpawnerModule; import nautilus.game.arcade.game.games.cakewars.module.CakeTeamModule; +import nautilus.game.arcade.game.games.cakewars.trackers.GetGoodStatTracker; import nautilus.game.arcade.game.modules.CustomScoreboardModule; import nautilus.game.arcade.game.modules.EnderPearlModule; import nautilus.game.arcade.game.modules.capturepoint.CapturePointModule; @@ -106,6 +107,10 @@ public class CakeWars extends TeamGame GameTimeout = TimeUnit.HOURS.toMillis(1); _help = TIPS; + registerStatTrackers( + new GetGoodStatTracker(this) + ); + manager.GetCreature().SetDisableCustomDrops(true); new AbsorptionFix(this); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/module/CakeTeamModule.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/module/CakeTeamModule.java index dc304bda3..35fa76932 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/module/CakeTeamModule.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/module/CakeTeamModule.java @@ -222,6 +222,7 @@ public class CakeTeamModule extends CakeModule }); _game.AddGems(player, 4, "Cake Bites", true, true); + _game.AddStat(player, "Bites", 1, false, false); byte data = block.getData(); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/trackers/GetGoodStatTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/trackers/GetGoodStatTracker.java new file mode 100644 index 000000000..30cf222c2 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/trackers/GetGoodStatTracker.java @@ -0,0 +1,43 @@ +package nautilus.game.arcade.game.games.cakewars.trackers; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.entity.PlayerDeathEvent; + +import mineplex.core.common.util.UtilPlayer; + +import nautilus.game.arcade.game.Game; +import nautilus.game.arcade.stats.StatTracker; + +public class GetGoodStatTracker extends StatTracker +{ + + private static final int MIN_FALL_DISTANCE = 10; + + public GetGoodStatTracker(Game game) + { + super(game); + } + + @EventHandler + public void onPlayerDeath(PlayerDeathEvent event) + { + Player player = event.getEntity(); + Player killer = player.getKiller(); + + if (killer == null || killer.getFallDistance() < MIN_FALL_DISTANCE) + { + return; + } + + getGame().getArcadeManager().runSyncLater(() -> + { + if (!player.isOnline() || UtilPlayer.isSpectator(killer)) + { + return; + } + + getGame().AddStat(player, "GetGood", 1, false, false); + }, 60); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/modules/chest/ChestLootModule.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/modules/chest/ChestLootModule.java index 05c309d65..09a1a2aa5 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/modules/chest/ChestLootModule.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/modules/chest/ChestLootModule.java @@ -18,6 +18,7 @@ import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.block.Chest; +import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerInteractEvent; @@ -198,6 +199,9 @@ public class ChestLootModule extends Module return; } + Player player = event.getPlayer(); + getGame().AddStat(player, "ChestsOpened", 1, false, false); + metadata.Opened = true; metadata.OpenedAt = System.currentTimeMillis(); metadata.populateChest((Chest) block.getState());