earthpillars bug + earthblast & iceblast improvements (#988)

## Additions
* Improved earthblast and iceblast aiming.

## Fixes
* Fixed earthpillars bug where using the ability while not around entities creates a loop until the player is around other entities.
This commit is contained in:
Benford Whitaker 2019-06-22 18:31:10 -04:00 committed by Christopher Martin
parent e757cea57a
commit 3d9f99bc57
3 changed files with 20 additions and 9 deletions

View file

@ -364,15 +364,25 @@ public class EarthBlast extends EarthAbility {
}
final Entity target = GeneralMethods.getTargetedEntity(this.player, this.range, new ArrayList<Entity>());
if (target == null) {
this.destination = this.getTargetEarthBlock((int) this.range).getLocation();
this.firstDestination = this.sourceBlock.getLocation().clone();
this.firstDestination.setY(this.destination.getY());
if (target != null) {
this.destination = target.getLocation();
} else {
this.destination = ((LivingEntity) target).getEyeLocation();
this.firstDestination = this.sourceBlock.getLocation().clone();
this.firstDestination.setY(this.destination.getY());
this.destination = GeneralMethods.getPointOnLine(this.firstDestination, this.destination, this.range);
this.destination = getTargetLocation();
}
if (this.sourceBlock == null) {
return;
}
this.location = this.sourceBlock.getLocation();
if (this.destination.distanceSquared(this.location) < 1) {
return;
}
this.firstDestination = this.location.clone();
if (this.destination.getY() - this.location.getY() > 2) {
this.firstDestination.setY(this.destination.getY() - 1);
} else {
this.firstDestination.add(0, 2, 0);
}
if (this.destination.distanceSquared(this.location) <= 1) {

View file

@ -86,6 +86,7 @@ public class EarthPillars extends EarthAbility implements ComboAbility {
}
if (this.entities.isEmpty()) {
remove();
return;
}
firstTime = false;

View file

@ -257,7 +257,7 @@ public class IceSpikeBlast extends IceAbility {
if (target == null) {
this.destination = GeneralMethods.getTargetedLocation(this.player, this.range, true, getTransparentMaterials());
} else {
this.destination = target.getEyeLocation();
this.destination = target.getLocation();
}
if (this.sourceBlock == null) {