v0.9.1: fixed stone of intuition being usable on rings with known types

This commit is contained in:
Evan Debenham 2020-12-05 14:54:19 -05:00
parent 13a2ada076
commit aa7e8de37d
2 changed files with 15 additions and 4 deletions

View File

@ -50,9 +50,20 @@ public class StoneOfIntuition extends InventoryStone {
{
mode = WndBag.Mode.UNIDED_POTION_OR_SCROLL;
mode = WndBag.Mode.INTUITIONABLE;
image = ItemSpriteSheet.STONE_INTUITION;
}
public static boolean isIntuitionable( Item item ){
if (item instanceof Ring){
return !((Ring) item).isKnown();
} else if (item instanceof Potion){
return !((Potion) item).isKnown();
} else if (item instanceof Scroll){
return !((Scroll) item).isKnown();
}
return false;
}
@Override
protected void onItemSelected(Item item) {

View File

@ -40,11 +40,11 @@ import com.shatteredpixel.shatteredpixeldungeon.items.bags.ScrollHolder;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.VelvetPouch;
import com.shatteredpixel.shatteredpixeldungeon.items.food.Food;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRemoveCurse;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTransmutation;
import com.shatteredpixel.shatteredpixeldungeon.items.spells.Recycle;
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfIntuition;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
@ -88,7 +88,7 @@ public class WndBag extends WndTabbed {
FOOD,
POTION,
SCROLL,
UNIDED_POTION_OR_SCROLL,
INTUITIONABLE,
EQUIPMENT,
TRANMSUTABLE,
ALCHEMY,
@ -444,7 +444,7 @@ public class WndBag extends WndTabbed {
mode == Mode.FOOD && (item instanceof Food) ||
mode == Mode.POTION && (item instanceof Potion) ||
mode == Mode.SCROLL && (item instanceof Scroll) ||
mode == Mode.UNIDED_POTION_OR_SCROLL && (!item.isIdentified() && (item instanceof Scroll || item instanceof Potion || item instanceof Ring)) ||
mode == Mode.INTUITIONABLE && StoneOfIntuition.isIntuitionable(item) ||
mode == Mode.EQUIPMENT && (item instanceof EquipableItem || item instanceof Wand) ||
mode == Mode.ALCHEMY && Recipe.usableInRecipe(item) ||
mode == Mode.TRANMSUTABLE && ScrollOfTransmutation.canTransmute(item) ||