diff options
Diffstat (limited to 'internal/game/action_burn.go')
| -rw-r--r-- | internal/game/action_burn.go | 13 |
1 files changed, 9 insertions, 4 deletions
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)) } } } |
