diff options
| author | historia <[not public]> | 2026-07-01 02:21:42 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-01 02:21:42 -0400 |
| commit | 5f37dc9b6f6b79da04da70ae0c33ec8d02998587 (patch) | |
| tree | f7c309e36267a4c456fcf5bca800e614507a80af /internal/game/cmd_wear.go | |
| parent | fee376102192dc6f24297a7b11324636ace3a07d (diff) | |
| download | thehouseoficarus-5f37dc9b6f6b79da04da70ae0c33ec8d02998587.tar.gz | |
feat: qol improvements to items crud in admin gui
Diffstat (limited to 'internal/game/cmd_wear.go')
| -rw-r--r-- | internal/game/cmd_wear.go | 18 |
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 |
