diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Recipe.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Recipe.java index 74caffeba..897a0f093 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Recipe.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Recipe.java @@ -171,6 +171,8 @@ public abstract class Recipe { private static Recipe[] oneIngredientRecipes = new Recipe[]{ new AlchemistsToolkit.upgradeKit(), + new ExoticPotion.PotionToExotic(), + new ExoticScroll.ScrollToExotic(), new Scroll.ScrollToStone(), new ArcaneResin.Recipe(), new StewedMeat.oneMeat() @@ -208,8 +210,8 @@ public abstract class Recipe { private static Recipe[] threeIngredientRecipes = new Recipe[]{ new Potion.SeedToPotion(), - new ExoticPotion.PotionToExotic(), - new ExoticScroll.ScrollToExotic(), + //new ExoticPotion.PotionToExotic(), + //new ExoticScroll.ScrollToExotic(), new StewedMeat.threeMeat(), new MeatPie.Recipe() }; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/ExoticPotion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/ExoticPotion.java index 8fbfabfa4..0667abd4a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/ExoticPotion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/ExoticPotion.java @@ -128,50 +128,33 @@ public class ExoticPotion extends Potion { } public static class PotionToExotic extends Recipe{ - + @Override public boolean testIngredients(ArrayList ingredients) { - int s = 0; - Potion p = null; - - for (Item i : ingredients){ - if (i instanceof Plant.Seed){ - s++; - } else if (regToExo.containsKey(i.getClass())) { - p = (Potion)i; - } + if (ingredients.size() == 1 && regToExo.containsKey(ingredients.get(0).getClass())){ + return true; } - - return p != null && s == 2; + + return false; } @Override public int cost(ArrayList ingredients) { - return 0; + return 4; } - + @Override public Item brew(ArrayList ingredients) { - Item result = null; - for (Item i : ingredients){ i.quantity(i.quantity()-1); - if (regToExo.containsKey(i.getClass())) { - result = Reflection.newInstance(regToExo.get(i.getClass())); - } } - return result; + + return Reflection.newInstance(regToExo.get(ingredients.get(0).getClass())); } - + @Override public Item sampleOutput(ArrayList ingredients) { - for (Item i : ingredients){ - if (regToExo.containsKey(i.getClass())) { - return Reflection.newInstance(regToExo.get(i.getClass())); - } - } - return null; - + return Reflection.newInstance(regToExo.get(ingredients.get(0).getClass())); } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ExoticScroll.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ExoticScroll.java index 85d9f942a..720b586f5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ExoticScroll.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ExoticScroll.java @@ -123,47 +123,30 @@ public abstract class ExoticScroll extends Scroll { @Override public boolean testIngredients(ArrayList ingredients) { - int r = 0; - Scroll s = null; - - for (Item i : ingredients){ - if (i instanceof Runestone){ - r++; - } else if (regToExo.containsKey(i.getClass())) { - s = (Scroll)i; - } + if (ingredients.size() == 1 && regToExo.containsKey(ingredients.get(0).getClass())){ + return true; } - - return s != null && r == 2; + + return false; } @Override public int cost(ArrayList ingredients) { - return 0; + return 6; } @Override public Item brew(ArrayList ingredients) { - Item result = null; - for (Item i : ingredients){ i.quantity(i.quantity()-1); - if (regToExo.containsKey(i.getClass())) { - result = Reflection.newInstance(regToExo.get(i.getClass())); - } } - return result; + + return Reflection.newInstance(regToExo.get(ingredients.get(0).getClass())); } @Override public Item sampleOutput(ArrayList ingredients) { - for (Item i : ingredients){ - if (regToExo.containsKey(i.getClass())) { - return Reflection.newInstance(regToExo.get(i.getClass())); - } - } - return null; - + return Reflection.newInstance(regToExo.get(ingredients.get(0).getClass())); } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/AlchemyScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/AlchemyScene.java index 4288e10f5..afda6278f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/AlchemyScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/AlchemyScene.java @@ -563,6 +563,8 @@ public class AlchemyScene extends PixelScene { bubbleEmitter.start(Speck.factory( Speck.BUBBLE ), 0.01f, 100 ); sparkEmitter.burst(SparkParticle.FACTORY, 20); Sample.INSTANCE.play( Assets.Sounds.LIGHTNING ); + + updateState(); } public static class ItemButton extends Component { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickRecipe.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickRecipe.java index 98da32fe1..b45bf83b5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickRecipe.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickRecipe.java @@ -332,7 +332,7 @@ public class QuickRecipe extends Component { r = new ExoticPotion.PotionToExotic(); for (Class cls : Generator.Category.POTION.classes){ Potion pot = (Potion) Reflection.newInstance(cls); - ArrayList in = new ArrayList<>(Arrays.asList(pot, new Plant.Seed.PlaceHolder().quantity(2))); + ArrayList in = new ArrayList<>(Arrays.asList(pot)); result.add(new QuickRecipe( r, in, r.sampleOutput(in))); } return result; @@ -340,7 +340,7 @@ public class QuickRecipe extends Component { r = new ExoticScroll.ScrollToExotic(); for (Class cls : Generator.Category.SCROLL.classes){ Scroll scroll = (Scroll) Reflection.newInstance(cls); - ArrayList in = new ArrayList<>(Arrays.asList(scroll, new Runestone.PlaceHolder().quantity(2))); + ArrayList in = new ArrayList<>(Arrays.asList(scroll)); result.add(new QuickRecipe( r, in, r.sampleOutput(in))); } return result;