From 28fa092b20b6c2dee1ad1913cf836d6285c98213 Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 26 Mar 2017 13:39:12 +0100 Subject: [PATCH] Additional kit changes --- .../game/arcade/game/games/bridge/Bridge.java | 4 +-- .../game/games/bridge/kits/KitApple.java | 4 +-- .../game/games/bridge/kits/KitBerserker.java | 2 +- .../game/games/bridge/kits/KitBrawler.java | 8 ++--- .../bridge/modes/kits/KitBrawlAppler.java | 2 +- .../game/arcade/kit/perks/PerkApple.java | 32 +++++++++++++++++-- 6 files changed, 40 insertions(+), 12 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java index 2015d2b0e..c3793bb01 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java @@ -185,7 +185,7 @@ public class Bridge extends TeamGame implements OreObsfucation WorldTimeSet = 2000; WorldWaterDamage = 0; - WorldBoundaryKill = false; + WorldBoundaryKill = true; DeathDropItems = true; @@ -1744,7 +1744,7 @@ public class Bridge extends TeamGame implements OreObsfucation if (!UtilAlg.inBoundingBox(location, one, two)) { - player.setVelocity(UtilAlg.getTrajectory(location, average).multiply(3).add(new Vector(0, 0.5, 0))); + player.setVelocity(UtilAlg.getTrajectory(location, average).multiply(2).add(new Vector(0, 0.5, 0))); player.sendMessage(C.cRedB + "STAY ON YOUR ISLAND!"); player.playSound(player.getLocation(), Sound.NOTE_PLING, 1, 0.5F); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/kits/KitApple.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/kits/KitApple.java index 06e51b7df..f8ff4b32d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/kits/KitApple.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/kits/KitApple.java @@ -16,12 +16,12 @@ public class KitApple extends ProgressingKit private static final String[] DESCRIPTION = { "Possess the rare skill of finding apples frequently!", "", - receiveItem("apple", 1, 17, 0), + receiveItem("apple", 1, 10, 0), click(true, "the apple to throw it") }; private static final Perk[] PERKS = { - new PerkApple(17000) + new PerkApple(10000, 500) }; private static final ItemStack IN_HAND = new ItemStack(Material.APPLE); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/kits/KitBerserker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/kits/KitBerserker.java index f27afad25..27d9cc60e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/kits/KitBerserker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/kits/KitBerserker.java @@ -25,7 +25,7 @@ public class KitBerserker extends ProgressingKit }; private static final Perk[] PERKS = { - new PerkLeap("Beserker Leap", 1.2, 1.2, 14000), + new PerkLeap("Beserker Leap", 1.2, 1.2, 10000), new PerkAxeman(), }; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/kits/KitBrawler.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/kits/KitBrawler.java index 2f8b1f2d3..c7100f63b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/kits/KitBrawler.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/kits/KitBrawler.java @@ -20,14 +20,14 @@ public class KitBrawler extends ProgressingKit "Giant and muscular, easily smacks others around.", " ", "Begin with an Iron Sword", - "Take " + C.cGreen + "75%" + C.cWhite + " knockback", - "Deal " + C.cGreen + "125%" + C.cWhite + " knockback", - "Take " + C.cGreen + "-0.5" + C.cWhite + " damage from all attacks" + "Take " + C.cGreen + "85%" + C.cWhite + " knockback", + "Deal " + C.cGreen + "115%" + C.cWhite + " knockback", + "Take " + C.cGreen + "-1" + C.cWhite + " damage from all attacks" }; private static final Perk[] PERKS = { new PerkMammoth(), - new PerkIronSkin(0.5) + new PerkIronSkin(1) }; private static final ItemStack[] PLAYER_ITEMS = { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/modes/kits/KitBrawlAppler.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/modes/kits/KitBrawlAppler.java index 88443d4fe..dffa74751 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/modes/kits/KitBrawlAppler.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/modes/kits/KitBrawlAppler.java @@ -28,7 +28,7 @@ public class KitBrawlAppler extends ProgressingKit private static final Perk[] PERKS = { - new PerkApple(3000) + new PerkApple(3000, 0) }; private static final ItemStack IN_HAND = new ItemStack(Material.APPLE); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkApple.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkApple.java index 10547e0d8..40fdeae7c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkApple.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkApple.java @@ -21,14 +21,19 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.block.Action; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.ItemStack; + +import java.util.Iterator; public class PerkApple extends Perk implements IThrown { private long _spawnDelay; - - public PerkApple(long delay) + private long _throwDelay; + + public PerkApple(long delay, long throwDelay) { super("Apple Thrower", new String[] { @@ -37,6 +42,7 @@ public class PerkApple extends Perk implements IThrown }); _spawnDelay = delay; + _throwDelay = throwDelay; } @EventHandler @@ -80,6 +86,11 @@ public class PerkApple extends Perk implements IThrown if (!Kit.HasKit(player)) return; + + if (!Recharge.Instance.use(player, getMessage(player) + " Throw", _throwDelay, true, false)) + { + return; + } event.setCancelled(true); @@ -132,6 +143,23 @@ public class PerkApple extends Perk implements IThrown } + @EventHandler + public void playerDeath(PlayerDeathEvent event) + { + if (!hasPerk(event.getEntity())) + { + return; + } + + for (ItemStack itemStack : event.getDrops()) + { + if (itemStack.getType() == Material.APPLE) + { + itemStack.setAmount((int) Math.ceil((double) itemStack.getAmount() / 2D)); + } + } + } + private Material getMaterial(Player player) { if (Manager.getCosmeticManager().getGadgetManager().isKitModifierActive(KitModifier.Bridges_Apple_Potato, player))