This commit is contained in:
Sam 2016-08-08 20:49:24 +01:00
parent 4173c96d32
commit 239761962d
4 changed files with 147 additions and 2 deletions

View File

@ -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);
}
}
}

View File

@ -141,6 +141,8 @@ public class QuiverPayload extends TeamGame
this.TeamArmor = true; this.TeamArmor = true;
this.TeamArmorHotbar = true; this.TeamArmorHotbar = true;
this.HungerSet = 20; this.HungerSet = 20;
new Quiver1_9(this);
} }
@Override @Override
@ -220,10 +222,12 @@ public class QuiverPayload extends TeamGame
_lastAnnoucement = System.currentTimeMillis(); _lastAnnoucement = System.currentTimeMillis();
_payloadVelocity = PAYLOAD_INITIAL_VELOCITY; _payloadVelocity = PAYLOAD_INITIAL_VELOCITY;
_minecart.spigot().forceGlowing(true);
_minecart.setDisplayBlock(new MaterialData(Material.TNT)); _minecart.setDisplayBlock(new MaterialData(Material.TNT));
_hologram.setFollowEntity(_minecart); _hologram.setFollowEntity(_minecart);
_hologram.start(); _hologram.start();
for (Player player : GetPlayers(true)) for (Player player : GetPlayers(true))
{ {
if (GetKit(player) instanceof KitNewNinja) if (GetKit(player) instanceof KitNewNinja)

View File

@ -12,6 +12,7 @@ import mineplex.core.itemstack.ItemBuilder;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.games.quiver.Quiver; 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.KitAvailability;
import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.ProgressingKit; import nautilus.game.arcade.kit.ProgressingKit;
@ -34,21 +35,27 @@ public class KitHeadHunter extends ProgressingKit
private static final Perk[][] PERKS = { private static final Perk[][] PERKS = {
{ {
new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true), new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true),
new UltimateHeadHunter(10000),
}, },
{ {
new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true), new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true),
new UltimateHeadHunter(11000),
}, },
{ {
new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true), new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true),
new UltimateHeadHunter(12000),
}, },
{ {
new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true), new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true),
new UltimateHeadHunter(13000),
}, },
{ {
new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true), new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true),
new UltimateHeadHunter(14000),
}, },
{ {
new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true), new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true),
new UltimateHeadHunter(15000),
} }
}; };

View File

@ -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;
}
}