Fix AirSwipe charged version

This commit is contained in:
Benford 2016-03-28 23:53:21 -04:00
parent b251971e2f
commit c4c12c45e8

View file

@ -63,7 +63,6 @@ public class AirSwipe extends AirAbility {
ability = this; ability = this;
this.charging = charging; this.charging = charging;
this.origin = player.getEyeLocation(); this.origin = player.getEyeLocation();
this.charging = false;
this.particles = getConfig().getInt("Abilities.Air.AirSwipe.Particles"); this.particles = getConfig().getInt("Abilities.Air.AirSwipe.Particles");
this.arc = getConfig().getInt("Abilities.Air.AirSwipe.Arc"); this.arc = getConfig().getInt("Abilities.Air.AirSwipe.Arc");
this.stepSize = getConfig().getInt("Abilities.Air.AirSwipe.StepSize"); this.stepSize = getConfig().getInt("Abilities.Air.AirSwipe.StepSize");
@ -74,12 +73,18 @@ public class AirSwipe extends AirAbility {
this.speed = getConfig().getDouble("Abilities.Air.AirSwipe.Speed") * (ProjectKorra.time_step / 1000.0); this.speed = getConfig().getDouble("Abilities.Air.AirSwipe.Speed") * (ProjectKorra.time_step / 1000.0);
this.range = getConfig().getDouble("Abilities.Air.AirSwipe.Range"); this.range = getConfig().getDouble("Abilities.Air.AirSwipe.Range");
this.radius = getConfig().getDouble("Abilities.Air.AirSwipe.Radius"); this.radius = getConfig().getDouble("Abilities.Air.AirSwipe.Radius");
this.maxChargeFactor = getConfig().getDouble("Abilities.Air.AirSwipe.chargeFactor"); this.maxChargeFactor = getConfig().getDouble("Abilities.Air.AirSwipe.ChargeFactor");
this.random = new Random(); this.random = new Random();
this.elements = new ConcurrentHashMap<>(); this.elements = new ConcurrentHashMap<>();
this.affectedEntities = new ArrayList<>(); this.affectedEntities = new ArrayList<>();
if (bPlayer.isOnCooldown(this) || player.getEyeLocation().getBlock().isLiquid()) { if (bPlayer.isOnCooldown(this) || player.getEyeLocation().getBlock().isLiquid()) {
remove();
return;
}
if (!bPlayer.canBend(this)) {
remove();
return; return;
} }
@ -255,7 +260,6 @@ public class AirSwipe extends AirAbility {
remove(); remove();
return; return;
} }
if (!charging) { if (!charging) {
if (elements.isEmpty()) { if (elements.isEmpty()) {
remove(); remove();
@ -263,11 +267,6 @@ public class AirSwipe extends AirAbility {
} }
advanceSwipe(); advanceSwipe();
} else { } else {
if (!bPlayer.canBend(this)) {
remove();
return;
}
if (!player.isSneaking()) { if (!player.isSneaking()) {
double factor = 1; double factor = 1;
if (System.currentTimeMillis() >= startTime + maxChargeTime) { if (System.currentTimeMillis() >= startTime + maxChargeTime) {
@ -283,7 +282,6 @@ public class AirSwipe extends AirAbility {
factor = Math.max(1, factor); factor = Math.max(1, factor);
damage *= factor; damage *= factor;
pushFactor *= factor; pushFactor *= factor;
return;
} else if (System.currentTimeMillis() >= startTime + maxChargeTime) { } else if (System.currentTimeMillis() >= startTime + maxChargeTime) {
playAirbendingParticles(player.getEyeLocation(), particles); playAirbendingParticles(player.getEyeLocation(), particles);
} }