Payload (OITQ)

This commit is contained in:
Sam 2016-08-29 23:08:04 +01:00
parent 9454e1f409
commit 7a3ce9813c
10 changed files with 296 additions and 141 deletions

View File

@ -0,0 +1,111 @@
package mineplex.core.common.util.particles.effects;
import java.util.Set;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
/**
* Creates a line of particles with customise able traits.
*
* Most noticeable with Blink skills.
*/
public class LineParticle
{
private Location _start;
private Vector _direction;
private Location _lastLocation;
private double _curRange;
private double _incrementedRange;
private double _maxRange;
private double _actualRange;
private Set<Material> _ignoredTypes;
private ParticleType _particleType;
private Player[] _toDisplay;
public LineParticle(Location start, Vector direction, double incrementedRange, double maxRange, Set<Material> ignoredTypes, ParticleType particleType, Player... toDisplay)
{
this(start, null, direction, incrementedRange, maxRange, ignoredTypes, particleType, toDisplay);
}
public LineParticle(Location start, Location end, Vector direction, double incrementedRange, double maxRange, Set<Material> ignoredTypes, ParticleType particleType, Player... toDisplay)
{
_start = start;
_direction = direction;
_lastLocation = start;
_curRange = 0;
_incrementedRange = incrementedRange;
_maxRange = maxRange;
_ignoredTypes = ignoredTypes;
_particleType = particleType;
_toDisplay = toDisplay;
if (_direction == null)
{
direction = UtilAlg.getTrajectory(start, end).normalize();
}
}
/**
* Advances the line.
*
* @return true when the line has reached its target or has collided with a
* block with a type contained in _ignoredTypes.
*/
public boolean update()
{
boolean done = _curRange > _maxRange;
Location newTarget = _start.clone().add(new Vector(0, 0.2, 0)).add(_direction.clone().multiply(_curRange));
_lastLocation = newTarget;
if (!UtilBlock.airFoliage(newTarget.getBlock()) || !UtilBlock.airFoliage(newTarget.getBlock().getRelative(BlockFace.UP)))
{
if (_ignoredTypes == null)
{
done = true;
}
if (!_ignoredTypes.contains(newTarget.getBlock().getType()))
{
done = true;
}
}
_curRange += _incrementedRange;
UtilParticle.PlayParticle(_particleType, newTarget, 0, 0, 0, 0.001F, 1, ViewDist.LONG, _toDisplay);
if (done)
{
_actualRange = _curRange;
}
return done;
}
public Location getLastLocation()
{
return _lastLocation;
}
public Location getDestination()
{
return _start.add(_direction.multiply(Math.max(0, _actualRange - 0.4)).add(new Vector(0, 0.4, 0)));
}
}

View File

@ -1,13 +1,21 @@
package mineplex.core.common.util;
package mineplex.core.common.util.particles.effects;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
/**
* Creates a particle curve that bends towards a location.
*
* Most noticeable in Gladiators and TOITQ.
*/
public class ObjectiveParticle
{
@ -32,7 +40,8 @@ public class ObjectiveParticle
this(start, startVector, target, 0.15F, 0.5F, 0.03F, 3, ParticleType.HAPPY_VILLAGER, 0.2F, 3F, Sound.FIZZ, 4, toDisplay);
}
public ObjectiveParticle(Location start, Vector startVector, Location target, float turnMutlipler, float blocksToAdvance, float particleOffset, int particleCount, ParticleType particleType, float soundVolume, float soundPitch, Sound sound, double stopAtDistance, Player... toDisplay)
public ObjectiveParticle(Location start, Vector startVector, Location target, float turnMutlipler, float blocksToAdvance, float particleOffset, int particleCount, ParticleType particleType,
float soundVolume, float soundPitch, Sound sound, double stopAtDistance, Player... toDisplay)
{
_current = start;
_target = target;
@ -56,6 +65,12 @@ public class ObjectiveParticle
_direction.normalize();
}
/**
* Advances the curve.
*
* @return true when the curve is within _stopAtDistance blocks of the
* target.
*/
public boolean update()
{
_direction.add(UtilAlg.getTrajectory(_current, _target).multiply(_turnMultipler));
@ -65,7 +80,10 @@ public class ObjectiveParticle
UtilParticle.PlayParticle(_particleType, _current, _particleOffset, _particleOffset, _particleOffset, 0, _particleCount, ViewDist.LONG, _toDisplay);
_current.getWorld().playSound(_current, _sound, _soundVolume, _soundPitch);
for (Player player : _toDisplay)
{
player.playSound(_current, _sound, _soundVolume, _soundPitch);
}
return UtilMath.offset(_current, _target) < _stopAtDistance;
}

