diff options
| author | historia <[not public]> | 2026-06-16 23:37:50 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-16 23:37:50 -0400 |
| commit | 389e307f205f9b7edf604fb9f86e1038ead736ef (patch) | |
| tree | 595095b5877cc2b0513d31fb126303d8796cc311 /internal/game/action_burn.go | |
| parent | 085e728d22a3369bd110b77409914cfbe9ebe611 (diff) | |
| download | thehouseoficarus-389e307f205f9b7edf604fb9f86e1038ead736ef.tar.gz | |
feat: major xterm256 color overhaul, see worldbuilding docs.
Diffstat (limited to 'internal/game/action_burn.go')
| -rw-r--r-- | internal/game/action_burn.go | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/internal/game/action_burn.go b/internal/game/action_burn.go index 5c19510..01bf385 100644 --- a/internal/game/action_burn.go +++ b/internal/game/action_burn.go @@ -4,11 +4,11 @@ import ( "fmt" "math/rand" - "thirdcollapse/internal/action" - "thirdcollapse/internal/engine" - "thirdcollapse/internal/net" - "thirdcollapse/internal/object" - "thirdcollapse/internal/player" + "thehouseoficarus/internal/action" + "thehouseoficarus/internal/engine" + "thehouseoficarus/internal/net" + "thehouseoficarus/internal/object" + "thehouseoficarus/internal/player" ) func (g *Game) doBurn(sess *net.Session, p *player.Player, input string) { @@ -70,13 +70,13 @@ func (g *Game) startBurn(sess *net.Session, p *player.Player, itemID string, fro } if logDef.BurnTicks <= 0 { - sess.WriteLine(fmt.Sprintf("You can't burn the %s.", logDef.Name)) + sess.WriteLine(fmt.Sprintf("You can't burn the %s.", g.itemColorize(sess, logDef, logDef.Name))) return } skillLevel := p.Level(player.Firemaking) if logDef.FireLevel > 0 && skillLevel < logDef.FireLevel { - sess.WriteLine(fmt.Sprintf("You need level %d firemaking to burn %s.", logDef.FireLevel, logDef.Name)) + sess.WriteLine(fmt.Sprintf("You need level %d firemaking to burn %s.", logDef.FireLevel, g.itemColorize(sess, logDef, logDef.Name))) return } @@ -87,13 +87,13 @@ func (g *Game) startBurn(sess *net.Session, p *player.Player, itemID string, fro if !fromGround { if !p.HasItem(itemID) { - sess.WriteLine(fmt.Sprintf("You don't have any %s.", logDef.Name)) + sess.WriteLine(fmt.Sprintf("You don't have any %s.", g.itemColorize(sess, logDef, logDef.Name))) return } } else { ground := g.World.GroundItems(p.RoomID) if ground[itemID] <= 0 { - sess.WriteLine(fmt.Sprintf("There are no %s on the ground here.", logDef.Name)) + sess.WriteLine(fmt.Sprintf("There are no %s on the ground here.", g.itemColorize(sess, logDef, logDef.Name))) return } } @@ -135,7 +135,7 @@ func (g *Game) startStoke(sess *net.Session, p *player.Player, itemID string) { } if !p.HasItem(itemID) { - sess.WriteLine(fmt.Sprintf("You don't have any %s.", logDef.Name)) + sess.WriteLine(fmt.Sprintf("You don't have any %s.", g.itemColorize(sess, logDef, logDef.Name))) return } @@ -171,7 +171,7 @@ func (g *Game) advanceBurn(sess *net.Session, p *player.Player) { if phase == 0 { if !p.HasItem(itemID) { - sess.WriteLine(fmt.Sprintf("You're out of %s.", logDef.Name)) + sess.WriteLine(fmt.Sprintf("You're out of %s.", g.itemColorize(sess, logDef, logDef.Name))) g.CancelAction(p) return } @@ -179,7 +179,7 @@ func (g *Game) advanceBurn(sess *net.Session, p *player.Player) { g.World.AddGroundItem(p.RoomID, itemID, 1) g.AccountStore.SaveCharacter(p) - sess.WriteLine(fmt.Sprintf("You drop the %s and begin to make a fire...", logDef.Name)) + 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) data["phase"] = 1 @@ -195,7 +195,7 @@ func (g *Game) advanceBurn(sess *net.Session, p *player.Player) { } if phase == 1 { - sess.WriteLine(fmt.Sprintf("You try burning the %s on the ground...", logDef.Name)) + sess.WriteLine(g.colorize(sess, "fire", fmt.Sprintf("You try burning the %s on the ground...", g.itemColorize(sess, logDef, logDef.Name)))) data["phase"] = 2 p.Action.WaitLeft = engine.ToTicks(toolSpeed) return @@ -216,26 +216,26 @@ func (g *Game) advanceBurn(sess *net.Session, p *player.Player) { g.World.AddObjInstance(p.RoomID, "fire", logDef.BurnTicks) xp := logDef.FireXP - if xp > 0 { - if newLevel := p.AddSkillXP(player.Firemaking, xp); newLevel > 0 { - sess.WriteLine(fmt.Sprintf("*** You are now level %d firemaking! ***", newLevel)) - } + if xp > 0 { + if newLevel := p.AddSkillXP(player.Firemaking, xp); newLevel > 0 { + sess.WriteLine(g.colorize(sess, "level_up", fmt.Sprintf("*** You are now level %d firemaking! ***", newLevel))) } + } - g.AccountStore.SaveCharacter(p) - g.CancelAction(p) + g.AccountStore.SaveCharacter(p) + g.CancelAction(p) - msg := fmt.Sprintf("You manage to get a fire going!") - if xp > 0 && p.OptionBool("xp_drops") { - msg += fmt.Sprintf(" (+%dxp %s)", xp, player.SkillAbbr[player.Firemaking]) - } - sess.WriteLine(msg) + msg := g.colorize(sess, "fire", "You manage to get a fire going!") + if xp > 0 && p.OptionBool("xp_drops") { + msg += g.colorize(sess, "xp", fmt.Sprintf(" (+%dxp %s)", xp, player.SkillAbbr[player.Firemaking])) + } + sess.WriteLine(msg) - for _, other := range g.Hub.PlayersInRoom(p.RoomID) { - if other != sess { - other.WriteLine(fmt.Sprintf("\n%s started a fire!", p.Name)) - } + for _, other := range g.Hub.PlayersInRoom(p.RoomID) { + if other != sess { + other.WriteLine(g.colorize(other, "broadcast", fmt.Sprintf("\n%s started a fire!", p.Name))) } + } return } @@ -266,7 +266,7 @@ func (g *Game) advanceStoke(sess *net.Session, p *player.Player) { } if !p.HasItem(itemID) { - sess.WriteLine(fmt.Sprintf("You're out of %s and the fire is roaring.", name)) + sess.WriteLine(g.colorize(sess, "fire", fmt.Sprintf("You're out of %s and the fire is roaring.", g.itemColorize(sess, logDef, name)))) g.CancelAction(p) return } @@ -276,20 +276,20 @@ func (g *Game) advanceStoke(sess *net.Session, p *player.Player) { if xp > 0 { if newLevel := p.AddSkillXP(player.Firemaking, xp); newLevel > 0 { - sess.WriteLine(fmt.Sprintf("*** You are now level %d firemaking! ***", newLevel)) + sess.WriteLine(g.colorize(sess, "level_up", fmt.Sprintf("*** You are now level %d firemaking! ***", newLevel))) } } g.AccountStore.SaveCharacter(p) - msg := fmt.Sprintf("You throw %s onto the fire.", name) + msg := g.colorize(sess, "fire", fmt.Sprintf("You throw %s onto the fire.", name)) if xp > 0 && p.OptionBool("xp_drops") { - msg += fmt.Sprintf(" (+%dxp %s)", xp, player.SkillAbbr[player.Firemaking]) + msg += g.colorize(sess, "xp", fmt.Sprintf(" (+%dxp %s)", xp, player.SkillAbbr[player.Firemaking])) } sess.WriteLine(msg) if !p.HasItem(itemID) { - sess.WriteLine(fmt.Sprintf("You're out of %s and the fire is roaring.", name)) + sess.WriteLine(g.colorize(sess, "fire", fmt.Sprintf("You're out of %s and the fire is roaring.", g.itemColorize(sess, logDef, name)))) g.CancelAction(p) return } |
