horsegen: generate data per region
This commit is contained in:
72
go/skill.go
Normal file
72
go/skill.go
Normal file
@@ -0,0 +1,72 @@
|
||||
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
|
||||
Name string
|
||||
Description string
|
||||
Group int32
|
||||
Rarity int8
|
||||
GroupRate int8
|
||||
GradeValue int32
|
||||
WitCheck bool
|
||||
Activations []Activation
|
||||
SPCost int
|
||||
IconID int
|
||||
}
|
||||
|
||||
// Activation is the parameters controlling when a skill activates.
|
||||
type Activation struct {
|
||||
Precondition string
|
||||
Condition string
|
||||
Duration TenThousandths
|
||||
Cooldown TenThousandths
|
||||
Abilities []Ability
|
||||
}
|
||||
|
||||
// Ability is an individual effect applied by a skill.
|
||||
type Ability struct {
|
||||
Type AbilityType
|
||||
ValueUsage int8
|
||||
Value int32
|
||||
Target int8
|
||||
TargetValue int32
|
||||
}
|
||||
|
||||
type AbilityType int8
|
||||
|
||||
//go:generate go run golang.org/x/tools/cmd/stringer@v0.41.0 -type AbilityType -trimprefix Ability
|
||||
const (
|
||||
AbilityPassiveSpeed AbilityType = 1
|
||||
AbilityPassiveStamina AbilityType = 2
|
||||
AbilityPassivePower AbilityType = 3
|
||||
AbilityPassiveGuts AbilityType = 4
|
||||
AbilityPassiveWit AbilityType = 5
|
||||
AbilityGreatEscape AbilityType = 6
|
||||
AbilityVision AbilityType = 8
|
||||
AbilityHP AbilityType = 9
|
||||
AbilityGateDelay AbilityType = 10
|
||||
AbilityFrenzy AbilityType = 13
|
||||
AbilityCurrentSpeed AbilityType = 21
|
||||
AbilityTargetSpeed AbilityType = 27
|
||||
AbilityLaneSpeed AbilityType = 28
|
||||
AbilityAccel AbilityType = 31
|
||||
AbilityLaneChange AbilityType = 35
|
||||
)
|
||||
Reference in New Issue
Block a user