diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index a77d6852b..bf4442456 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -1635,7 +1635,7 @@ items.weapon.melee.magesstaff.cursed=You can't use a cursed wand. items.weapon.melee.magesstaff.imbue_desc=Are you sure you want to imbue your staff with this wand?\n\nIf the wand being imbued is the same or higher level than the staff, the staff will inherit the level of that wand plus a single one of its own upgrades.\n\nThis imbue will result in a _level %d_ staff. items.weapon.melee.magesstaff.imbue_lost=The wand currently imbued in your staff will be lost. items.weapon.melee.magesstaff.imbue_talent=The wand currently imbued in your staff has a _%1$d%% chance_ to be returned at +0. Wand returns remaining: _%2$d_. If your wand is not preserved, you will get 1 arcane resin instead. -items.weapon.melee.magesstaff.yes=Yes, I'm sure. +items.weapon.melee.magesstaff.yes=Yes, I'm sure items.weapon.melee.magesstaff.no=No, I changed my mind items.weapon.melee.magesstaff.desc=Crafted by the Mage himself, this staff is a unique magical weapon which can be imbued with a wand. items.weapon.melee.magesstaff.no_wand=The staff currently has no magic in it, it must be _imbued with a wand's power_ before it can be used to cast spells. diff --git a/core/src/main/assets/messages/windows/windows.properties b/core/src/main/assets/messages/windows/windows.properties index c2482c92a..66be8896f 100644 --- a/core/src/main/assets/messages/windows/windows.properties +++ b/core/src/main/assets/messages/windows/windows.properties @@ -315,6 +315,9 @@ windows.wndsupportprompt.close=Close windows.wndtradeitem.buy=Buy for %dg windows.wndtradeitem.steal=Steal with %1$d%% chance\nCharges used: %2$d +windows.wndtradeitem.steal_warn=Your armband does not have enough charge to guarantee stealing this item. If it fails, the shop will close. Are you sure you want to attempt to steal? +windows.wndtradeitem.steal_warn_yes=Yes, I'm sure +windows.wndtradeitem.steal_warn_no=No, I changed my mind windows.wndtradeitem.sell=Sell for %dg windows.wndtradeitem.sell_1=Sell 1 for %dg windows.wndtradeitem.sell_all=Sell all for %dg diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTradeItem.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTradeItem.java index 3315ff3f5..3bb457332 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTradeItem.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTradeItem.java @@ -33,6 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.MasterThievesArmband; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; @@ -147,7 +148,8 @@ public class WndTradeItem extends WndInfoItem { RedButton btnSteal = new RedButton(Messages.get(this, "steal", Math.min(100, (int) (chance * 100)), chargesToUse), 6) { @Override protected void onClick() { - if (thievery.steal(item)) { + if (chance >= 1){ + thievery.steal(item); Hero hero = Dungeon.hero; Item item = heap.pickUp(); hide(); @@ -156,14 +158,36 @@ public class WndTradeItem extends WndInfoItem { Dungeon.level.drop(item, heap.pos).sprite.drop(); } } else { - for (Mob mob : Dungeon.level.mobs) { - if (mob instanceof Shopkeeper) { - mob.yell(Messages.get(mob, "thief")); - ((Shopkeeper) mob).flee(); - break; + GameScene.show(new WndOptions(new ItemSprite(ItemSpriteSheet.ARTIFACT_ARMBAND), + Messages.titleCase(Messages.get(MasterThievesArmband.class, "name")), + Messages.get(WndTradeItem.class, "steal_warn"), + Messages.get(WndTradeItem.class, "steal_warn_yes"), + Messages.get(WndTradeItem.class, "steal_warn_no")){ + @Override + protected void onSelect(int index) { + super.onSelect(index); + if (index == 0){ + if (thievery.steal(item)) { + Hero hero = Dungeon.hero; + Item item = heap.pickUp(); + WndTradeItem.this.hide(); + + if (!item.doPickUp(hero)) { + Dungeon.level.drop(item, heap.pos).sprite.drop(); + } + } else { + for (Mob mob : Dungeon.level.mobs) { + if (mob instanceof Shopkeeper) { + mob.yell(Messages.get(mob, "thief")); + ((Shopkeeper) mob).flee(); + break; + } + } + WndTradeItem.this.hide(); + } + } } - } - hide(); + }); } } };