diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index 86f9ba77d..35bf4da1a 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -1206,7 +1206,7 @@ items.spells.spell.no_magic=You can't cast spells while magic immune. items.spells.magicalinfusion.name=magical infusion items.spells.magicalinfusion.inv_title=Infuse an item items.spells.magicalinfusion.infuse=Your item is infused with arcane energy! -items.spells.magicalinfusion.desc=This spell possesses the same magical power as a scroll of upgrade, but in a more stable form.\n\nIn addition to upgrading an item as normal it will never erase an enchantment on a weapon or a glyph on armor, including curses. +items.spells.magicalinfusion.desc=This spell possesses the same magical power as a scroll of upgrade, but in a more stable form.\n\nIn addition to upgrading an item as normal it will never erase an enchantment, glyph, or curse. items.spells.magicalporter.name=magical porter items.spells.magicalporter.inv_title=Port an item diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/InventoryScroll.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/InventoryScroll.java index 67f5021cf..4ef8221f1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/InventoryScroll.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/InventoryScroll.java @@ -111,12 +111,13 @@ public abstract class InventoryScroll extends Scroll { if (item != null) { - if (!identifiedByUse) { + //SoU opens a separate window that can be cancelled + //so we don't do a lot of logic here + if (!identifiedByUse && !(curItem instanceof ScrollOfUpgrade)) { curItem = detach(curUser.belongings.backpack); } ((InventoryScroll)curItem).onItemSelected( item ); - //SoU still does these things, but after the upgrade window if (!(curItem instanceof ScrollOfUpgrade)) { ((InventoryScroll) curItem).readAnimation(); Sample.INSTANCE.play(Assets.Sounds.READ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/InventorySpell.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/InventorySpell.java index 7f88214e2..120373823 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/InventorySpell.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/InventorySpell.java @@ -81,10 +81,13 @@ public abstract class InventorySpell extends Spell { if (item != null) { - curItem = detach(curUser.belongings.backpack); + //Infusion opens a separate window that can be cancelled + //so we don't do a lot of logic here + if (!(curItem instanceof MagicalInfusion)) { + curItem = detach(curUser.belongings.backpack); + } ((InventorySpell)curItem).onItemSelected( item ); - //Magical Infusion still does these things, but after the upgrade window if (!(curItem instanceof MagicalInfusion)) { curUser.spend(1f); curUser.busy(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndUpgrade.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndUpgrade.java index 33a254816..a52978f42 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndUpgrade.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndUpgrade.java @@ -254,6 +254,7 @@ public class WndUpgrade extends Window { } //Various ring stats (varies by ring) + //TODO cursed ring stats? if (toUpgrade instanceof Ring){ if (((Ring) toUpgrade).upgradeStat1(levelFrom) != null){ bottom = fillFields(Messages.get(toUpgrade, "upgrade_stat_name_1"), @@ -369,6 +370,7 @@ public class WndUpgrade extends Window { upgraded = ((MagicalInfusion) upgrader).upgradeItem(toUpgrade); } + if (!force) upgrader.detach(Dungeon.hero.belongings.backpack); Item moreUpgradeItem = Dungeon.hero.belongings.getItem(upgrader.getClass()); hide(); @@ -429,9 +431,7 @@ public class WndUpgrade extends Window { @Override public void onBackPressed() { //don't let this window be closed if - //TODO currently never closes, as the Sou/magic infusion is consumed as it is shown - //we might want to only have it be pre-consumed when force = true - //as atm quitting the game with the window open will eat the scroll/infuse when force=false + if (!force) super.onBackPressed(); } private float fillFields(String title, String msg1, String msg2, float bottom){