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