aboutsummaryrefslogtreecommitdiff
path: root/internal/game/action_search.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-16 23:37:50 -0400
committerhistoria <[not public]>2026-06-16 23:37:50 -0400
commit389e307f205f9b7edf604fb9f86e1038ead736ef (patch)
tree595095b5877cc2b0513d31fb126303d8796cc311 /internal/game/action_search.go
parent085e728d22a3369bd110b77409914cfbe9ebe611 (diff)
downloadthehouseoficarus-389e307f205f9b7edf604fb9f86e1038ead736ef.tar.gz
feat: major xterm256 color overhaul, see worldbuilding docs.
Diffstat (limited to 'internal/game/action_search.go')
-rw-r--r--internal/game/action_search.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/internal/game/action_search.go b/internal/game/action_search.go
index e9d3d46..d45066d 100644
--- a/internal/game/action_search.go
+++ b/internal/game/action_search.go
@@ -3,10 +3,10 @@ package game
import (
"fmt"
- "thirdcollapse/internal/action"
- "thirdcollapse/internal/engine"
- "thirdcollapse/internal/net"
- "thirdcollapse/internal/player"
+ "thehouseoficarus/internal/action"
+ "thehouseoficarus/internal/engine"
+ "thehouseoficarus/internal/net"
+ "thehouseoficarus/internal/player"
)
func (g *Game) startSearch(sess *net.Session, p *player.Player, itemID string, slotIdx int) {
@@ -101,23 +101,24 @@ func (g *Game) giveSearchLoot(sess *net.Session, p *player.Player, drop *action.
}
name := drop.ItemID
- if def, err := g.ItemStore.Load(drop.ItemID); err == nil {
- name = def.Name
+ lootDef, _ := g.ItemStore.Load(drop.ItemID)
+ if lootDef != nil {
+ name = lootDef.Name
}
if drop.ItemID == "credits" {
p.Credits += qty
- sess.WriteLine(fmt.Sprintf("You find %d credits.", qty))
+ sess.WriteLine(g.colorize(sess, "credits_pickup", fmt.Sprintf("You find %d credits.", qty)))
return
}
freeSlot := p.FirstFreeSlot()
if freeSlot == -1 {
g.World.AddGroundItem(p.RoomID, drop.ItemID, qty)
- sess.WriteLine(fmt.Sprintf("You find %s. It falls to the ground.", name))
+ sess.WriteLine(fmt.Sprintf("You find %s. It falls to the ground.", g.itemColorize(sess, lootDef, name)))
return
}
p.SetInvSlot(freeSlot, &player.InventorySlot{ItemID: drop.ItemID, Quantity: qty})
- sess.WriteLine(fmt.Sprintf("You find %s.", name))
+ sess.WriteLine(fmt.Sprintf("You find %s.", g.itemColorize(sess, lootDef, name)))
}