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:
@@ -9,8 +9,8 @@ const noWeapon WeaponKind = -1
|
||||
// missile fires a missile in a given direction (weapons.c missile).
|
||||
func (g *RogueGame) missile(ydelta, xdelta int) {
|
||||
// Get which thing we are hurling
|
||||
obj := g.getItem("throw", KindWeapon)
|
||||
if obj == nil {
|
||||
obj, ok := g.promptPackItem("throw", KindWeapon)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -113,8 +113,8 @@ func (g *RogueGame) wield() {
|
||||
|
||||
p.CurWeapon = oweapon
|
||||
|
||||
obj := g.getItem("wield", KindWeapon)
|
||||
if obj == nil {
|
||||
obj, ok := g.promptPackItem("wield", KindWeapon)
|
||||
if !ok {
|
||||
g.After = false
|
||||
|
||||
return
|
||||
@@ -133,7 +133,7 @@ func (g *RogueGame) wield() {
|
||||
return
|
||||
}
|
||||
|
||||
sp := g.invName(obj, true)
|
||||
sp := g.inventoryName(obj, true)
|
||||
p.CurWeapon = obj
|
||||
|
||||
if !g.Options.Terse {
|
||||
|
||||
Reference in New Issue
Block a user