aboutsummaryrefslogtreecommitdiff
path: root/internal/game/action_farm.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-21 01:05:35 -0400
committerhistoria <[not public]>2026-06-21 01:05:35 -0400
commitc36c1dc0c65e65b4d6ee53df6bbcc3a860eb6e4b (patch)
treeea5b796d7b8ce6ae422b30542e0da97e818207e8 /internal/game/action_farm.go
parent470bc5bd99b793e46305310b5fbeb3068eba45f1 (diff)
downloadthehouseoficarus-c36c1dc0c65e65b4d6ee53df6bbcc3a860eb6e4b.tar.gz
Added %i, %n, %b to production skill messages to consistent color inputs, item names, and byproducts
Diffstat (limited to 'internal/game/action_farm.go')
-rw-r--r--internal/game/action_farm.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/internal/game/action_farm.go b/internal/game/action_farm.go
index 679af83..6361901 100644
--- a/internal/game/action_farm.go
+++ b/internal/game/action_farm.go
@@ -114,7 +114,7 @@ func (g *Game) advanceFarmGrowth(sess *net.Session, p *player.Player) {
p.Flags[prefix+"_dead"] = true
p.Flags[prefix+"_diseased"] = false
sess.WriteLine(g.colorize(sess, "farm_disease",
- fmt.Sprintf("\nYour %s has died from disease!", seedDisplayName(g, seedID))))
+ fmt.Sprintf("\nYour %s has died from disease!", g.seedDisplayName(sess, seedID))))
g.AccountStore.SaveCharacter(p)
continue
}
@@ -140,7 +140,7 @@ func (g *Game) advanceFarmGrowth(sess *net.Session, p *player.Player) {
p.Flags[prefix+"_watered"] = false
sess.WriteLine(g.colorize(sess, "farm_grow",
fmt.Sprintf("\nYour %s is fully grown and ready to harvest!",
- seedDisplayName(g, seedID))))
+ g.seedDisplayName(sess, seedID))))
} else {
if !watered && rand.Float64() < 0.10 {
p.Flags[prefix+"_stage"] = stage
@@ -148,22 +148,22 @@ func (g *Game) advanceFarmGrowth(sess *net.Session, p *player.Player) {
p.Flags[prefix+"_watered"] = false
sess.WriteLine(g.colorize(sess, "farm_disease",
fmt.Sprintf("\nYour %s has become diseased!",
- seedDisplayName(g, seedID))))
+ g.seedDisplayName(sess, seedID))))
} else {
p.Flags[prefix+"_stage"] = stage
p.Flags[prefix+"_watered"] = false
sess.WriteLine(g.colorize(sess, "farm_grow",
fmt.Sprintf("\nYour %s has grown to stage %d/%d.",
- seedDisplayName(g, seedID), stage, maxStages)))
+ g.seedDisplayName(sess, seedID), stage, maxStages)))
}
}
g.AccountStore.SaveCharacter(p)
}
}
-func seedDisplayName(g *Game, seedID string) string {
+func (g *Game) seedDisplayName(sess *net.Session, seedID string) string {
if def, err := g.ItemStore.Load(seedID); err == nil {
- return def.Name
+ return g.itemColorize(sess, def, def.Name)
}
return seedID
}
@@ -194,7 +194,7 @@ func (g *Game) advancePlant(sess *net.Session, p *player.Player) {
seedName := seedID
if def, err := g.ItemStore.Load(seedID); err == nil {
- seedName = def.Name
+ seedName = g.itemColorize(sess, def, def.Name)
}
patchName := patchDisplayName(prefix)
msg := fmt.Sprintf("You plant a %s in the %s.", seedName, patchName)
@@ -287,7 +287,7 @@ func (g *Game) advanceHarvest(sess *net.Session, p *player.Player) {
productName := product
if productDef != nil {
- productName = productDef.Name
+ productName = g.itemColorize(sess, productDef, productDef.Name)
}
patchName := patchDisplayName(prefix)
msg := fmt.Sprintf("You harvest %d %s from the %s.", yield, productName, patchName)
@@ -562,7 +562,7 @@ func (g *Game) showFarmPatches(sess *net.Session, p *player.Player) {
seedName := seedID
if sd, err := g.ItemStore.Load(seedID); err == nil {
- seedName = sd.Name
+ seedName = g.itemColorize(sess, sd, sd.Name)
}
dead, _ := p.Flags[prefix+"_dead"].(bool)