horse: fix formatting of abilities that target styles

This commit is contained in:
2026-02-01 15:33:04 -05:00
parent bf06de0f5e
commit 2393bf2fa5

View File

@@ -93,7 +93,25 @@ func (a Ability) String() string {
r = append(r, " track widths"...)
}
}
if a.Target != TargetSelf {
switch a.Target {
case TargetSelf:
// do nothing
case TargetStyle, TargetRushingStyle:
// TargetValue is the style to target, not the number of targets.
r = append(r, " to "...)
r = append(r, a.Target.String()...)
switch a.TargetValue {
case 1:
r = append(r, " Front Runner"...)
case 2:
r = append(r, " Pace Chaser"...)
case 3:
r = append(r, " Late Surger"...)
case 4:
r = append(r, " End Closer"...)
}
default:
// For other targeting types, TargetValue is either irrelevant or limit.
r = append(r, " to "...)
if a.TargetValue > 1 && a.TargetValue < 18 {
r = strconv.AppendInt(r, int64(a.TargetValue), 10)