horsegen: generate sparks
This commit is contained in:
35
horsegen/spark.go.template
Normal file
35
horsegen/spark.go.template
Normal 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 }}
|
||||
Reference in New Issue
Block a user