Rename item-subsystem methods (refactor step 5, items)

getItem→promptPackItem now returns (obj, ok) instead of a nil-signaling
pointer; invName→inventoryName; doPot→applyPotionFuse. C breadcrumbs
kept. Behavior unchanged; suite green.
This commit is contained in:
2026-07-07 02:31:38 +02:00
parent 0554f5d4f1
commit 6d798c56ed
14 changed files with 57 additions and 56 deletions

View File

@@ -7,9 +7,9 @@ import "fmt"
// ringOn puts a ring on a hand (rings.c ring_on).
func (g *RogueGame) ringOn() {
p := &g.Player
obj := g.getItem("put on", KindRing)
obj, ok := g.promptPackItem("put on", KindRing)
// Make certain that it is something that we want to wear
if obj == nil {
if !ok {
return
}
@@ -65,7 +65,7 @@ func (g *RogueGame) ringOn() {
g.addmsgf("you are now wearing ")
}
g.msg("%s (%c)", g.invName(obj, true), obj.PackCh)
g.msg("%s (%c)", g.inventoryName(obj, true), obj.PackCh)
}
// ringOff takes off a ring (rings.c ring_off).
@@ -103,7 +103,7 @@ func (g *RogueGame) ringOff() {
}
if g.dropCheck(obj) {
g.msg("was wearing %s(%c)", g.invName(obj, true), obj.PackCh)
g.msg("was wearing %s(%c)", g.inventoryName(obj, true), obj.PackCh)
}
}