diff options
Diffstat (limited to 'internal/game/utils.go')
| -rw-r--r-- | internal/game/utils.go | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/internal/game/utils.go b/internal/game/utils.go index 969eba4..e80de24 100644 --- a/internal/game/utils.go +++ b/internal/game/utils.go @@ -7,37 +7,10 @@ import ( "strings" "thirdcollapse/internal/net" - "thirdcollapse/internal/object" "thirdcollapse/internal/player" "thirdcollapse/internal/world" ) -var EquipSlots = []object.EquipSlot{ - object.SlotHead, object.SlotNeck, object.SlotTorso, object.SlotLegs, - object.SlotHands, object.SlotFeet, object.SlotBack, object.SlotAmmo, - object.SlotMainHand, object.SlotOffHand, object.SlotRing, -} - -type itemMatch struct { - ID string - Name string - Slot int -} - -type xpGain struct { - Skill string - XP int -} - -type deathDrop struct { - itemID string - quantity int - totalVal int - isEquip bool - equipSlot object.EquipSlot - invSlot int -} - func plural(n int) string { if n == 1 { return "" @@ -55,7 +28,7 @@ func parseQty(input string) (int, string) { return 0, input } -func parseIndex(s string) (int, error) { +func parseChoiceIndex(s string) (int, error) { var idx int _, err := fmt.Sscanf(s, "%d", &idx) return idx, err @@ -94,7 +67,7 @@ func randInt(max int) int { return rand.Intn(max) } -func innerPickupReport(sess *net.Session, picked []string) { +func formatPickupList(sess *net.Session, picked []string) { for i, name := range picked { if i == len(picked)-1 { sess.WriteLine(name) @@ -106,7 +79,7 @@ func innerPickupReport(sess *net.Session, picked []string) { } } -func actionDesc(p *player.Player) string { +func playerActionDescription(p *player.Player) string { if p.Action == nil { return "" } @@ -129,7 +102,7 @@ func actionDesc(p *player.Player) string { return "" } -func (g *Game) newInvSlot(itemID string, qty int) *player.InventorySlot { +func (g *Game) newInventorySlot(itemID string, qty int) *player.InventorySlot { slot := &player.InventorySlot{ItemID: itemID, Quantity: qty} if def, err := g.ItemStore.Load(itemID); err == nil && def.MaxQuality > 0 { slot.Quality = def.Quality |
