horse: nicer formatting of abilities
This commit is contained in:
@@ -63,7 +63,28 @@ func (a Ability) String() string {
|
|||||||
r = append(r, a.Type.String()...)
|
r = append(r, a.Type.String()...)
|
||||||
if a.Value != 0 {
|
if a.Value != 0 {
|
||||||
r = append(r, ' ')
|
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 {
|
if a.Target != TargetSelf {
|
||||||
r = append(r, " to "...)
|
r = append(r, " to "...)
|
||||||
@@ -89,7 +110,7 @@ const (
|
|||||||
AbilityPassivePower AbilityType = 3 // Power
|
AbilityPassivePower AbilityType = 3 // Power
|
||||||
AbilityPassiveGuts AbilityType = 4 // Guts
|
AbilityPassiveGuts AbilityType = 4 // Guts
|
||||||
AbilityPassiveWit AbilityType = 5 // Wit
|
AbilityPassiveWit AbilityType = 5 // Wit
|
||||||
AbilityGreatEscape AbilityType = 6 // Great Escape
|
AbilityGreatEscape AbilityType = 6 // Enable Great Escape
|
||||||
AbilityVision AbilityType = 8 // Vision
|
AbilityVision AbilityType = 8 // Vision
|
||||||
AbilityHP AbilityType = 9 // HP
|
AbilityHP AbilityType = 9 // HP
|
||||||
AbilityGateDelay AbilityType = 10 // Gate delay multiplier
|
AbilityGateDelay AbilityType = 10 // Gate delay multiplier
|
||||||
|
|||||||
Reference in New Issue
Block a user