v0.7.0: fixed bugs with stone of blink, nerfed stone of flock

This commit is contained in:
Evan Debenham 2018-06-19 18:03:55 -04:00
parent 53aac008f8
commit e5f15157df
2 changed files with 22 additions and 1 deletions

View File

@ -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);

View File

@ -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);