diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfBlink.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfBlink.java index 195dc849c..835973ead 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfBlink.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfBlink.java @@ -21,7 +21,10 @@ package com.shatteredpixel.shatteredpixeldungeon.items.stones; +import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; +import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; public class StoneOfBlink extends Runestone { @@ -30,6 +33,23 @@ public class StoneOfBlink extends Runestone { image = ItemSpriteSheet.STONE_SOWILO; } + private static Ballistica throwPath; + + @Override + public int throwPos(Hero user, int dst) { + throwPath = new Ballistica( user.pos, dst, Ballistica.PROJECTILE ); + return throwPath.collisionPos; + } + + @Override + protected void onThrow(int cell) { + if (Actor.findChar(cell) != null && throwPath.dist >= 1){ + cell = throwPath.path.get(throwPath.dist-1); + } + throwPath = null; + super.onThrow(cell); + } + @Override protected void activate(int cell) { ScrollOfTeleportation.teleportToLocation(curUser, cell); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfFlock.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfFlock.java index e4445aa96..1c685ca1a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfFlock.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfFlock.java @@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; import com.watabou.utils.PathFinder; +import com.watabou.utils.Random; public class StoneOfFlock extends Runestone { @@ -48,7 +49,7 @@ public class StoneOfFlock extends Runestone { && Actor.findChar(cell + i) == null) { Sheep sheep = new Sheep(); - sheep.lifespan = 10; + sheep.lifespan = Random.IntRange(5, 8); sheep.pos = cell + i; GameScene.add(sheep); Dungeon.level.press(sheep.pos, sheep);