v0.9.0: fixed potion IDing from alchemy proccing test subject talent

This commit is contained in:
Evan Debenham 2020-09-25 02:34:21 -04:00
parent 1b72d7fff3
commit 2580403865

View File

@ -514,12 +514,12 @@ public class Potion extends Item {
} }
} }
Item result; Potion result;
if ( (seeds.size() == 2 && Random.Int(4) == 0) if ( (seeds.size() == 2 && Random.Int(4) == 0)
|| (seeds.size() == 3 && Random.Int(2) == 0)) { || (seeds.size() == 3 && Random.Int(2) == 0)) {
result = Generator.randomUsingDefaults( Generator.Category.POTION ); result = (Potion) Generator.randomUsingDefaults( Generator.Category.POTION );
} else { } else {
result = Reflection.newInstance(types.get(Random.element(ingredients).getClass())); result = Reflection.newInstance(types.get(Random.element(ingredients).getClass()));
@ -527,14 +527,14 @@ public class Potion extends Item {
} }
if (seeds.size() == 1){ if (seeds.size() == 1){
result.identify(); result.setKnown();
} }
while (result instanceof PotionOfHealing while (result instanceof PotionOfHealing
&& (Dungeon.isChallenged(Challenges.NO_HEALING) && (Dungeon.isChallenged(Challenges.NO_HEALING)
|| Random.Int(10) < Dungeon.LimitedDrops.COOKING_HP.count)) { || Random.Int(10) < Dungeon.LimitedDrops.COOKING_HP.count)) {
result = Generator.randomUsingDefaults(Generator.Category.POTION); result = (Potion) Generator.randomUsingDefaults(Generator.Category.POTION);
} }
if (result instanceof PotionOfHealing) { if (result instanceof PotionOfHealing) {