v0.8.1: footwear of nature now only let you pick seeds you can feed them

This commit is contained in:
Evan Debenham 2020-05-29 20:51:40 -04:00
parent 8d524e18d3
commit 27f131318e
2 changed files with 13 additions and 1 deletions

View File

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

View File

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