v2.0.0: rippers now still leap if their target is blocked by terrain
This commit is contained in:
+4
-3
@@ -137,14 +137,15 @@ public class RipperDemon extends Mob {
|
|||||||
if (leapPos != -1){
|
if (leapPos != -1){
|
||||||
|
|
||||||
leapCooldown = Random.NormalIntRange(2, 4);
|
leapCooldown = Random.NormalIntRange(2, 4);
|
||||||
Ballistica b = new Ballistica(pos, leapPos, Ballistica.STOP_TARGET | Ballistica.STOP_SOLID);
|
|
||||||
|
|
||||||
//check if leap pos is not obstructed by terrain
|
if (rooted){
|
||||||
if (rooted || b.collisionPos != leapPos){
|
|
||||||
leapPos = -1;
|
leapPos = -1;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ballistica b = new Ballistica(pos, leapPos, Ballistica.STOP_TARGET | Ballistica.STOP_SOLID);
|
||||||
|
leapPos = b.collisionPos;
|
||||||
|
|
||||||
final Char leapVictim = Actor.findChar(leapPos);
|
final Char leapVictim = Actor.findChar(leapPos);
|
||||||
final int endPos;
|
final int endPos;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user