diff options
| author | historia <[not public]> | 2026-06-21 01:05:35 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-21 01:05:35 -0400 |
| commit | c36c1dc0c65e65b4d6ee53df6bbcc3a860eb6e4b (patch) | |
| tree | ea5b796d7b8ce6ae422b30542e0da97e818207e8 /internal/game/cmd_shop.go | |
| parent | 470bc5bd99b793e46305310b5fbeb3068eba45f1 (diff) | |
| download | thehouseoficarus-c36c1dc0c65e65b4d6ee53df6bbcc3a860eb6e4b.tar.gz | |
Added %i, %n, %b to production skill messages to consistent color inputs, item names, and byproducts
Diffstat (limited to 'internal/game/cmd_shop.go')
| -rw-r--r-- | internal/game/cmd_shop.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/internal/game/cmd_shop.go b/internal/game/cmd_shop.go index c6b7831..f0e18fe 100644 --- a/internal/game/cmd_shop.go +++ b/internal/game/cmd_shop.go @@ -138,7 +138,7 @@ func (g *Game) showShopBrowse(sess *net.Session) { sellStr = fmt.Sprintf("%d cr", si.SellPrice) } t.Rows = append(t.Rows, []string{ - g.colorize(sess, "item", itemName), + g.itemColorize(sess, def, itemName), g.colorize(sess, "credits_pickup", buyStr), g.colorize(sess, "credits_pickup", sellStr), }) @@ -182,7 +182,7 @@ func (g *Game) doShopBuy(sess *net.Session, input string, qty int, all bool) { if len(matches) > 1 { sess.WriteLine("That's ambiguous, which one?") for _, m := range matches { - sess.WriteLine(fmt.Sprintf(" - %s", g.colorize(sess, "item", m.name))) + sess.WriteLine(fmt.Sprintf(" - %s", g.itemColorize(sess, m.def, m.name))) } return } @@ -325,8 +325,9 @@ func (g *Game) doShopSell(sess *net.Session, input string, qty int, all bool) { if len(matches) > 1 { sess.WriteLine("That's ambiguous, which one?") - for _, m := range uniqueItemNames(matches) { - sess.WriteLine(fmt.Sprintf(" - %s", g.colorize(sess, "item", m))) + for _, m := range matches { + def, _ := g.ItemStore.Load(m.ID) + sess.WriteLine(fmt.Sprintf(" - %s", g.itemColorize(sess, def, m.Name))) } return } @@ -348,7 +349,7 @@ func (g *Game) doShopSell(sess *net.Session, input string, qty int, all bool) { if def != nil { displayName = def.Name } - sess.WriteLine(fmt.Sprintf("The shop doesn't want to buy %s.", g.colorize(sess, "item", displayName))) + sess.WriteLine(fmt.Sprintf("The shop doesn't want to buy %s.", g.itemColorize(sess, def, displayName))) return } |
