From d1b897cc6b38ebec92c1d1c5aaba622bc352de2f Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 12 Jan 2022 16:30:10 -0500 Subject: [PATCH] v1.1.2: fixed dragon's breath and mastery not always being consumed --- .../items/potions/exotic/PotionOfDragonsBreath.java | 6 ++++-- .../items/potions/exotic/PotionOfMastery.java | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfDragonsBreath.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfDragonsBreath.java index 54ea40dc7..cff555b2f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfDragonsBreath.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfDragonsBreath.java @@ -60,7 +60,7 @@ public class PotionOfDragonsBreath extends ExoticPotion { //need to override drink so that time isn't spent right away protected void drink(final Hero hero) { curUser = hero; - curItem = this; + curItem = detach( hero.belongings.backpack ); if (!isKnown()) { identify(); @@ -96,7 +96,7 @@ public class PotionOfDragonsBreath extends ExoticPotion { switch (index) { case 0: curUser.spendAndNext(1f); - detach(curUser.belongings.backpack); + identifiedByUse = false; break; case 1: GameScene.selectCell( targeter ); @@ -105,6 +105,8 @@ public class PotionOfDragonsBreath extends ExoticPotion { } public void onBackPressed() {} } ); + } else if (cell == null && !anonymous){ + curItem.collect( curUser.belongings.backpack ); } else if (cell != null) { identifiedByUse = false; curUser.busy(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfMastery.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfMastery.java index 56266efb0..6310257b5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfMastery.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfMastery.java @@ -50,7 +50,7 @@ public class PotionOfMastery extends ExoticPotion { //need to override drink so that time isn't spent right away protected void drink(final Hero hero) { curUser = hero; - curItem = this; + curItem = detach( hero.belongings.backpack ); if (!isKnown()) { identify(); @@ -90,7 +90,7 @@ public class PotionOfMastery extends ExoticPotion { switch (index) { case 0: curUser.spendAndNext(1f); - detach(curUser.belongings.backpack); + identifiedByUse = false; break; case 1: GameScene.selectItem(itemSelector); @@ -99,6 +99,8 @@ public class PotionOfMastery extends ExoticPotion { } public void onBackPressed() {} } ); + } else if (item == null && !anonymous){ + curItem.collect( curUser.belongings.backpack ); } else if (item != null) { if (item instanceof Weapon) {