horse: nicer formatting of abilities

This commit is contained in:
2026-01-17 00:32:35 -05:00
parent e6032f995f
commit 43d02b4b00

View File

@@ -63,7 +63,28 @@ func (a Ability) String() string {
r = append(r, a.Type.String()...)
if a.Value != 0 {
r = append(r, ' ')
r = append(r, a.Value.String()...)
if a.Value > 0 {
r = append(r, '+')
}
switch a.Type {
case AbilityPassiveSpeed, AbilityPassiveStamina, AbilityPassivePower, AbilityPassiveGuts, AbilityPassiveWit:
r = append(r, a.Value.String()...)
case AbilityVision:
r = append(r, a.Value.String()...)
r = append(r, 'm')
case AbilityHP, AbilityCurrentSpeed, AbilityTargetSpeed, AbilityLaneSpeed, AbilityAccel:
r = append(r, (a.Value * 100).String()...)
r = append(r, '%')
case AbilityGateDelay:
r = append(r, a.Value.String()...)
r = append(r, "×"...)
case AbilityFrenzy:
r = append(r, a.Value.String()...)
r = append(r, 's')
case AbilityLaneChange:
r = append(r, (a.Value * 100).String()...)
r = append(r, "% of track width"...)
}
}
if a.Target != TargetSelf {
r = append(r, " to "...)
@@ -89,7 +110,7 @@ const (
AbilityPassivePower AbilityType = 3 // Power
AbilityPassiveGuts AbilityType = 4 // Guts
AbilityPassiveWit AbilityType = 5 // Wit
AbilityGreatEscape AbilityType = 6 // Great Escape
AbilityGreatEscape AbilityType = 6 // Enable Great Escape
AbilityVision AbilityType = 8 // Vision
AbilityHP AbilityType = 9 // HP
AbilityGateDelay AbilityType = 10 // Gate delay multiplier