horsegen: generate map of skill names to ids

This commit is contained in:
2026-01-15 12:36:34 -05:00
parent c9a7e15f89
commit 079b996f5a
6 changed files with 1666 additions and 4566 deletions

View File

@@ -1,7 +1,22 @@
package horse
import "strconv"
type SkillID int32
type TenThousandths int32
func (x TenThousandths) String() string {
b := make([]byte, 0, 12)
b = strconv.AppendInt(b, int64(x/1e4), 10)
b = append(b, '.')
if x < 0 {
x = -x
}
b = strconv.AppendInt(b, int64(x%1e4), 10)
return string(b)
}
// Skill is the internal data about a skill.
type Skill struct {
ID SkillID
@@ -21,8 +36,8 @@ type Skill struct {
type Activation struct {
Precondition string
Condition string
Duration int // 1e4 scale
Cooldown int // 1e4 scale
Duration TenThousandths
Cooldown TenThousandths
Abilities []Ability
}