v0.9.3a: runestones now press cells when thrown

This commit is contained in:
Evan Debenham 2021-06-11 21:05:13 -04:00
parent e80bc2c1c0
commit 082c2393cb
2 changed files with 15 additions and 1 deletions

View File

@ -38,6 +38,7 @@ public abstract class Runestone extends Item {
if (Dungeon.level.pit[cell] || !defaultAction.equals(AC_THROW)){
super.onThrow( cell );
} else {
Dungeon.level.pressCell( cell );
activate(cell);
Invisibility.dispel();
}

View File

@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.stones;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap;
@ -43,7 +44,19 @@ public class StoneOfDisarming extends Runestone {
{
image = ItemSpriteSheet.STONE_DISARM;
}
@Override
protected void onThrow(int cell) {
//This runestone uniquely presses cells after its effect resolves, instead of before
if (Dungeon.level.pit[cell] || !defaultAction.equals(AC_THROW)){
super.onThrow( cell );
} else {
activate(cell);
Invisibility.dispel();
Dungeon.level.pressCell( cell );
}
}
@Override
protected void activate(final int cell) {
boolean[] FOV = new boolean[Dungeon.level.length()];