v0.9.2b: fixed combo leap placing glad onto visible traps or chasms

This commit is contained in:
Evan Debenham
2021-03-18 16:55:05 -04:00
parent 3b1d93abef
commit 8c51d26a0a
@@ -455,22 +455,27 @@ public class Combo extends Buff implements ActionIndicator.Action {
} else { } else {
Ballistica c = new Ballistica(target.pos, enemy.pos, Ballistica.PROJECTILE); Ballistica c = new Ballistica(target.pos, enemy.pos, Ballistica.PROJECTILE);
if (c.collisionPos == enemy.pos){ if (c.collisionPos == enemy.pos){
Dungeon.hero.busy(); final int leapPos = c.path.get(c.dist-1);
target.sprite.jump(target.pos, c.path.get(c.dist-1), new Callback() { if (!Dungeon.level.passable[leapPos]){
@Override GLog.w(Messages.get(Combo.class, "bad_target"));
public void call() { } else {
target.move(c.path.get(c.dist-1)); Dungeon.hero.busy();
Dungeon.level.occupyCell(target); target.sprite.jump(target.pos, leapPos, new Callback() {
Dungeon.observe(); @Override
GameScene.updateFog(); public void call() {
target.sprite.attack(cell, new Callback() { target.move(leapPos);
@Override Dungeon.level.occupyCell(target);
public void call() { Dungeon.observe();
doAttack(enemy); GameScene.updateFog();
} target.sprite.attack(cell, new Callback() {
}); @Override
} public void call() {
}); doAttack(enemy);
}
});
}
});
}
} else { } else {
GLog.w(Messages.get(Combo.class, "bad_target")); GLog.w(Messages.get(Combo.class, "bad_target"));
} }