Files
horse/horsegen/skill.go.template

61 lines
1.6 KiB
Plaintext

{{- define "go-skill-data" -}}
package {{ $.Region }}
// Automatically generated with horsegen; DO NOT EDIT
import . "git.sunturtle.xyz/zephyr/horse/horse"
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 }}
{ {{- $abil.Type }}, {{ $abil.ValueUsage }}, {{ $abil.Value }}, {{ $abil.Target }}, {{ $abil.TargetValue -}} },
{{- end }}
{{- end }}
},
},
{{- end }}
{{- end }}
},
{{ $s.SPCost }},
{{ $s.IconID }},
},
{{- end }}
}
var SkillNameToID = map[string]SkillID{
{{- range $s := $.Skills }}
{{ printf "%q" $s.Name }}{{ if ne $s.InheritID 0 }} + " (Inherited)"{{ end }}: {{ $s.ID }},
{{- end }}
}
var SkillGroups = map[int32][4]SkillID{
{{- range $g := $.Groups }}
{{ $g.ID }}: { {{- range $s := index $.Related $g.ID }}Skill{{ goenum $s.Name }}{{ if ne $s.InheritID 0 }}Inherit{{ end }}, {{ end -}} },
{{- end }}
}
{{ end }}