Fire burst is now instant

This commit is contained in:
Sam 2016-08-11 14:26:25 +01:00
parent e05f90372a
commit 60a46c8c10
1 changed files with 31 additions and 47 deletions

View File

@ -7,21 +7,20 @@ import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action; import org.bukkit.event.block.Action;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilTime.TimeUnit;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilTime.TimeUnit;
import mineplex.core.recharge.Recharge; import mineplex.core.recharge.Recharge;
import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.Perk;
@ -29,7 +28,7 @@ public class PerkFireBurst extends Perk
{ {
private static final int FIRE_TICKS = 60; private static final int FIRE_TICKS = 60;
private static final double LOCATION_Y_MODIFER = 0.25; private static final double LOCATION_Y_MODIFER = 1;
private long _cooldown; private long _cooldown;
private double _range; private double _range;
@ -41,8 +40,7 @@ public class PerkFireBurst extends Perk
C.cYellow + "Right Click" + C.cGray + " with Blaze Rod to use " + C.cGreen + "Fire Burst", C.cYellow + "Right Click" + C.cGray + " with Blaze Rod to use " + C.cGreen + "Fire Burst",
"Sends out a pulse of fire that deals " + C.cGreen + damage + C.cGray + " damage to", "Sends out a pulse of fire that deals " + C.cGreen + damage + C.cGray + " damage to",
"all players within " + C.cGreen + range + C.cGray + " blocks.", "all players within " + C.cGreen + range + C.cGray + " blocks.",
"Cooldown " + C.cGreen + UtilTime.convertString(cooldown, 0, TimeUnit.SECONDS) + C.cGray + "." "Cooldown " + C.cGreen + UtilTime.convertString(cooldown, 0, TimeUnit.SECONDS) + C.cGray + "." });
});
_cooldown = cooldown; _cooldown = cooldown;
_range = range; _range = range;
@ -89,38 +87,24 @@ public class PerkFireBurst extends Perk
} }
other.setFireTicks(FIRE_TICKS); other.setFireTicks(FIRE_TICKS);
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, _damage, true, false, true, player.getName(), GetName()); Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, _damage, true, true, true, player.getName(), GetName());
} }
new BukkitRunnable() for (double radius = 0; radius < _range; radius += 0.4)
{ {
for (double theta = 0; theta < 2 * Math.PI; theta += Math.PI / 20)
double curRange = 0;
@Override
public void run()
{ {
if (curRange >= _range) double x = radius * Math.cos(theta);
{ double z = radius * Math.sin(theta);
cancel();
return;
}
for (double theta = 0; theta < 2 * Math.PI; theta += Math.PI / 20) location.add(x, 0, z);
{
double x = curRange * Math.cos(theta);
double z = curRange * Math.sin(theta);
location.add(x, 0, z); UtilParticle.PlayParticleToAll(ParticleType.FLAME, location, 0, 0, 0, 0.01F, 1, ViewDist.NORMAL);
UtilParticle.PlayParticleToAll(ParticleType.FLAME, location, 0, 0, 0, 0.01F, 1, ViewDist.NORMAL); location.subtract(x, 0, z);
location.subtract(x, 0, z);
}
curRange += 0.5;
} }
}.runTaskTimer(Manager.getPlugin(), 0, 3); }
} }
@EventHandler @EventHandler