diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java index 2cbba35d9..01552dce5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java @@ -78,7 +78,9 @@ public class SandalsOfNature extends Artifact { if (action.equals(AC_FEED)){ + selectingFootwear = this; GameScene.selectItem(itemSelector, mode, Messages.get(this, "prompt")); + selectingFootwear = null; } else if (action.equals(AC_ROOT) && level() > 0){ @@ -138,6 +140,15 @@ public class SandalsOfNature extends Artifact { return super.upgrade(); } + private static SandalsOfNature selectingFootwear = null; + + public static boolean canUseSeed(Item item){ + if (item instanceof Plant.Seed){ + return selectingFootwear == null || !selectingFootwear.seeds.contains(item.getClass()); + } + return false; + } + private static final String SEEDS = "seeds"; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java index 24776d2e2..2c3ccbb95 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java @@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Gold; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Recipe; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; +import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.SandalsOfNature; import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag; import com.shatteredpixel.shatteredpixeldungeon.items.bags.MagicalHolster; import com.shatteredpixel.shatteredpixeldungeon.items.bags.PotionBandolier; @@ -401,7 +402,7 @@ public class WndBag extends WndTabbed { mode == Mode.ARMOR && (item instanceof Armor) || mode == Mode.ENCHANTABLE && (item instanceof MeleeWeapon || item instanceof SpiritBow || item instanceof Armor) || mode == Mode.WAND && (item instanceof Wand) || - mode == Mode.SEED && (item instanceof Seed) || + mode == Mode.SEED && SandalsOfNature.canUseSeed(item) || mode == Mode.FOOD && (item instanceof Food) || mode == Mode.POTION && (item instanceof Potion) || mode == Mode.SCROLL && (item instanceof Scroll) ||