diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/effects/Pushing.java b/src/com/shatteredpixel/shatteredpixeldungeon/effects/Pushing.java index 88b3222fc..e5334cc0a 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/effects/Pushing.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/effects/Pushing.java @@ -22,6 +22,7 @@ import com.watabou.noosa.Visual; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; +import com.watabou.utils.Callback; import com.watabou.utils.PointF; public class Pushing extends Actor { @@ -32,6 +33,8 @@ public class Pushing extends Actor { private Effect effect; + private Callback callback; + { actPriority = Integer.MIN_VALUE; //it's a visual effect, gets priority no matter what } @@ -40,6 +43,12 @@ public class Pushing extends Actor { sprite = ch.sprite; this.from = from; this.to = to; + this.callback = null; + } + + public Pushing( Char ch, int from, int to, Callback callback ) { + this(ch, from, to); + this.callback = callback; } @Override @@ -96,10 +105,11 @@ public class Pushing extends Actor { } else { - sprite.point( end ); + sprite.point(end); killAndErase(); - Actor.remove( Pushing.this ); + Actor.remove(Pushing.this); + if (callback != null) callback.call(); next(); } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/EtherealChains.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/EtherealChains.java index c58ee1e00..035503395 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/EtherealChains.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/EtherealChains.java @@ -126,11 +126,14 @@ public class EtherealChains extends Artifact { curUser.busy(); curUser.sprite.parent.add(new Chains(curUser.pos, target, new Callback() { public void call() { - Actor.add(new Pushing(curUser, curUser.pos, newHeroPos)); + Actor.add(new Pushing(curUser, curUser.pos, newHeroPos, new Callback() { + public void call() { + Dungeon.level.press(newHeroPos, curUser); + } + })); + curUser.spendAndNext(1f); curUser.pos = newHeroPos; Dungeon.observe(); - curUser.spendAndNext(1f); - Dungeon.level.press(newHeroPos, curUser); } })); }