View File

@ -38,7 +38,6 @@ import org.bukkit.util.Vector;
import mineplex.core.common.MinecraftVersion;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.ObjectiveParticle;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilItem;
@ -52,7 +51,7 @@ import mineplex.core.common.util.UtilTextBottom;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilTextTop;
import mineplex.core.common.util.UtilTime;
import mineplex.core.hologram.Hologram;
import mineplex.core.common.util.particles.effects.ObjectiveParticle;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.combat.CombatComponent;
@ -99,7 +98,7 @@ public class QuiverPayload extends TeamGame
private static final long POWERUP_SPAWN_DELAY = 20000;
private static final int RESPAWN_INITAL_SECONDS = 5;
private static final int RESPAWN_INITAL_SECONDS = 2;
private static final int RESPAWN_ARROW_GIVE_DELAY = 20;
private static final int END_EFFECT_DELAY = 100;
@ -109,6 +108,7 @@ public class QuiverPayload extends TeamGame
private static final long KILLSTREAK_TIME_PERIOD = 1500;
private static final long TEAM_KILL_MINIMUM_DELAY = 20000;
private static final int TEAM_KILL_MINIMUM_PLAYERS = 6;
private static final long OBJECTIVE_PARTICLES_TIME = 10000;
@ -121,7 +121,6 @@ public class QuiverPayload extends TeamGame
public static final String DATA_POINT_KIT_BLUE = "LIGHT_BLUE";
private Minecart _minecart;
private Hologram _hologram;
private GameTeam _teamDirection;
private int _targetIndex;
private boolean _hasMoved;
@ -223,7 +222,7 @@ public class QuiverPayload extends TeamGame
for (GameTeam gameTeam : _teamScore.keySet())
{
int score = _teamScore.get(gameTeam);
int score = Math.min(_teamScore.get(gameTeam), MAX_SCORE);
Scoreboard.write(gameTeam.GetColor() + C.Bold + "Team " + gameTeam.getDisplayName());
Scoreboard.write(score + " Point" + (score == 1 ? "" : "s") + " (" + (MAX_SCORE - score) + ")");
@ -269,12 +268,9 @@ public class QuiverPayload extends TeamGame
Location location = WorldData.GetDataLocs(DATA_POINT_PAYLOAD).get(0);
_minecart = location.getWorld().spawn(location, Minecart.class);
_hologram = new Hologram(Manager.getHologramManager(), location.add(0, 1, 0), "None");
_minecart.spigot().forceGlowing(true);
_minecart.setDisplayBlock(new MaterialData(Material.TNT));
_hologram.setFollowEntity(_minecart);
_hologram.start();
_payloadTeam.addEntry(_minecart.getUniqueId().toString());
for (Player player : GetPlayers(true))
@ -389,7 +385,7 @@ public class QuiverPayload extends TeamGame
return;
}
if (event.getType() == UpdateType.MIN_01)
if (event.getType() == UpdateType.MIN_02)
{
this.DeathSpectateSecs++;
}
@ -553,6 +549,8 @@ public class QuiverPayload extends TeamGame
}
if (event.getType() == UpdateType.FAST)
{
if (GetPlayers(true).size() >= TEAM_KILL_MINIMUM_PLAYERS)
{
for (GameTeam gameTeam : GetTeamList())
{
@ -581,6 +579,7 @@ public class QuiverPayload extends TeamGame
_lastTeamKill = System.currentTimeMillis();
}
}
}
for (Player player : UtilServer.getPlayers())
{
@ -695,12 +694,10 @@ public class QuiverPayload extends TeamGame
if (gameTeamACount > 0 && gameTeamBCount > 0)
{
_payloadState = PayloadState.CONTESTED;
_hologram.setText(C.cDPurpleB + "Contested");
}
else
{
_payloadState = PayloadState.NONE;
_hologram.setText("None");
}
setMinecartTeam(_payloadState);
@ -746,7 +743,6 @@ public class QuiverPayload extends TeamGame
_minecart.setVelocity(UtilAlg.getTrajectory(_minecart.getLocation(), _pathMarkers.get(_targetIndex)).normalize().multiply(PAYLOAD_VELOCITY));
_hasMoved = true;
_hologram.setText(_teamDirection.GetFormattedName());
}
if (event.getType() == UpdateType.FASTER && _payloadState.equals(PayloadState.RESTARTING))
@ -884,11 +880,13 @@ public class QuiverPayload extends TeamGame
_recentlyChanged = false;
UtilAction.zeroVelocity(_minecart);
if (_teamScore.get(_teamDirection) < MAX_SCORE)
{
String message = WinnerTeam.GetFormattedName() + " scored a point! Payload respawning...";
UtilTextMiddle.display("", message, 10, 20, 10);
UtilServer.broadcast(message);
}
displayPointScoreEffect();
for (Player player : UtilServer.getPlayers())
@ -1073,7 +1071,7 @@ public class QuiverPayload extends TeamGame
}
Player player = event.getPlayer();
Kit kit = GetKit(player);
ProgressingKit kit = (ProgressingKit) GetKit(player);
if (!event.isSneaking())
{
@ -1090,23 +1088,26 @@ public class QuiverPayload extends TeamGame
return;
}
for (Perk perk : kit.GetPerks())
for (Perk perk : kit.getPerks()[kit.getUpgradeLevel(player.getUniqueId())])
{
if (perk instanceof Ultimate)
{
Ultimate ultimate = (Ultimate) perk;
if (ultimate.isUsable(player))
{
ultimate.activate(player);
resetUltimate(player, false);
}
}
}
}
public void incrementUltimate(Player player, double percentage)
{
Kit kit = GetKit(player);
ProgressingKit kit = (ProgressingKit) GetKit(player);
for (Perk perk : kit.GetPerks())
for (Perk perk : kit.getPerks()[kit.getUpgradeLevel(player.getUniqueId())])
{
if (perk instanceof Ultimate)
{

View File

@ -38,32 +38,32 @@ public class KitNecromancer extends ProgressingKit
private static final Perk[][] PERKS = {
{
new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true),
new PerkLifestealArrows(4),
new PerkLifestealArrows(8),
new UltimateNecromancer(10000, 3)
},
{
new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true),
new PerkLifestealArrows(4),
new PerkLifestealArrows(8),
new UltimateNecromancer(10500, 3)
},
{
new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true),
new PerkLifestealArrows(4),
new PerkLifestealArrows(8),
new UltimateNecromancer(11000, 3)
},
{
new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true),
new PerkLifestealArrows(4),
new PerkLifestealArrows(8),
new UltimateNecromancer(11500, 3)
},
{
new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true),
new PerkLifestealArrows(4),
new PerkLifestealArrows(8),
new UltimateNecromancer(12000, 3)
},
{
new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true),
new PerkLifestealArrows(4),
new PerkLifestealArrows(8),
new UltimateNecromancer(12500, 3)
}
};

