diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/Quiver1_9.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/Quiver1_9.java new file mode 100644 index 000000000..71982c4ea --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/Quiver1_9.java @@ -0,0 +1,62 @@ +package nautilus.game.arcade.game.games.quiver; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilServer; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.game.Game; +import nautilus.game.arcade.game.Game.GameState; + +/* + * Temporary client version checker. + */ +public class Quiver1_9 implements Listener +{ + + private Game Host; + + public Quiver1_9(Game host) + { + Host = host; + + UtilServer.RegisterEvents(this); + } + + @EventHandler + public void onUpdate(UpdateEvent event) + { + if (event.getType() != UpdateType.SEC_20 || Host.IsLive()) + { + return; + } + + UtilServer.broadcast(F.main("Game", "This game requires " + C.cYellow + "1.9+" + C.cGray + ". " + C.cYellow + "1.8" + C.cGray + " users will be kicked!")); + } + + @EventHandler + public void onGameStateChange(GameStateChangeEvent event) + { + if (event.GetState() == GameState.Live) + { + for (Player player : UtilServer.getPlayers()) + { + if (!UtilPlayer.is1_9(player)) + { + player.kickPlayer("This game requires 1.9+!"); + } + } + } + else if (event.GetState() == GameState.End) + { + UtilServer.Unregister(this); + } + } + +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/QuiverPayload.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/QuiverPayload.java index d7cd9033d..03da1ae01 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/QuiverPayload.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/QuiverPayload.java @@ -141,6 +141,8 @@ public class QuiverPayload extends TeamGame this.TeamArmor = true; this.TeamArmorHotbar = true; this.HungerSet = 20; + + new Quiver1_9(this); } @Override @@ -220,17 +222,19 @@ public class QuiverPayload extends TeamGame _lastAnnoucement = System.currentTimeMillis(); _payloadVelocity = PAYLOAD_INITIAL_VELOCITY; + _minecart.spigot().forceGlowing(true); _minecart.setDisplayBlock(new MaterialData(Material.TNT)); _hologram.setFollowEntity(_minecart); _hologram.start(); - + + for (Player player : GetPlayers(true)) { if (GetKit(player) instanceof KitNewNinja) { continue; } - + // Give all players a Super Arrow item. player.getInventory().addItem(Quiver.SUPER_ARROW); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/kits/KitHeadHunter.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/kits/KitHeadHunter.java index 560e65f40..e6e75866d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/kits/KitHeadHunter.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/kits/KitHeadHunter.java @@ -12,6 +12,7 @@ import mineplex.core.itemstack.ItemBuilder; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.game.games.quiver.Quiver; +import nautilus.game.arcade.game.games.quiver.ultimates.UltimateHeadHunter; import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.ProgressingKit; @@ -34,21 +35,27 @@ public class KitHeadHunter extends ProgressingKit private static final Perk[][] PERKS = { { new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true), + new UltimateHeadHunter(10000), }, { new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true), + new UltimateHeadHunter(11000), }, { new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true), + new UltimateHeadHunter(12000), }, { new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true), + new UltimateHeadHunter(13000), }, { new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true), + new UltimateHeadHunter(14000), }, { new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true), + new UltimateHeadHunter(15000), } }; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/ultimates/UltimateHeadHunter.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/ultimates/UltimateHeadHunter.java new file mode 100644 index 000000000..7671f6108 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/ultimates/UltimateHeadHunter.java @@ -0,0 +1,72 @@ +package nautilus.game.arcade.game.games.quiver.ultimates; + +import org.bukkit.entity.Player; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; +import nautilus.game.arcade.game.Game; + +public class UltimateHeadHunter extends Ultimate +{ + + private static final double CHARGE_PER_SECOND = 0.4; + + private long _length; + + public UltimateHeadHunter(long length) + { + super("Head Hunter Ultimate", new String[] {}); + + _length = length; + } + + @Override + public void activate(Player player) + { + super.activate(player); + + UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getEyeLocation(), 0, 0, 0, 0.1F, 40, ViewDist.NORMAL); + + Game game = Manager.GetGame(); + + for (Player other : game.GetPlayers(true)) + { + if (!game.GetTeam(player).equals(game.GetTeam(other))) + { + other.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING, (int) ((_length / 1000) * 20), 0)); + } + } + } + +// @Override +// public void cancel(Player player) +// { +// super.cancel(player); +// +// Game game = Manager.GetGame(); +// +// for (Player other : game.GetPlayers(true)) +// { +// if (!game.GetTeam(player).equals(game.GetTeam(other))) +// { +// other.removePotionEffect(PotionEffectType.GLOWING); +// } +// } +// } + + @Override + public double getChargeIncreasePerSecond() + { + return CHARGE_PER_SECOND; + } + + @Override + public long getLength() + { + return _length; + } + +}