From 9cf5a6fb9eceded1b492d4f6329d7d8c117645ec Mon Sep 17 00:00:00 2001 From: xXVevzZXx Date: Tue, 12 Jul 2016 05:39:21 +0200 Subject: [PATCH] Fix Absorption in OP MB, add more arrows to OP MB, fix not being able to purchase primary weapon in MS, fix skin bug in MS and fix helmet drop when scoping in Strike Games --- .../src/nautilus/game/arcade/GameType.java | 4 +- .../games/micro/modes/kits/KitOverlord.java | 2 +- .../game/games/minestrike/GunModule.java | 4 +- .../items/grenades/HighExplosive.java | 2 +- .../survivalgames/modes/StrikeGames.java | 59 +++++++++---------- 5 files changed, 35 insertions(+), 36 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java index 4d0e94361..11b2d1b76 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java @@ -1,5 +1,7 @@ package nautilus.game.arcade; +import org.bukkit.Material; + import mineplex.core.common.MinecraftVersion; import mineplex.core.common.Pair; import mineplex.core.game.GameCategory; @@ -50,7 +52,6 @@ import nautilus.game.arcade.game.games.micro.modes.TinySmash; import nautilus.game.arcade.game.games.micro.modes.TinyWinners; import nautilus.game.arcade.game.games.milkcow.MilkCow; import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague; -import nautilus.game.arcade.game.games.minestrike.GunModule; import nautilus.game.arcade.game.games.minestrike.Minestrike; import nautilus.game.arcade.game.games.mineware.MineWare; import nautilus.game.arcade.game.games.monsterleague.MonsterLeague; @@ -104,7 +105,6 @@ import nautilus.game.arcade.game.games.valentines.Valentines; import nautilus.game.arcade.game.games.wither.WitherGame; import nautilus.game.arcade.game.games.wizards.Wizards; import nautilus.game.arcade.game.games.zombiesurvival.ZombieSurvival; -import org.bukkit.Material; public enum GameType { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/modes/kits/KitOverlord.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/modes/kits/KitOverlord.java index 0bcaeb900..471ea9c63 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/modes/kits/KitOverlord.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/modes/kits/KitOverlord.java @@ -19,7 +19,7 @@ public class KitOverlord extends ProgressingKit }; private static final Perk[] PERKS = { - new PerkFletcher(4, 10, true) + new PerkFletcher(3, 16, true) }; private static final ItemStack IN_HAND = new ItemStack(Material.GOLDEN_APPLE); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/GunModule.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/GunModule.java index a809959f3..3e391c0d3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/GunModule.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/GunModule.java @@ -1331,7 +1331,7 @@ public class GunModule implements Listener removeScope(event.getPlayer()); } } - + @EventHandler public void scopeUpdate(UpdateEvent event) { @@ -1340,7 +1340,7 @@ public class GunModule implements Listener if (event.getType() != UpdateType.TICK) return; - + for (Player player : _host.GetPlayers(true)) { if (!_scoped.containsKey(player)) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/grenades/HighExplosive.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/grenades/HighExplosive.java index f7cce0ca3..a9d807596 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/grenades/HighExplosive.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/grenades/HighExplosive.java @@ -53,7 +53,7 @@ public class HighExplosive extends Grenade // Damage Event Player damager = null; - if (game.IsAlive(_thrower)) + if (game.getHost().IsAlive(_thrower)) { damager = _thrower; } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modes/StrikeGames.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modes/StrikeGames.java index c118f06f1..2373b9537 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modes/StrikeGames.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/modes/StrikeGames.java @@ -1,16 +1,12 @@ package nautilus.game.arcade.game.games.survivalgames.modes; -import java.util.ArrayList; -import java.util.Arrays; +import java.util.HashMap; import java.util.Iterator; import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.Color; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.Chest; -import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -20,21 +16,19 @@ import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.event.player.PlayerItemDamageEvent; import org.bukkit.event.player.PlayerPickupItemEvent; +import org.bukkit.event.player.PlayerToggleSneakEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; import org.bukkit.inventory.meta.ItemMeta; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilEvent; -import mineplex.core.common.util.UtilInv; +import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilItem; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilTime; -import mineplex.core.common.util.UtilEvent.ActionType; -import mineplex.core.gadget.GadgetManager; -import mineplex.core.gadget.gadgets.gamemodifiers.GameModifierType; -import mineplex.core.gadget.gadgets.gamemodifiers.minestrike.GameModifierMineStrikeSkin; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.loot.RandomItem; import mineplex.core.updater.UpdateType; @@ -70,6 +64,8 @@ public class StrikeGames extends SoloSurvivalGames private GunModule _gunModule; private long _peacePhase; + + private HashMap _helmets; public StrikeGames(ArcadeManager manager) { @@ -78,7 +74,9 @@ public class StrikeGames extends SoloSurvivalGames new KitPlayer(manager) }, GameType.Brawl); - DamagePvP = false; + Damage = false; + + _helmets = new HashMap<>(); _peacePhase = 20000; @@ -100,11 +98,11 @@ public class StrikeGames extends SoloSurvivalGames if (!UtilTime.elapsed(GetStateTime(), _peacePhase)) return; - if (DamagePvP) + if (Damage) return; Announce(F.main("Game", "The Peace Phase has ended! You can now fight each other!")); - DamagePvP = true; + Damage = true; } @EventHandler @@ -116,6 +114,22 @@ public class StrikeGames extends SoloSurvivalGames Announce(F.main("Game", "A Peace Phase of " + F.time((_peacePhase/1000) + "") + " seconds has started!")); } + @EventHandler(priority=EventPriority.HIGHEST) + public void addHelmet(PlayerToggleSneakEvent event) + { + if (!IsLive()) + return; + + if (!IsAlive(event.getPlayer())) + return; + + if (_gunModule.getScoped().containsKey(event.getPlayer())) + return; + + if (event.getPlayer().getInventory().getHelmet() != null) + _helmets.put(event.getPlayer(), event.getPlayer().getInventory().getHelmet()); + } + @EventHandler(priority=EventPriority.HIGHEST) public void pumpkinDrop(PlayerDeathEvent event) { @@ -129,10 +143,8 @@ public class StrikeGames extends SoloSurvivalGames itemIterator.remove(); } } - if (_gunModule.getScoped().containsKey(event.getEntity())) - { - event.getDrops().add(_gunModule.getScoped().get(event.getEntity())); - } + if (_helmets.containsKey(event.getEntity())) + event.getDrops().add(_helmets.get(event.getEntity())); } @EventHandler @@ -502,19 +514,6 @@ public class StrikeGames extends SoloSurvivalGames event.getPlayer().setItemInHand(null); return; } - }@EventHandler - public void giveStartEquipment(PlayerKitGiveEvent event) - { - GameTeam team = GetTeam(event.getPlayer()); - if (team == null) - return; - - Material mat = Material.IRON_SWORD; - byte data = 0; - String name = "Knife"; - - ItemStack knife = ItemStackFactory.Instance.CreateStack(mat, data, 1, name); - event.getPlayer().getInventory().setItem(0, knife); } @EventHandler