View File

@ -1,4 +1,4 @@
package nautilus.game.arcade.game.games.quiver.kits;
package nautilus.game.arcade.game.games.quiver.kits;
import java.util.UUID;
@ -52,33 +52,33 @@ public class KitSkyWarrior extends ProgressingKit
private static final Perk[][] PERKS = {
{
new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true),
new PerkSpeed(1),
new UltimateSkyWarrior(2, 10, 10, 5, 30)
new PerkSpeed(0),
new UltimateSkyWarrior(5, 10, 10, 5, 30)
},
{
new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true),
new PerkSpeed(1),
new UltimateSkyWarrior(2, 10, 10, 5, 30)
new PerkSpeed(0),
new UltimateSkyWarrior(5, 10, 10, 5, 30)
},
{
new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true),
new PerkSpeed(1),
new UltimateSkyWarrior(2, 10, 10, 5, 30)
new PerkSpeed(0),
new UltimateSkyWarrior(5, 10, 10, 5, 30)
},
{
new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true),
new PerkSpeed(1),
new UltimateSkyWarrior(2, 10, 10, 5, 30)
new PerkSpeed(0),
new UltimateSkyWarrior(5, 10, 10, 5, 30)
},
{
new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true),
new PerkSpeed(1),
new UltimateSkyWarrior(2, 10, 10, 5, 30)
new PerkSpeed(0),
new UltimateSkyWarrior(5, 10, 10, 5, 30)
},
{
new PerkDoubleJump(DOUBLE_JUMP, 0.9, 0.9, true),
new PerkSpeed(1),
new UltimateSkyWarrior(2, 10, 10, 5, 30)
new PerkSpeed(0),
new UltimateSkyWarrior(5, 10, 10, 5, 30)
}
};

