aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_wear.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/cmd_wear.go')
-rw-r--r--internal/game/cmd_wear.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/internal/game/cmd_wear.go b/internal/game/cmd_wear.go
index 64069bc..c52321c 100644
--- a/internal/game/cmd_wear.go
+++ b/internal/game/cmd_wear.go
@@ -75,7 +75,7 @@ func (g *Game) doWear(sess *net.Session, input string) {
}
def, err := g.ItemStore.Load(slot.ItemID)
- if err != nil || def.EquipSlot == "" {
+ if err != nil || def.EquipSlot() == "" {
sess.WriteLine(fmt.Sprintf("You can't wear %s.", g.itemColorize(sess, def, match.Name)))
return
}
@@ -85,12 +85,12 @@ func (g *Game) doWear(sess *net.Session, input string) {
return
}
- if def.EquipSlot == item.SlotAmmo && def.Stackable {
+ if def.EquipSlot() == item.SlotAmmo && def.Stackable {
g.equipAmmo(sess, p, match.Slot, slot, def, qty)
return
}
- existingItemID, slotOccupied := p.Equipment[def.EquipSlot]
+ existingItemID, slotOccupied := p.Equipment[def.EquipSlot()]
if slotOccupied {
freeSlot := p.FirstFreeSlot()
@@ -116,11 +116,11 @@ func (g *Game) doWear(sess *net.Session, input string) {
p.EquipQuality[slot.ItemID] = slot.Quality
}
- p.Equipment[def.EquipSlot] = slot.ItemID
+ p.Equipment[def.EquipSlot()] = slot.ItemID
g.AccountStore.SaveCharacter(p)
verb := "wear"
- if def.WeaponType != "" {
+ if def.EquipmentType() != "" {
verb = "wield"
}
sess.WriteLine(fmt.Sprintf("You %s %s.", verb, g.itemColorize(sess, def, match.Name)))
@@ -193,19 +193,19 @@ func (g *Game) doWearAll(sess *net.Session) {
continue
}
def, err := g.ItemStore.Load(slot.ItemID)
- if err != nil || def.EquipSlot == "" {
+ if err != nil || def.EquipSlot() == "" {
continue
}
if g.checkRequirements(sess, p, def) != "" {
continue
}
- current, exists := bestPerSlot[def.EquipSlot]
+ current, exists := bestPerSlot[def.EquipSlot()]
val := def.Value
- if def.EquipSlot == item.SlotAmmo && def.Stackable {
+ if def.EquipSlot() == item.SlotAmmo && def.Stackable {
val = def.Value * slot.Quantity
}
if !exists || val > current.value {
- bestPerSlot[def.EquipSlot] = struct {
+ bestPerSlot[def.EquipSlot()] = struct {
itemID string
value int
invSlot int