Various fixes (#545)

* Fix SandSpout creation from EarthPassive sand

* Fixed WaterCombo IceWave not applying cooldown to WaterWave
This commit is contained in:
Matt 2016-08-15 15:10:16 -04:00 committed by OmniCypher
parent 4cccc6e527
commit 3c09394c53
3 changed files with 25 additions and 8 deletions

View file

@ -60,6 +60,10 @@ public class SandSpout extends SandAbility {
return; return;
} }
if (EarthPassive.isPassiveSand(topBlock)) {
return;
}
flight = new Flight(player); flight = new Flight(player);
start(); start();
bPlayer.addCooldown(this); bPlayer.addCooldown(this);
@ -80,6 +84,12 @@ public class SandSpout extends SandAbility {
} }
Block block = getGround(); Block block = getGround();
if (EarthPassive.isPassiveSand(block)) {
remove();
return;
}
if (block != null && (block.getType() == Material.SAND || block.getType() == Material.SANDSTONE || block.getType() == Material.RED_SANDSTONE)) { if (block != null && (block.getType() == Material.SAND || block.getType() == Material.SANDSTONE || block.getType() == Material.RED_SANDSTONE)) {
double dy = player.getLocation().getY() - block.getY(); double dy = player.getLocation().getY() - block.getY();
if (dy > height) { if (dy > height) {

View file

@ -75,6 +75,12 @@ public class WaterCombo extends IceAbility implements ComboAbility {
} }
if (name.equalsIgnoreCase("IceWave")) { if (name.equalsIgnoreCase("IceWave")) {
if (bPlayer.isOnCooldown("IceWave") && !bPlayer.isAvatarState()) {
remove();
return;
}
this.cooldown = getConfig().getLong("Abilities.Water.WaterCombo.IceWave.Cooldown"); this.cooldown = getConfig().getLong("Abilities.Water.WaterCombo.IceWave.Cooldown");
} else if (name.equalsIgnoreCase("IceBullet")) { } else if (name.equalsIgnoreCase("IceBullet")) {
this.damage = getConfig().getDouble("Abilities.Water.WaterCombo.IceBullet.Damage"); this.damage = getConfig().getDouble("Abilities.Water.WaterCombo.IceBullet.Damage");
@ -205,13 +211,9 @@ public class WaterCombo extends IceAbility implements ComboAbility {
return; return;
} else if (name.equalsIgnoreCase("IceWave")) { } else if (name.equalsIgnoreCase("IceWave")) {
if (origin == null && WaterSpoutWave.containsType(player, WaterSpoutWave.AbilityType.RELEASE)) { if (origin == null && WaterSpoutWave.containsType(player, WaterSpoutWave.AbilityType.RELEASE)) {
if (bPlayer.isOnCooldown("IceWave") && !bPlayer.isAvatarState()) {
remove();
return;
}
bPlayer.addCooldown("IceWave", cooldown); bPlayer.addCooldown("IceWave", cooldown);
origin = player.getLocation(); origin = player.getLocation();
WaterSpoutWave wave = WaterSpoutWave.getType(player, WaterSpoutWave.AbilityType.RELEASE).get(0); WaterSpoutWave wave = WaterSpoutWave.getType(player, WaterSpoutWave.AbilityType.RELEASE).get(0);
wave.setIceWave(true); wave.setIceWave(true);
} else if (!WaterSpoutWave.containsType(player, WaterSpoutWave.AbilityType.RELEASE)) { } else if (!WaterSpoutWave.containsType(player, WaterSpoutWave.AbilityType.RELEASE)) {
@ -305,7 +307,12 @@ public class WaterCombo extends IceAbility implements ComboAbility {
if (waterGrabber != null) { if (waterGrabber != null) {
waterGrabber.remove(); waterGrabber.remove();
} }
bPlayer.addCooldown(this); bPlayer.addCooldown(this);
if (name == "IceWave") {
bPlayer.addCooldown("WaterWave", getConfig().getLong("Abilities.Water.WaterSpout.Wave.Cooldown"));
}
} }
public void revertBlocks() { public void revertBlocks() {
@ -564,4 +571,4 @@ public class WaterCombo extends IceAbility implements ComboAbility {
} }
} }

View file

@ -449,7 +449,7 @@ public class WaterSpoutWave extends WaterAbility {
@Override @Override
public String getName() { public String getName() {
return this.isIceWave() ? "IceWave" : "WaterSpout"; return "WaterSpout";
} }
@Override @Override
@ -645,4 +645,4 @@ public class WaterSpoutWave extends WaterAbility {
this.location = location; this.location = location;
} }
} }