From 86322122975687e2a40594c4eb3f144d793943f7 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 23 Oct 2017 18:38:15 +0100 Subject: [PATCH] Achievement Base --- .../core/achievement/Achievement.java | 6 ++++ .../core/achievement/AchievementCategory.java | 14 ++++++++- .../games/cakewars/kits/KitCakeBuilder.java | 2 +- .../kits/perk/PerkPassiveWoolGain.java | 4 ++- .../games/cakewars/ui/CakeResourcePage.java | 30 +++++++++++++++++++ 5 files changed, 53 insertions(+), 3 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java index 01bbd2dec..1c4690608 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java @@ -1375,6 +1375,12 @@ public enum Achievement "I", new String[] {"II","III","IV","V","X"}, AchievementCategory.MOBA), + + CAKE_WARS_KILLS("Cake Slayer", 5000, + new String[]{"Cake Wars.Kills"}, + new String[]{"+1 for each kill"}, + new int[]{50,100,200,400,1000}, + AchievementCategory.CAKE_WARS), ; private String _name; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java index 8be52d0f1..7053ef6d1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java @@ -242,7 +242,19 @@ public enum AchievementCategory MOBA("Heroes of GWEN", null, new StatDisplay[] {StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED, null, StatDisplay.fromGame("Gold Earned", GameDisplay.MOBA, "GoldEarned")}, - Material.PRISMARINE_SHARD, 0, GameCategory.CLASSICS, null, false, GameDisplay.MOBA.getGameId()); + Material.PRISMARINE_SHARD, 0, GameCategory.CLASSICS, null, false, GameDisplay.MOBA.getGameId()), + + CAKE_WARS("Cake Wars", null, + new StatDisplay[] + { + StatDisplay.WINS, + StatDisplay.GAMES_PLAYED, + null, + StatDisplay.KILLS, + StatDisplay.DEATHS, + StatDisplay.GEMS_EARNED, + }, + Material.CAKE, 0, GameCategory.ARCADE, 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/kits/KitCakeBuilder.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/kits/KitCakeBuilder.java index 9a86ccf76..b0b4a3a76 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/kits/KitCakeBuilder.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/kits/KitCakeBuilder.java @@ -20,7 +20,7 @@ public class KitCakeBuilder extends ProgressingKit { "Get extra blocks to build with!", "", - "Receive " + C.cGreen + "1" + C.cWhite + " wool block every " + C.cGreen + "4" + C.cWhite + " seconds", + receiveItem("Wool Block", 1, 4, 32), }; private static final Perk[] PERKS = diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/kits/perk/PerkPassiveWoolGain.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/kits/perk/PerkPassiveWoolGain.java index 3d97fcf36..be1c6bc3c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/kits/perk/PerkPassiveWoolGain.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/kits/perk/PerkPassiveWoolGain.java @@ -5,6 +5,8 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.inventory.ItemStack; +import mineplex.core.common.util.UtilInv; +import mineplex.core.common.util.UtilItem; import mineplex.core.common.util.UtilPlayer; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; @@ -29,7 +31,7 @@ public class PerkPassiveWoolGain extends Perk for (Player player : Manager.GetGame().GetPlayers(true)) { - if (UtilPlayer.isSpectator(player) || !hasPerk(player)) + if (UtilPlayer.isSpectator(player) || !hasPerk(player) || player.getInventory().contains(Material.WOOL, 32)) { continue; } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/ui/CakeResourcePage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/ui/CakeResourcePage.java index ff5779e06..6f7f2e15e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/ui/CakeResourcePage.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/ui/CakeResourcePage.java @@ -7,11 +7,13 @@ import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.PlayerInventory; import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilItem; +import mineplex.core.common.util.UtilItem.ItemCategory; import mineplex.core.itemstack.ItemBuilder; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.recharge.Recharge; @@ -30,6 +32,12 @@ public class CakeResourcePage extends ShopPageBase