horsegen: generate sparks

This commit is contained in:
2026-02-13 13:41:04 -05:00
parent 8fb29a953c
commit db3e18e586
16 changed files with 25951 additions and 19 deletions

View File

@@ -0,0 +1,35 @@
{{- define "go-spark" -}}
package {{ $.Region }}
// Automatically generated with horsegen; DO NOT EDIT
import . "git.sunturtle.xyz/zephyr/horse/horse"
const (
{{- range $s := $.Sparks }}
Spark{{ goenum $s.Name }}Lv{{ $s.Rarity }} SparkID = {{ $s.ID }} // {{ $s.Name }}
{{- end }}
)
var AllSparks = map[SparkID]Spark{
{{- range $s := $.Sparks }}
Spark{{ goenum $s.Name }}Lv{{ $s.Rarity }}: {
ID: {{ $s.ID }},
Name: {{ printf "%q" $s.Name }},
Description: {{ printf "%q" $s.Description }},
Group: {{ $s.Group }},
Rarity: {{ $s.Rarity }},
Type: {{ $s.Type }},
Effects: [][]SparkEffect{
{{- range $r := index $.SparkEffects $s.Group }}
{
{{- range $e := $r -}}
{ {{- $e.Target }}, {{ $e.Value1 }}, {{ $e.Value2 -}} },
{{- end -}}
},
{{- end }}
},
},
{{- end }}
}
{{ end }}