horsegen: generate map of skill names to ids
This commit is contained in:
19
skill.go
19
skill.go
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user