View File

@ -58,6 +58,11 @@ public abstract class Ultimate extends Perk
player.playSound(player.getLocation(), Sound.BLAZE_DEATH, 1, 0);
}
public boolean isUsable(Player player)
{
return true;
}
public abstract double getChargeIncreasePerSecond();
public abstract long getLength();

View File

@ -37,7 +37,7 @@ public class UltimateNecromancer extends Ultimate
public UltimateNecromancer(long length, int skeletons)
{
super("Undead Minions", new String[] {});
super("Summon Undead", new String[] {});
_length = length;
_skeletons = skeletons;

View File

@ -17,13 +17,13 @@ public class UltimateNinja extends Ultimate
{
private static final double CHARGE_PER_SECOND = 0.4;
private static final int SPEED_AMPLIFiER = 1;
private static final int SPEED_AMPLIFIER = 1;
private long _length;
public UltimateNinja(long length)
{
super("Blood Forge", new String[] {});
super("Ancient Blade", new String[] {});
_length = length;
}
@ -49,7 +49,7 @@ public class UltimateNinja extends Ultimate
super.activate(player);
player.getInventory().setItem(0, new ItemStack(Material.DIAMOND_SWORD));
player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, (int) ((_length / 1000) * 20), SPEED_AMPLIFiER));
player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, (int) ((_length / 1000) * 20), SPEED_AMPLIFIER));
UtilParticle.PlayParticleToAll(ParticleType.FIREWORKS_SPARK, player.getEyeLocation(), 0, 0, 0, 1F, 100, ViewDist.NORMAL);
}

View File

@ -25,7 +25,7 @@ public class UltimatePyromancer extends Ultimate
public UltimatePyromancer()
{
super("Flare Blitz", new String[] {});
super("Pincushion", new String[] {});
}
@Override

View File

