From f9ebb116c5a2f5c043940d1835f4db33143c5de0 Mon Sep 17 00:00:00 2001 From: prosolis <5590409+prosolis@users.noreply.github.com> Date: Sun, 17 May 2026 18:44:50 -0700 Subject: [PATCH] UX: surface swap-back item on magic-item equip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit resolveMagicEquipReply silently sold the previously equipped curio back to inventory at full value, but the success DM only named the new item. Players had to !sheet or !inv to confirm the old one wasn't lost. Capture the prior occupant's name before the delete and append a "šŸ“¦ **** moved back to inventory." line to the equip confirmation when a swap actually happened. --- internal/plugin/magic_items_gameplay.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/plugin/magic_items_gameplay.go b/internal/plugin/magic_items_gameplay.go index b09f810..f1989ed 100644 --- a/internal/plugin/magic_items_gameplay.go +++ b/internal/plugin/magic_items_gameplay.go @@ -526,12 +526,14 @@ func (p *AdventurePlugin) resolveMagicEquipReply(ctx MessageContext, interaction // value — swapping a curio shouldn't tax it. Evict from the local map // too, so the attunement count below reflects the post-swap state and // can re-open a slot the prior occupant was holding. + var swappedBackName string if prev, exists := equipped[mi.Slot]; exists && prev.Item.ID != "" { back := magicItemSell(prev.Item) back.SkillSource = "magic_item:" + prev.Item.ID if err := addAdvInventoryItem(ctx.Sender, back); err != nil { return p.SendDM(ctx.Sender, "Failed to return your currently-equipped item to inventory.") } + swappedBackName = prev.Item.Name delete(equipped, mi.Slot) } @@ -571,6 +573,9 @@ func (p *AdventurePlugin) resolveMagicEquipReply(ctx MessageContext, interaction var sb strings.Builder sb.WriteString(fmt.Sprintf("✨ **%s** equipped in your %s slot — %s.", mi.Name, mi.Slot, magicItemEffectSummary(mi))) + if swappedBackName != "" { + sb.WriteString(fmt.Sprintf("\nšŸ“¦ **%s** moved back to inventory.", swappedBackName)) + } switch { case mi.Attunement && attune: sb.WriteString(fmt.Sprintf("\nBonded (%d/%d bond slots used).",