blob: f5a9a1171415904b4e58cc8a18ff39ae5c66a8eb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
package game
import (
"fmt"
"thehouseoficarus/internal/net"
"thehouseoficarus/internal/object"
)
func (g *Game) doEquipment(sess *net.Session) {
p := sess.Player
sess.WriteLine("")
sess.WriteLine("Equipment:")
for _, slot := range EquipSlots {
itemID, ok := p.Equipment[slot]
if !ok {
sess.WriteLine(fmt.Sprintf(" %-12s (empty)", slot))
continue
}
def, err := g.ItemStore.Load(itemID)
name := itemID
if err == nil {
name = def.Name
}
if slot == object.SlotAmmo && p.AmmoQty > 0 {
sess.WriteLine(fmt.Sprintf(" %-12s %s (x%d)", slot, g.itemColorize(sess, def, name), p.AmmoQty))
} else {
sess.WriteLine(fmt.Sprintf(" %-12s %s", slot, g.itemColorize(sess, def, name)))
}
}
}
|