mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-15 08:32:41 +00:00
Adventure: protect consumables from Robbie and 'sell all'
Consumables (auto-crafted from foraged ingredients or dropped from T2+ activities) are a curated stockpile — selling them should be an explicit choice, not a side effect. Two surfaces tightened: - Robbie's qualifying-items filter now skips Type == "consumable" the same way it skips Arena gear and cards. - !adventure sell all leaves consumables in inventory and reports them in the kept-items tally. The merchant message points players at !adventure sell <name> for explicit consumable sales. !adventure sell <name> still works fine on consumables — that path is already explicit by definition. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -778,11 +778,16 @@ func (p *AdventurePlugin) advSellAll(userID id.UserID) string {
|
||||
var total float64
|
||||
var sold int
|
||||
var keptSpecial int
|
||||
var keptConsumable int
|
||||
for _, item := range items {
|
||||
if item.Type == "MasterworkGear" || item.Type == "ArenaGear" || item.Type == "card" {
|
||||
keptSpecial++
|
||||
continue
|
||||
}
|
||||
if item.Type == "consumable" {
|
||||
keptConsumable++
|
||||
continue
|
||||
}
|
||||
if err := removeAdvInventoryItem(item.ID); err != nil {
|
||||
continue
|
||||
}
|
||||
@@ -791,8 +796,13 @@ func (p *AdventurePlugin) advSellAll(userID id.UserID) string {
|
||||
}
|
||||
|
||||
if sold == 0 {
|
||||
if keptSpecial > 0 {
|
||||
switch {
|
||||
case keptSpecial > 0 && keptConsumable > 0:
|
||||
return "Your inventory only contains special gear and consumables. The merchant won't touch any of it. Use `!adventure equip` for gear or `!adventure sell <name>` for individual consumables."
|
||||
case keptSpecial > 0:
|
||||
return "Your inventory only contains Masterwork and Arena gear. The merchant doesn't deal in that. Use `!adventure equip` instead."
|
||||
case keptConsumable > 0:
|
||||
return "Your inventory only contains consumables. `sell all` won't touch them — use `!adventure sell <name>` to sell a specific consumable."
|
||||
}
|
||||
return "Your inventory is empty. There is nothing to sell. This is a metaphor for something but now is not the time."
|
||||
}
|
||||
@@ -811,6 +821,9 @@ func (p *AdventurePlugin) advSellAll(userID id.UserID) string {
|
||||
if keptSpecial > 0 {
|
||||
msg += fmt.Sprintf("\n\n(%d special gear items kept — the merchant knows better than to touch those.)", keptSpecial)
|
||||
}
|
||||
if keptConsumable > 0 {
|
||||
msg += fmt.Sprintf("\n(%d consumable(s) kept — `sell all` doesn't touch them. Sell explicitly with `!adventure sell <name>`.)", keptConsumable)
|
||||
}
|
||||
return msg
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user