horse: stringify abilities
This commit is contained in:
@@ -44,29 +44,82 @@ type Activation struct {
|
||||
// Ability is an individual effect applied by a skill.
|
||||
type Ability struct {
|
||||
Type AbilityType
|
||||
ValueUsage int8
|
||||
Value int32
|
||||
Target int8
|
||||
ValueUsage AbilityValueUsage
|
||||
Value TenThousandths
|
||||
Target AbilityTarget
|
||||
TargetValue int32
|
||||
}
|
||||
|
||||
func (a Ability) String() string {
|
||||
r := make([]byte, 0, 64)
|
||||
r = append(r, a.Type.String()...)
|
||||
if a.Value != 0 {
|
||||
r = append(r, ' ')
|
||||
r = append(r, a.Value.String()...)
|
||||
}
|
||||
if a.Target != TargetSelf {
|
||||
r = append(r, " to "...)
|
||||
if a.TargetValue > 1 && a.TargetValue < 18 {
|
||||
r = strconv.AppendInt(r, int64(a.TargetValue), 10)
|
||||
r = append(r, ' ')
|
||||
}
|
||||
r = append(r, a.Target.String()...)
|
||||
}
|
||||
if a.ValueUsage != ValueUsageDirect {
|
||||
r = append(r, ' ')
|
||||
r = append(r, a.ValueUsage.String()...)
|
||||
}
|
||||
return string(r)
|
||||
}
|
||||
|
||||
type AbilityType int8
|
||||
|
||||
//go:generate go run golang.org/x/tools/cmd/stringer@v0.41.0 -type AbilityType -trimprefix Ability
|
||||
//go:generate go run golang.org/x/tools/cmd/stringer@v0.41.0 -type AbilityType -trimprefix Ability -linecomment
|
||||
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
|
||||
AbilityPassiveSpeed AbilityType = 1 // Speed
|
||||
AbilityPassiveStamina AbilityType = 2 // Stamina
|
||||
AbilityPassivePower AbilityType = 3 // Power
|
||||
AbilityPassiveGuts AbilityType = 4 // Guts
|
||||
AbilityPassiveWit AbilityType = 5 // Wit
|
||||
AbilityGreatEscape AbilityType = 6 // Great Escape
|
||||
AbilityVision AbilityType = 8 // Vision
|
||||
AbilityHP AbilityType = 9 // HP
|
||||
AbilityGateDelay AbilityType = 10 // Gate delay multiplier
|
||||
AbilityFrenzy AbilityType = 13 // Frenzy
|
||||
AbilityCurrentSpeed AbilityType = 21 // Current speed
|
||||
AbilityTargetSpeed AbilityType = 27 // Target speed
|
||||
AbilityLaneSpeed AbilityType = 28 // Lane change speed
|
||||
AbilityAccel AbilityType = 31 // Acceleration
|
||||
AbilityLaneChange AbilityType = 35 // Forced lane change
|
||||
)
|
||||
|
||||
type AbilityValueUsage int8
|
||||
|
||||
//go:generate go run golang.org/x/tools/cmd/stringer@v0.41.0 -type AbilityValueUsage -trimprefix ValueUsage -linecomment
|
||||
const (
|
||||
ValueUsageDirect AbilityValueUsage = 1 // directly
|
||||
ValueUsageTeamSpeed AbilityValueUsage = 2 // scaling with team Speed
|
||||
ValueUsageTeamStamina AbilityValueUsage = 3 // scaling with team Stamina
|
||||
ValueUsageTeamPower AbilityValueUsage = 4 // scaling with team Power
|
||||
ValueUsageTeamGuts AbilityValueUsage = 5 // scaling with team Guts
|
||||
ValueUsageTeamWit AbilityValueUsage = 6 // scaling with team Wit
|
||||
)
|
||||
|
||||
type AbilityTarget int8
|
||||
|
||||
//go:generate go run golang.org/x/tools/cmd/stringer@v0.41.0 -type AbilityTarget -trimprefix Target -linecomment
|
||||
const (
|
||||
TargetSelf AbilityTarget = 1 // self
|
||||
TargetSympathizers AbilityTarget = 2 // others with Sympathy
|
||||
TargetInView AbilityTarget = 4 // others in view
|
||||
TargetFrontmost AbilityTarget = 7 // frontmost
|
||||
TargetAhead AbilityTarget = 9 // others ahead
|
||||
TargetBehind AbilityTarget = 10 // others behind
|
||||
TargetAllTeammates AbilityTarget = 11 // all teammates
|
||||
TargetStyle AbilityTarget = 18 // using style
|
||||
TargetRushingAhead AbilityTarget = 19 // rushing others ahead
|
||||
TargetRushingBehind AbilityTarget = 20 // rushing others behind
|
||||
TargetRushingStyle AbilityTarget = 21 // rushing using style
|
||||
TargetCharacter AbilityTarget = 22 // specific character
|
||||
TargetTriggering AbilityTarget = 23 // whosoever triggered this skill
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user