@@ -15,6 +15,8 @@ import (
|
||||
"os/signal"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/sync/errgroup"
|
||||
"zombiezen.com/go/sqlite"
|
||||
@@ -170,6 +172,7 @@ func main() {
|
||||
},
|
||||
}),
|
||||
UniqueOwner: s.ColumnText(52), // TODO(zeph): should be id, not name
|
||||
Tags: parseTags(s.ColumnText(54)),
|
||||
SPCost: s.ColumnInt(49),
|
||||
IconID: s.ColumnInt(53),
|
||||
}
|
||||
@@ -395,6 +398,20 @@ type SparkEffImm struct {
|
||||
Value2 int32
|
||||
}
|
||||
|
||||
func parseTags(s string) []uint16 {
|
||||
r := make([]uint16, 0, 8)
|
||||
for s != "" {
|
||||
t, u, _ := strings.Cut(s, "/")
|
||||
s = u
|
||||
v, err := strconv.ParseUint(t, 10, 16)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("parsing skill tags: %w", err))
|
||||
}
|
||||
r = append(r, uint16(v))
|
||||
}
|
||||
return trimZeros(r...)
|
||||
}
|
||||
|
||||
func trimAbilities(s []horse.Ability) []horse.Ability {
|
||||
for len(s) > 0 && s[len(s)-1].Type == 0 {
|
||||
s = s[:len(s)-1]
|
||||
|
||||
Reference in New Issue
Block a user