diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilInv.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilInv.java index fa2a7fe28..bb6e45b45 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilInv.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilInv.java @@ -41,6 +41,11 @@ public class UtilInv itemStack.addEnchantment(_enchantment, 1); } + public static void removeDullEnchantment(ItemStack itemStack) + { + itemStack.removeEnchantment(_enchantment); + } + @SuppressWarnings("deprecation") public static boolean insert(Player player, ItemStack stack) { diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/CustomDamageEvent.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/CustomDamageEvent.java index ebf772e7b..880cff745 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/CustomDamageEvent.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/CustomDamageEvent.java @@ -9,11 +9,12 @@ import org.bukkit.ChatColor; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.entity.Projectile; +import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -public class CustomDamageEvent extends Event +public class CustomDamageEvent extends Event implements Cancellable { private static final HandlerList handlers = new HandlerList(); @@ -269,4 +270,22 @@ public class CustomDamageEvent extends Event { return _damageToLevel; } + + @Override + public boolean isCancelled() + { + return IsCancelled(); + } + + @Override + @Deprecated + /** + * Don't call this method. Use SetCancelled(String) instead. + * + * You will be made the butt of jokes if you use this method. + */ + public void setCancelled(boolean isCancelled) + { + SetCancelled("No reason given because SOMEONE IS AN IDIOT"); + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/EvolveButton.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/EvolveButton.java index 8bbbb7020..7f4d7e0be 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/EvolveButton.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/EvolveButton.java @@ -8,12 +8,12 @@ import org.bukkit.entity.Player; public class EvolveButton extends SingleButton { - private SearchAndDestroy _arcadeManager; + private SearchAndDestroy _search; private Kit _kit; public EvolveButton(SearchAndDestroy arcadeManager, Kit kit) { - _arcadeManager = arcadeManager; + _search = arcadeManager; _kit = kit; } @@ -24,7 +24,8 @@ public class EvolveButton extends SingleButton if (((CraftPlayer) player).getHandle().spectating) return; - _arcadeManager.SetKit(player, _kit, true); + _search.SetKit(player, _kit, true); + _search.onEvolve(player); player.closeInventory(); } } \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/KitEvolve.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/KitEvolve.java index b1c01c939..ed65eb247 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/KitEvolve.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/KitEvolve.java @@ -6,8 +6,11 @@ import mineplex.core.MiniPlugin; import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.game.games.searchanddestroy.KitManager.UpgradeKit; +import org.bukkit.Material; import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerChatEvent; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.java.JavaPlugin; public class KitEvolve extends MiniPlugin @@ -26,11 +29,15 @@ public class KitEvolve extends MiniPlugin } @EventHandler - public void onInteract(PlayerChatEvent event) + public void onInteract(PlayerInteractEvent event) { - if (_arcadeManager.GetState() == GameState.Live) + if (_arcadeManager.GetState() == GameState.Live && event.getAction().name().contains("RIGHT")) { - _kitEvolve.attemptShopOpen(event.getPlayer()); + ItemStack item = event.getItem(); + if (item != null && item.getType() == Material.BOOK) + { + _kitEvolve.attemptShopOpen(event.getPlayer()); + } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/KitEvolvePage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/KitEvolvePage.java index a88659ea2..356e9fee7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/KitEvolvePage.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/KitEvolvePage.java @@ -42,7 +42,7 @@ public class KitEvolvePage extends ShopPageBase break; } } - boolean canEvolve = true; + boolean canEvolve = _search.canEvolve(Player); AddItem(kit.kitSlot, makeItem(kit.kit)); for (int slot : kit.path) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/KitManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/KitManager.java index 1cae612b3..0cf7c175f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/KitManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/KitManager.java @@ -68,7 +68,7 @@ public class KitManager UpgradeKit sword1 = new UpgradeKit(null, new KitTrooper(man), children1, 4); _kits.add(sword1); - UpgradeKit sword2 = new UpgradeKit(sword1, new KitTrooper(man), children2, 20, 12); + UpgradeKit sword2 = new UpgradeKit(sword1, new KitAssault(man), children2, 20, 12); _kits.add(sword2); UpgradeKit sword3 = new UpgradeKit(sword1, new KitTrooper(man), children3, 24, 14); _kits.add(sword3); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/SearchAndDestroy.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/SearchAndDestroy.java index 82b320f15..b7578f406 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/SearchAndDestroy.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/SearchAndDestroy.java @@ -2,14 +2,18 @@ package nautilus.game.arcade.game.games.searchanddestroy; import java.lang.reflect.Field; import java.util.ArrayList; +import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilInv; +import mineplex.core.common.util.UtilPlayer; import mineplex.core.packethandler.IPacketHandler; import mineplex.core.packethandler.PacketInfo; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; +import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; import nautilus.game.arcade.events.GameStateChangeEvent; @@ -32,17 +36,21 @@ import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; import org.bukkit.entity.Player; import org.bukkit.entity.TNTPrimed; import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; import org.bukkit.event.HandlerList; import org.bukkit.event.block.Action; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.event.player.PlayerChatEvent; import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; public class SearchAndDestroy extends TeamGame { private KitEvolve _evolve; + private HashMap _kills = new HashMap(); private KitManager _kitManager = new KitManager(this); private IPacketHandler _teamBombPackets = new IPacketHandler() { @@ -90,7 +98,9 @@ public class SearchAndDestroy extends TeamGame { "A test game of", "Search and Destroy" }); + setKits(_kitManager.get_kits()); + _evolve = new KitEvolve(manager.GetPlugin(), this, _kitManager.getUpgradeKits()); InventoryClick = true; WorldTimeSet = -1; @@ -100,6 +110,7 @@ public class SearchAndDestroy extends TeamGame AnnounceJoinQuit = false; DisableKillCommand = false; AllowParticles = false; + DamageSelf = false; } public ArrayList getBombs() @@ -107,6 +118,16 @@ public class SearchAndDestroy extends TeamGame return _teamBombs; } + public boolean canEvolve(Player player) + { + return _kills.containsKey(player.getName()) && _kills.get(player.getName()) >= 2; + } + + public void onEvolve(Player player) + { + _kills.put(player.getName(), _kills.get(player.getName()) - 2); + } + @EventHandler public void onBombsPacketListener(GameStateChangeEvent event) { @@ -178,17 +199,17 @@ public class SearchAndDestroy extends TeamGame } } // TODO The code below may need changing - if (getBombs().size() == 1) - { - GameTeam winning = getBombs().get(0).getTeam(); - Bukkit.broadcastMessage(bombOwner.GetColor() + bombOwner.GetName() + " Team's" + ChatColor.RESET - + ChatColor.GOLD + " bomb exploded! " + winning.GetColor() + winning.GetName() - + ChatColor.RESET + ChatColor.GOLD + " wins!"); - } - else - { - Bukkit.broadcastMessage(bombOwner.GetColor() + bombOwner.GetName() + " Team was defeated!"); - } + /* if (getBombs().size() == 1) + { + GameTeam winning = getBombs().get(0).getTeam(); + Bukkit.broadcastMessage(bombOwner.GetColor() + bombOwner.GetName() + " Team's" + ChatColor.RESET + + ChatColor.GOLD + " bomb exploded! " + winning.GetColor() + winning.GetName() + + ChatColor.RESET + ChatColor.GOLD + " wins!"); + } + else + { + Bukkit.broadcastMessage(bombOwner.GetColor() + bombOwner.GetName() + " Team was defeated!"); + }*/ } if (timeLeft > 0) { @@ -239,6 +260,130 @@ public class SearchAndDestroy extends TeamGame } } + @EventHandler + public void onGameState(GameStateChangeEvent event) + { + if (event.GetState() == GameState.Dead || event.GetState() == GameState.Live || event.GetState() == GameState.Prepare) + { + drawScoreboard(); + } + } + + @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) + public void onDeath(CombatDeathEvent event) + { + if (GetState() != GameState.Live) + { + return; + } + + if (event.GetLog().GetKiller() == null) + return; + + if (!event.GetLog().GetKiller().IsPlayer()) + return; + + Player player = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName()); + if (player == null) + return; + + this._kills.put(player.getName(), (_kills.containsKey(player.getName()) ? _kills.get(player.getName()) : 0) + 1); + } + + private boolean _flickerOn; + + @EventHandler + public void onUpdate(UpdateEvent event) + { + if (event.getType() != UpdateType.FAST) + { + return; + } + + for (Player player : this.GetPlayers(true)) + { + if (canEvolve(player)) + { + int slot = player.getInventory().first(Material.BOOK); + if (slot >= 0) + { + ItemStack item = player.getInventory().getItem(slot); + String message = C.Bold + "Ready to evolve kits!"; + _flickerOn = !_flickerOn; + if (_flickerOn) + { + UtilInv.addDullEnchantment(item); + message = C.cDGreen + message; + } + else + { + UtilInv.removeDullEnchantment(item); + message = C.cBlue + message; + } + ItemMeta meta = item.getItemMeta(); + meta.setDisplayName(message); + item.setItemMeta(meta); + } + } + } + } + + private void drawScoreboard() + { + GetScoreboard().Reset(); + + ArrayList aliveTeams = new ArrayList(); + for (GameTeam team : GetTeamList()) + { + if (team.IsTeamAlive()) + { + aliveTeams.add(team); + } + } + + Iterator itel = aliveTeams.iterator(); + + ArrayList bombs = new ArrayList(this._teamBombs); + + while (itel.hasNext()) + { + GameTeam team = itel.next(); + if (!team.IsTeamAlive()) + continue; + GetScoreboard().Write(team.GetColor() + C.Bold + team.GetName() + " Team"); + GetScoreboard().Write(team.GetPlayers(true).size() + " alive"); + // TODO Check bombs armed. Draw. + // Something about max scoreboard size.. So its 3 plus 3-4 for bombs. + + // Max scoreboard of 15? So 2-3 teams it shows bombs. Else. + // Could also shrink scoreboard even more if too many teams. + if (itel.hasNext()) + { + GetScoreboard().WriteBlank(); + } + } + + GetScoreboard().Draw(); + } + + @Override + @EventHandler + public void ScoreboardUpdate(UpdateEvent event) + { + if (event.getType() != UpdateType.FAST || this.GetState() != GameState.Live) + { + return; + } + + drawScoreboard(); + } + + @EventHandler + public void onChat(PlayerChatEvent event) + { + _kills.put(event.getPlayer().getName(), Integer.parseInt(event.getMessage())); + } + @EventHandler public void onGameEnd(GameStateChangeEvent event) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/kits/bow/KitPinner.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/kits/bow/KitPinner.java index a83c7c790..017a9a73b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/kits/bow/KitPinner.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/kits/bow/KitPinner.java @@ -2,7 +2,6 @@ package nautilus.game.arcade.game.games.searchanddestroy.kits.bow; import mineplex.core.common.util.C; import mineplex.core.itemstack.ItemBuilder; -import mineplex.core.itemstack.ItemStackFactory; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.game.games.castlesiege.kits.KitHuman; import nautilus.game.arcade.kit.KitAvailability; @@ -28,24 +27,25 @@ public class KitPinner extends KitHuman "Your arrows enchanted with gravity magic.", "Victims find it hard to lift", "Their bodies are sluggish" }, new Perk[] { - new PerkQuickshot("Quickshot", 2, 8000), - new PerkPinned() - }, - EntityType.SKELETON, new ItemStack(Material.OBSIDIAN)); + new PerkQuickshot("Quickshot", 2, 8000), new PerkPinned() + }, EntityType.SKELETON, new ItemStack(Material.OBSIDIAN)); } @Override public void GiveItems(Player player) { PlayerInventory inv = player.getInventory(); - inv.setItem(4, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build()); - inv.addItem(new ItemBuilder(Material.BOW).setTitle(C.cGreen + "Left-Click" + C.cWhite + " - " + C.cYellow + "Quickshot").setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build()); + inv.setArmorContents(new ItemStack[] + { + new ItemStack(Material.CHAINMAIL_BOOTS), new ItemStack(Material.CHAINMAIL_LEGGINGS), + new ItemStack(Material.CHAINMAIL_CHESTPLATE), new ItemStack(Material.CHAINMAIL_HELMET) + }); + inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build()); + inv.addItem(new ItemBuilder(Material.BOW).setTitle(C.cGreen + "Left-Click" + C.cWhite + " - " + C.cYellow + "Quickshot") + .setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build()); + inv.setItem(8, new ItemBuilder(Material.BOOK).setTitle(ChatColor.WHITE + "Evolve kit").addLore("Right click to use") + .build()); inv.setItem(9, new ItemStack(Material.ARROW, 1)); - - player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_HELMET)); - player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE)); - player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS)); - player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS)); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/kits/bow/KitPunch.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/kits/bow/KitPunch.java index 1a7e91886..c1d56c4ba 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/kits/bow/KitPunch.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/kits/bow/KitPunch.java @@ -42,14 +42,16 @@ public class KitPunch extends KitHuman public void GiveItems(Player player) { PlayerInventory inv = player.getInventory(); - inv.setItem(4, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build()); + inv.setArmorContents(new ItemStack[] + { + new ItemStack(Material.CHAINMAIL_BOOTS), new ItemStack(Material.CHAINMAIL_LEGGINGS), + new ItemStack(Material.CHAINMAIL_CHESTPLATE), new ItemStack(Material.CHAINMAIL_HELMET) + }); + inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build()); inv.addItem(new ItemBuilder(Material.BOW).setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build()); + inv.setItem(8, new ItemBuilder(Material.BOOK).setTitle(ChatColor.WHITE + "Evolve kit").addLore("Right click to use") + .build()); inv.setItem(9, new ItemStack(Material.ARROW, 1)); - - player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_HELMET)); - player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE)); - player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS)); - player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS)); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/kits/bow/KitSharpshooter.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/kits/bow/KitSharpshooter.java index 128b21462..93d292c1f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/kits/bow/KitSharpshooter.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/kits/bow/KitSharpshooter.java @@ -27,24 +27,24 @@ public class KitSharpshooter extends KitHuman "Max of +6. Missing an arrow resets the count to 0." }, new Perk[] { - new PerkKnockbackArrow(2.5D), - new PerkSharpshooter() - }, - EntityType.SKELETON, new ItemStack(Material.FLINT)); + new PerkKnockbackArrow(2.5D), new PerkSharpshooter() + }, EntityType.SKELETON, new ItemStack(Material.FLINT)); } @Override public void GiveItems(Player player) { PlayerInventory inv = player.getInventory(); - inv.setItem(4, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build()); + inv.setArmorContents(new ItemStack[] + { + new ItemStack(Material.CHAINMAIL_BOOTS), new ItemStack(Material.CHAINMAIL_LEGGINGS), + new ItemStack(Material.CHAINMAIL_CHESTPLATE), new ItemStack(Material.CHAINMAIL_HELMET) + }); + inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build()); inv.addItem(new ItemBuilder(Material.BOW).setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build()); + inv.setItem(8, new ItemBuilder(Material.BOOK).setTitle(ChatColor.WHITE + "Evolve kit").addLore("Right click to use") + .build()); inv.setItem(9, new ItemStack(Material.ARROW, 1)); - - player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_HELMET)); - player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE)); - player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS)); - player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS)); - } + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/kits/bow/KitSniper.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/kits/bow/KitSniper.java index d42982919..99049fca3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/kits/bow/KitSniper.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/kits/bow/KitSniper.java @@ -36,24 +36,25 @@ public class KitSniper extends KitHuman "Arrows do 0.1 damage per block travelled.", "Shoot from afar to score major damage!" }, new Perk[] { - new PerkKnockbackArrow(2.5D), - new PerkSniper() - }, - EntityType.SKELETON, new ItemStack(Material.ARROW)); + new PerkKnockbackArrow(2.5D), new PerkSniper() + }, EntityType.SKELETON, new ItemStack(Material.ARROW)); } @Override public void GiveItems(Player player) { PlayerInventory inv = player.getInventory(); - inv.setItem(4, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build()); + inv.setArmorContents(new ItemStack[] + { + new ItemStack(Material.CHAINMAIL_BOOTS), new ItemStack(Material.CHAINMAIL_LEGGINGS), + new ItemStack(Material.CHAINMAIL_CHESTPLATE), new ItemStack(Material.CHAINMAIL_HELMET) + }); + inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build()); inv.addItem(new ItemBuilder(Material.BOW).setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build()); + inv.setItem(8, new ItemBuilder(Material.BOOK).setTitle(ChatColor.WHITE + "Evolve kit").addLore("Right click to use") + .build()); inv.setItem(9, new ItemStack(Material.ARROW, 1)); - - player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_HELMET)); - player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE)); - player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS)); - player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS)); + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/kits/bow/KitThunderstorm.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/kits/bow/KitThunderstorm.java index 431732027..2262e01c2 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/kits/bow/KitThunderstorm.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/kits/bow/KitThunderstorm.java @@ -26,27 +26,28 @@ public class KitThunderstorm extends KitHuman { "Chargeup your bow to release a barrage of arrows." + "The longer you charge your bow" + "The more arrows are added to the barrage." - } - , new Perk[] + }, new Perk[] { - new PerkQuickshot("Quickshot", 2, 8000), - new PerkBarrage(10, 400, false, false, true) - }, - EntityType.SKELETON, new ItemStack(Material.ARROW, 16)); + new PerkQuickshot("Quickshot", 2, 8000), new PerkBarrage(10, 400, false, false, true) + }, EntityType.SKELETON, new ItemStack(Material.ARROW, 16)); } @Override public void GiveItems(Player player) { PlayerInventory inv = player.getInventory(); - inv.setItem(4, new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build()); - inv.addItem(new ItemBuilder(Material.BOW).setTitle(C.cGreen + "Left-Click" + C.cWhite + " - " + C.cYellow + "Quickshot").setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build()); + inv.addItem(new ItemBuilder(Material.BLAZE_POWDER).setTitle(ChatColor.GOLD + "Fuse").build()); + inv.addItem(new ItemBuilder(Material.BOW).setTitle(C.cGreen + "Left-Click" + C.cWhite + " - " + C.cYellow + "Quickshot") + .setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build()); + inv.setArmorContents(new ItemStack[] + { + new ItemStack(Material.CHAINMAIL_BOOTS), new ItemStack(Material.CHAINMAIL_LEGGINGS), + new ItemStack(Material.CHAINMAIL_CHESTPLATE), new ItemStack(Material.CHAINMAIL_HELMET) + }); + inv.addItem(new ItemBuilder(Material.BOW).setUnbreakable(true).addEnchantment(Enchantment.ARROW_INFINITE, 1).build()); + inv.setItem(8, new ItemBuilder(Material.BOOK).setTitle(ChatColor.WHITE + "Evolve kit").addLore("Right click to use") + .build()); inv.setItem(9, new ItemStack(Material.ARROW, 1)); - - player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_HELMET)); - player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE)); - player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS)); - player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS)); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkPinned.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkPinned.java index f43c615c4..a42b9659b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkPinned.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkPinned.java @@ -27,17 +27,17 @@ public class PerkPinned extends Perk }); } - private NautHashMap _secondsPinned = new NautHashMap(); + private NautHashMap _ticksPinned = new NautHashMap(); @EventHandler public void onSecond(UpdateEvent event) { - if (event.getType() != UpdateType.FASTER) + if (event.getType() != UpdateType.FASTEST) { return; } - Iterator itel = _secondsPinned.keySet().iterator(); + Iterator itel = _ticksPinned.keySet().iterator(); while (itel.hasNext()) { LivingEntity entity = itel.next(); @@ -46,14 +46,14 @@ public class PerkPinned extends Perk itel.remove(); continue; } - entity.setVelocity(entity.getVelocity().add(new Vector(0, -1, 0))); - if (_secondsPinned.get(entity) <= 1) + entity.setVelocity(entity.getVelocity().add(new Vector(0, -0.2, 0))); + if (_ticksPinned.get(entity) <= 1) { itel.remove(); } else { - _secondsPinned.put(entity, _secondsPinned.get(entity) - 1); + _ticksPinned.put(entity, _ticksPinned.get(entity) - 1); } } } @@ -67,9 +67,9 @@ public class PerkPinned extends Perk if (player != null && this.Kit.HasKit(player)) { LivingEntity entity = event.GetDamageeEntity(); - entity.setVelocity(entity.getVelocity().add(new Vector(0, -1, 0))); + entity.setVelocity(entity.getVelocity().add(new Vector(0, -0.4, 0))); entity.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 40, 1), true); - _secondsPinned.put(entity, 8); + _ticksPinned.put(entity, 40); } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRangedBleeding.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRangedBleeding.java index 817bcb027..90d3c846a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRangedBleeding.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRangedBleeding.java @@ -32,7 +32,7 @@ public class PerkRangedBleeding extends Perk return; } - Iterator itel = _secondsBleeding.keySet().iterator(); + Iterator itel = _timeBleeding.keySet().iterator(); while (itel.hasNext()) { LivingEntity entity = itel.next(); @@ -41,20 +41,21 @@ public class PerkRangedBleeding extends Perk itel.remove(); continue; } - Manager.GetDamage().NewDamageEvent(entity, null, null, DamageCause.CUSTOM, 2, false, true, true, "Bleed", + Manager.GetDamage().NewDamageEvent(entity, null, null, DamageCause.CUSTOM, 1, false, true, true, "Bleed", "Stitcher Bleeding"); - if (_secondsBleeding.get(entity) <= 1) + // TODO Bleed particles? + if (_timeBleeding.get(entity) <= 1) { itel.remove(); } else { - _secondsBleeding.put(entity, _secondsBleeding.get(entity) - 1); + _timeBleeding.put(entity, _timeBleeding.get(entity) - 1); } } } - private NautHashMap _secondsBleeding = new NautHashMap(); + private NautHashMap _timeBleeding = new NautHashMap(); @EventHandler(ignoreCancelled = true) public void onDamage(CustomDamageEvent event) @@ -65,13 +66,13 @@ public class PerkRangedBleeding extends Perk if (player != null && Kit.HasKit(player)) { LivingEntity entity = event.GetDamageeEntity(); - if (!_secondsBleeding.containsKey(entity)) + if (!_timeBleeding.containsKey(entity)) { - _secondsBleeding.put(entity, 4); + _timeBleeding.put(entity, 4); } else { - _secondsBleeding.put(entity, _secondsBleeding.get(entity) + 4); + _timeBleeding.put(entity, _timeBleeding.get(entity) + 4); } } }