v2.4.0: fixed cases of runestones affecting terrain when they shouldn't
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.stones;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
@@ -33,16 +34,15 @@ public abstract class Runestone extends Item {
|
||||
defaultAction = AC_THROW;
|
||||
}
|
||||
|
||||
//runestones press the cell they're thrown to by default, but a couple stones override this
|
||||
protected boolean pressesCell = true;
|
||||
|
||||
@Override
|
||||
protected void onThrow(int cell) {
|
||||
if (Dungeon.level.pit[cell] || !defaultAction().equals(AC_THROW)){
|
||||
///inventory stones are thrown like normal items, other stones don't trigger when thrown into pits
|
||||
if (this instanceof InventoryStone ||
|
||||
(Dungeon.level.pit[cell] && Actor.findChar(cell) == null)){
|
||||
super.onThrow( cell );
|
||||
} else {
|
||||
if (pressesCell) Dungeon.level.pressCell( cell );
|
||||
activate(cell);
|
||||
if (Actor.findChar(cell) == null) Dungeon.level.pressCell( cell );
|
||||
Invisibility.dispel();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,9 +41,6 @@ public class StoneOfDisarming extends Runestone {
|
||||
|
||||
{
|
||||
image = ItemSpriteSheet.STONE_DISARM;
|
||||
|
||||
//so traps do not activate before the effect
|
||||
pressesCell = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,9 +39,6 @@ public class StoneOfFlock extends Runestone {
|
||||
|
||||
{
|
||||
image = ItemSpriteSheet.STONE_FLOCK;
|
||||
|
||||
//the sheep will press the cell instead
|
||||
pressesCell = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user