horsegen: also generate go

This commit is contained in:
2026-01-14 12:18:54 -05:00
parent be41389006
commit c9a7e15f89
10 changed files with 16896 additions and 21 deletions

View File

@@ -0,0 +1,70 @@
{{- define "go-skill-data" -}}
package horse
// Automatically generated with horsegen; DO NOT EDIT
//go:generate go run golang.org/x/tools/cmd/stringer@v0.41.0 -type SkillID -trimprefix Skill -linecomment
const (
{{- range $s := $.Skills }}
Skill{{ goenum $s.Name }}{{ if ne $s.InheritID 0 }}Inherit{{ end }} SkillID = {{ $s.ID }} // {{ $s.Name }}
{{- end }}
)
var AllSkills = map[SkillID]Skill{
{{- range $s := $.Skills }}
Skill{{ goenum $s.Name }}{{ if ne $s.InheritID 0 }}Inherit{{ end }}: {
{{ $s.ID }},
{{ printf "%q" $s.Name }},
{{ printf "%q" $s.Description }},
{{ $s.GroupID }},
{{ $s.Rarity }},
{{ $s.GroupRate }},
{{ $s.GradeValue }},
{{ $s.WitCheck }},
[]Activation{
{{- range $a := $s.Activations }}
{{- if ne $a.Condition "" }}
{
{{ printf "%q" $a.Precondition }},
{{ printf "%q" $a.Condition }},
{{ $a.Duration }},
{{ $a.Cooldown }},
[]Ability{
{{- range $abil := $a.Abilities }}
{{- if ne $abil.Type 0 }}
{
{{ if eq $abil.Type 1 -}}AbilityPassiveSpeed,
{{ else if eq $abil.Type 2 -}}AbilityPassiveStamina,
{{ else if eq $abil.Type 3 -}}AbilityPassivePower,
{{ else if eq $abil.Type 4 -}}AbilityPassiveGuts,
{{ else if eq $abil.Type 5 -}}AbilityPassiveWit,
{{ else if eq $abil.Type 6 -}}AbilityGreatEscape,
{{ else if eq $abil.Type 8 -}}AbilityVision,
{{ else if eq $abil.Type 9 -}}AbilityHP,
{{ else if eq $abil.Type 10 -}}AbilityGateDelay,
{{ else if eq $abil.Type 13 -}}AbilityFrenzy,
{{ else if eq $abil.Type 21 -}}AbilityCurrentSpeed,
{{ else if eq $abil.Type 27 -}}AbilityTargetSpeed,
{{ else if eq $abil.Type 28 -}}AbilityLaneSpeed,
{{ else if eq $abil.Type 31 -}}AbilityAccel,
{{ else if eq $abil.Type 35 -}}AbilityLaneChange,
{{ else }}??? $abil.Type={{$abil.Type}}
{{ end -}}
{{ $abil.ValueUsage }},
{{ $abil.Value }},
{{ $abil.Target }},
{{ $abil.TargetValue }},
},
{{- end }}
{{- end }}
},
},
{{- end }}
{{- end }}
},
{{ $s.SPCost }},
{{ $s.IconID }},
},
{{- end }}
}
{{ end }}