Ultimate length tweaks

This commit is contained in:
Sam 2016-07-23 23:43:06 +01:00
parent 43aae5e076
commit d3c9957f95
6 changed files with 30 additions and 83 deletions

View File

@ -19,6 +19,7 @@ import org.bukkit.event.entity.EntityShootBowEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
@ -28,12 +29,11 @@ import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextBottom;
import mineplex.core.common.util.UtilTime;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.combat.CombatComponent;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
@ -45,7 +45,6 @@ import nautilus.game.arcade.game.games.quiver.kits.KitHeadHunter;
import nautilus.game.arcade.game.games.quiver.kits.KitNecromancer;
import nautilus.game.arcade.game.games.quiver.kits.KitNewNinja;
import nautilus.game.arcade.game.games.quiver.kits.KitPyromancer;
import nautilus.game.arcade.game.games.quiver.kits.KitSlamShot;
import nautilus.game.arcade.game.games.quiver.ultimates.Ultimate;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.Perk;
@ -63,6 +62,8 @@ public class Quiver extends SoloGame
private Objective _scoreObj;
private boolean _coloredMessage;
public static final ItemStack SUPER_ARROW = new ItemBuilder(Material.ARROW).setTitle(C.cYellow + "Super Arrow").build();
@SuppressWarnings("unchecked")
public Quiver(ArcadeManager manager)
@ -133,7 +134,7 @@ public class Quiver extends SoloGame
for (Player player : GetPlayers(true))
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(262, (byte)0, 1, F.item("Super Arrow")));
player.getInventory().addItem(SUPER_ARROW);
player.playSound(player.getLocation(), Sound.PISTON_EXTEND, 3f, 2f);
}
}
@ -167,7 +168,7 @@ public class Quiver extends SoloGame
public void run()
{
if (!player.getInventory().contains(Material.ARROW))
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(262, (byte)0, 1, F.item("Super Arrow")));
player.getInventory().addItem(SUPER_ARROW);
}
}, 10);
@ -190,18 +191,18 @@ public class Quiver extends SoloGame
Player player = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName());
if (player == null) return;
int amount = 1;
if (GetKit(player) instanceof KitSlamShot)
{
if (Manager.GetCondition().HasCondition(event.GetEvent().getEntity(), ConditionType.FALLING, null))
{
amount = 2;
}
}
// int amount = 1;
//
// if (GetKit(player) instanceof KitSlamShot)
// {
// if (Manager.GetCondition().HasCondition(event.GetEvent().getEntity(), ConditionType.FALLING, null))
// {
// amount = 2;
// }
// }
//New Arrow
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(262, (byte)0, amount, F.item("Super Arrow")));
player.getInventory().addItem(SUPER_ARROW);
player.playSound(player.getLocation(), Sound.PISTON_EXTEND, 3f, 2f);
//Score

View File

@ -6,12 +6,11 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilServer;
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.UltimateBarrage;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
@ -77,7 +76,7 @@ public class KitBarrage extends ProgressingKit
if (Manager.GetGame().GetState() == GameState.Live)
{
player.getInventory().addItem(new ItemBuilder(Material.ARROW).setTitle(F.item("Super Arrow")).build());
player.getInventory().addItem(Quiver.SUPER_ARROW);
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.getPlugin(), () -> UtilInv.Update(player), 10);
}

View File

@ -6,12 +6,11 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilServer;
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.UltimateBeserker;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
@ -77,7 +76,7 @@ public class KitBeserker extends ProgressingKit
if (Manager.GetGame().GetState() == GameState.Live)
{
player.getInventory().addItem(new ItemBuilder(Material.ARROW).setTitle(F.item("Super Arrow")).build());
player.getInventory().addItem(Quiver.SUPER_ARROW);
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.getPlugin(), () -> UtilInv.Update(player), 10);
}

View File

@ -28,7 +28,7 @@ public class KitNewNinja extends ProgressingKit
C.cGreenB + "ULTIMATE",
"Your " + C.cGreen + "Gold Sword" + C.cWhite + " changes into a " + C.cGreen + "Diamond Sword" + C.cWhite + ".",
"This new sword kills players in " + C.cRedB + "ONE" + C.cWhite + " hit!",
"Lasts for " + C.cGreen + "3" + C.cWhite + " seconds."
"Lasts for " + C.cGreen + "6" + C.cWhite + " seconds."
};
private static final Perk[][] PERKS = {
@ -67,7 +67,7 @@ public class KitNewNinja extends ProgressingKit
public KitNewNinja(ArcadeManager manager)
{
super(manager, "Ninja", "quiverninja", KitAvailability.Free, DESCRIPTION, PERKS, EntityType.ZOMBIE, IN_HAND);
super(manager, "Ninja", "quivernewninja", KitAvailability.Free, DESCRIPTION, PERKS, EntityType.ZOMBIE, IN_HAND);
}
@Override

View File

@ -15,6 +15,7 @@ import mineplex.core.common.util.UtilTime;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import nautilus.game.arcade.game.games.quiver.Quiver;
import nautilus.game.arcade.kit.Perk;
public abstract class Ultimate extends Perk
@ -31,6 +32,7 @@ public abstract class Ultimate extends Perk
{
_lastUltimate.put(player.getUniqueId(), System.currentTimeMillis());
player.getInventory().addItem(Quiver.SUPER_ARROW);
player.sendMessage(F.main("Game", "Activated " + F.skill(GetName())));
UtilServer.broadcast(C.cWhiteB + player.getName() + " activated " + C.cGreenB + GetName());

View File

@ -2,75 +2,22 @@ package nautilus.game.arcade.game.games.quiver.ultimates;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilServer;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
public class UltimateNinja extends Ultimate
{
private static final double CHARGE_PER_SECOND = 0.2;
private long _length;
public UltimateNinja(long length)
{
super("Ninja Ultimate", new String[] {});
super("Ultimate Ninja", new String[] {});
_length = length;
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onCustomDamage(CustomDamageEvent event)
{
if (event.isCancelled())
{
return;
}
Player player = event.GetDamagerPlayer(false);
if (player == null)
{
return;
}
if (player.getItemInHand() == null)
{
return;
}
if (getLastUltimate().containsKey(player.getUniqueId()) && player.getItemInHand().getType() == Material.DIAMOND_SWORD)
{
event.AddMod(player.getName(), GetName(), 9001, true);
}
}
@EventHandler
public void onUpdate(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
{
return;
}
for (Player player : UtilServer.getPlayers())
{
if (getLastUltimate().containsKey(player.getUniqueId()))
{
UtilParticle.PlayParticleToAll(ParticleType.FLAME, player.getLocation().add(0, 1, 0), 0.5F, 0.25F, 0.5F, 0.005F, 10, ViewDist.NORMAL);
}
}
}
@Override
public void activate(Player player)
{
@ -78,14 +25,13 @@ public class UltimateNinja extends Ultimate
player.getInventory().setItem(0, new ItemStack(Material.DIAMOND_SWORD));
}
@Override
public void cancel(Player player)
{
super.cancel(player);
player.getInventory().clear();
Kit.GiveItems(player);
player.getInventory().setItem(0, new ItemStack(Material.GOLD_SWORD));
}
@Override