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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user