@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.util.List;
import org.bukkit.FireworkEffect.Type;
import org.bukkit.Color;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
@ -17,16 +16,20 @@ import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.util.Vector;
import com.google.common.collect.Sets;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.particles.effects.LineParticle;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
@ -38,7 +41,9 @@ public class UltimateSkyWarrior extends Ultimate
{
private static final double CHARGE_PER_SECOND = 0.4;
private static final long LAUNCHER_FIRE_DELAY = 1000;
private static final long LAUNCHER_FIRE_DELAY = 500;
private static final long LAUNCHER_MAX_TIME = 15000;
private static final int Y_INCREASE = 10;
private double _damageTeleport;
private double _radiusTeleport;
@ -50,7 +55,7 @@ public class UltimateSkyWarrior extends Ultimate
public UltimateSkyWarrior(double damageTeleport, double radiusTeleport, double damageLauncher, double radiusLauncher, int rangeLauncher)
{
super("Astral Arrows", new String[] {});
super("Bombardment", new String[] {});
_damageTeleport = damageTeleport;
_radiusTeleport = radiusTeleport;
@ -67,7 +72,7 @@ public class UltimateSkyWarrior extends Ultimate
Location playerLocation = player.getLocation();
// This is to stop the players getting killed by the border if they were
// teleported above it.
Location toTeleport = new Location(player.getWorld(), playerLocation.getX(), Math.min(Manager.GetGame().WorldData.MaxY - 3, playerLocation.getY() + 10), playerLocation.getZ());
Location toTeleport = new Location(player.getWorld(), playerLocation.getX(), Math.min(Manager.GetGame().WorldData.MaxY - 3, playerLocation.getY() + Y_INCREASE), playerLocation.getZ());
toTeleport.setYaw(playerLocation.getYaw());
toTeleport.setPitch(playerLocation.getPitch());
@ -79,7 +84,7 @@ public class UltimateSkyWarrior extends Ultimate
player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, Integer.MAX_VALUE, -10));
player.teleport(toTeleport);
_data.add(new SkyWarriorData(player, block, 3));
_data.add(new SkyWarriorData(player, block, 3, UtilInv.getAmount(player, Material.ARROW), System.currentTimeMillis()));
player.getInventory().clear();
@ -90,23 +95,33 @@ public class UltimateSkyWarrior extends Ultimate
player.getInventory().addItem(itemStack);
}
UtilFirework.playFirework(playerLocation, Type.BALL_LARGE, Color.WHITE, false, false);
UtilFirework.playFirework(toTeleport, Type.BALL_LARGE, Color.WHITE, false, false);
Game game = Manager.GetGame();
UtilFirework.playFirework(playerLocation, Type.BALL, game.GetTeam(player).GetColorBase(), false, false);
UtilFirework.playFirework(toTeleport, Type.BALL, game.GetTeam(player).GetColorBase(), false, false);
}
@EventHandler
public void onUpdate(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
if (event.getType() == UpdateType.TICK)
{
return;
}
for (SkyWarriorData data : _data)
{
UtilParticle.PlayParticleToAll(ParticleType.CLOUD, data.getPlayer().getLocation().subtract(0, 0.5, 0), 0.5F, 0.25F, 0.5F, 0.01F, 6, ViewDist.MAX);
}
}
else if (event.getType() == UpdateType.FAST)
{
for (SkyWarriorData data : _data)
{
if (UtilTime.elapsed(data.getStartTimeStamp(), LAUNCHER_MAX_TIME))
{
cancel(data.getPlayer());
}
}
}
}
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event)
@ -124,53 +139,25 @@ public class UltimateSkyWarrior extends Ultimate
return;
}
if (!Recharge.Instance.use(player, "Sky Launcher", LAUNCHER_FIRE_DELAY, true, false))
if (!Recharge.Instance.use(player, GetName(), LAUNCHER_FIRE_DELAY, true, false))
{
return;
}
player.getWorld().playSound(player.getLocation(), Sound.FIREWORK_BLAST, 5, 1);
// Particle Trail
Block lastParticle = player.getLocation().getBlock();
LineParticle lineParticle = new LineParticle(player.getEyeLocation(), player.getLocation().getDirection(), 0.5, _rangeLauncher, Sets.newHashSet(Material.BARRIER), ParticleType.FIREWORKS_SPARK, UtilServer.getPlayers());
double curRange = 0;
while (curRange <= _rangeLauncher)
while (!lineParticle.update())
{
Location newTarget = player.getLocation().add(new Vector(0, 0.2, 0)).add(player.getLocation().getDirection().multiply(curRange));
if (!UtilBlock.airFoliage(newTarget.getBlock()) || !UtilBlock.airFoliage(newTarget.getBlock().getRelative(BlockFace.UP)))
{
if (newTarget.getBlock().getType() != Material.BARRIER)
{
break;
}
}
// Progress Forwards
curRange += 0.2;
// Particles
if (!lastParticle.equals(newTarget.getBlock()))
{
UtilParticle.PlayParticleToAll(ParticleType.FIREWORKS_SPARK, lastParticle.getLocation(), 0, 0, 0, 0.001F, 1, ViewDist.LONG);
}
lastParticle = newTarget.getBlock();
}
// Modify Range
curRange -= 0.4;
if (curRange < 0)
curRange = 0;
// Destination
Location location = player.getLocation().add(player.getLocation().getDirection().multiply(curRange).add(new Vector(0, 0.4, 0)));
Location location = lineParticle.getDestination();
// Damage Players
for (Player other : UtilPlayer.getNearby(location, _radiusLauncher))
{
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, _damageLauncher, true, true, false, player.getName(), GetName() + " Launcher");
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, _damageLauncher, true, true, false, player.getName(), GetName());
}
UtilParticle.PlayParticleToAll(ParticleType.HUGE_EXPLOSION, location, 0, 0, 0, 1F, 1, ViewDist.LONG);
@ -190,7 +177,6 @@ public class UltimateSkyWarrior extends Ultimate
player.getInventory().clear();
Kit.GiveItems(player);
player.getInventory().addItem(Quiver.SUPER_ARROW);
player.setWalkSpeed(0.2F);
player.removePotionEffect(PotionEffectType.JUMP);
@ -200,6 +186,11 @@ public class UltimateSkyWarrior extends Ultimate
data.getBlock().setType(Material.AIR);
for (int i = 0; i < data.getPreviousArrows(); i++)
{
player.getInventory().addItem(Quiver.SUPER_ARROW);
}
boolean found = false;
for (Player other : game.GetPlayers(true))
@ -211,10 +202,10 @@ public class UltimateSkyWarrior extends Ultimate
if (game.GetTeam(player).equals(game.GetTeam(other)))
{
UtilParticle.PlayParticleToAll(ParticleType.FLAME, player.getEyeLocation(), 0.5F, 0.5F, 0.5F, 1F, 20, ViewDist.LONG);
UtilParticle.PlayParticleToAll(ParticleType.FLAME, other.getEyeLocation(), 0.5F, 0.5F, 0.5F, 1F, 20, ViewDist.LONG);
player.sendMessage(F.main("Game", "You were teleported to " + other.getName()));
player.sendMessage(F.main("Game", "You were teleported to " + F.elem(other.getName()) + "."));
player.teleport(other);
other.getWorld().strikeLightningEffect(other.getLocation());
UtilFirework.playFirework(other.getLocation(), Type.STAR, game.GetTeam(player).GetColorBase(), false, false);
for (Player toDamage : UtilPlayer.getNearby(other.getEyeLocation(), _radiusTeleport))
{
@ -234,6 +225,21 @@ public class UltimateSkyWarrior extends Ultimate
_data.remove(data);
}
@Override
public boolean isUsable(Player player)
{
for (int i = 2; i <= Y_INCREASE; i++)
{
if (player.getLocation().add(0, i, 0).getBlock().getType() != Material.AIR)
{
player.sendMessage(F.main("Game", "You do not have enough room to use this!"));;
return false;
}
}
return true;
}
@Override
public double getChargeIncreasePerSecond()
{
@ -265,12 +271,16 @@ public class UltimateSkyWarrior extends Ultimate
private Player _player;
private Block _block;
private int _shotsLeft;
private int _previousArrows;
private long _startTimeStamp;
public SkyWarriorData(Player player, Block block, int shots)
public SkyWarriorData(Player player, Block block, int shots, int previousArrows, long startTimeStamp)
{
_player = player;
_block = block;
_shotsLeft = shots;
_previousArrows = previousArrows;
_startTimeStamp = startTimeStamp;
}
public void setShotsLeft(int slotsLeft)
@ -293,5 +303,15 @@ public class UltimateSkyWarrior extends Ultimate
return _shotsLeft;
}
public int getPreviousArrows()
{
return _previousArrows;
}
public long getStartTimeStamp()
{
return _startTimeStamp;
}
}
}