v2.3.0: phantom piranhas now die on land if there is no open water
This commit is contained in:
+8
-2
@@ -85,10 +85,12 @@ public class PhantomPiranha extends Piranha {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dieOnLand() {
|
public void dieOnLand() {
|
||||||
teleportAway();
|
if (!teleportAway()){
|
||||||
|
super.dieOnLand();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void teleportAway(){
|
private boolean teleportAway(){
|
||||||
|
|
||||||
ArrayList<Integer> inFOVCandidates = new ArrayList<>();
|
ArrayList<Integer> inFOVCandidates = new ArrayList<>();
|
||||||
ArrayList<Integer> outFOVCandidates = new ArrayList<>();
|
ArrayList<Integer> outFOVCandidates = new ArrayList<>();
|
||||||
@@ -105,9 +107,13 @@ public class PhantomPiranha extends Piranha {
|
|||||||
if (!outFOVCandidates.isEmpty()){
|
if (!outFOVCandidates.isEmpty()){
|
||||||
if (Dungeon.level.heroFOV[pos]) GLog.i(Messages.get(this, "teleport_away"));
|
if (Dungeon.level.heroFOV[pos]) GLog.i(Messages.get(this, "teleport_away"));
|
||||||
ScrollOfTeleportation.appear(this, Random.element(outFOVCandidates));
|
ScrollOfTeleportation.appear(this, Random.element(outFOVCandidates));
|
||||||
|
return true;
|
||||||
} else if (!inFOVCandidates.isEmpty()){
|
} else if (!inFOVCandidates.isEmpty()){
|
||||||
ScrollOfTeleportation.appear(this, Random.element(inFOVCandidates));
|
ScrollOfTeleportation.appear(this, Random.element(inFOVCandidates));
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user