From c36c1dc0c65e65b4d6ee53df6bbcc3a860eb6e4b Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Sun, 21 Jun 2026 01:05:35 -0400 Subject: Added %i, %n, %b to production skill messages to consistent color inputs, item names, and byproducts --- internal/game/action_burn.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'internal/game/action_burn.go') diff --git a/internal/game/action_burn.go b/internal/game/action_burn.go index 71b5a35..03a5572 100644 --- a/internal/game/action_burn.go +++ b/internal/game/action_burn.go @@ -199,7 +199,7 @@ func (g *Game) advanceBurn(sess *net.Session, p *player.Player) { g.AccountStore.SaveCharacter(p) sess.WriteLine(g.colorize(sess, "fire", fmt.Sprintf("You drop the %s and begin to make a fire...", g.itemColorize(sess, logDef, logDef.Name)))) - g.broadcastDrop(p, logDef.Name) + g.broadcastDrop(p, itemID, logDef.Name) data["phase"] = 1 p.Action.WaitLeft = engine.ToTicks(toolSpeed) @@ -293,7 +293,7 @@ func (g *Game) advanceStoke(sess *net.Session, p *player.Player) { g.AccountStore.SaveCharacter(p) - msg := g.colorize(sess, "fire", fmt.Sprintf("You throw %s onto the fire.", name)) + msg := g.colorize(sess, "fire", fmt.Sprintf("You throw %s onto the fire.", g.itemColorize(sess, logDef, name))) if xp > 0 && p.OptionBool("xp_drops") { msg += g.colorize(sess, "xp", fmt.Sprintf(" (+%dxp %s)", xp, player.SkillAbbr[player.Firemaking])) } @@ -407,11 +407,16 @@ func (g *Game) hasFireObject(roomID int) bool { return g.findFireObjectKey(roomID) != "" } -func (g *Game) broadcastDrop(p *player.Player, itemName string) { +func (g *Game) broadcastDrop(p *player.Player, itemID, itemName string) { + itemDef, _ := g.ItemStore.Load(itemID) for _, other := range g.Hub.PlayersInRoom(p.RoomID) { op := other.Player if op != nil && op.Name != p.Name { - other.WriteLine(fmt.Sprintf("\n%s drops a %s.", p.Name, itemName)) + colored := itemName + if itemDef != nil { + colored = g.itemColorize(other, itemDef, itemName) + } + other.WriteLine(fmt.Sprintf("%s drops a %s.", p.Name, colored)) } } } -- cgit v1.2.3