style: fix codegen formatting and run gofmt after generation

This commit is contained in:
Genqila
2025-12-28 02:07:24 +07:00
committed by guiyomu-dev
parent 44855a6340
commit b510968f7d
7 changed files with 810 additions and 811 deletions

View File

@@ -6,13 +6,13 @@ package item
const (
{{- range $key, $value := . }}
Type{{ replace $value.ItemType " " "" }} = "{{ $value.Code }}"
Type{{ replace $value.ItemType " " "" }} = "{{ $value.Code }}"
{{- end }}
)
var ItemTypes = map[string]Type{
{{- range $key, $value := . }}
Type{{ replace $value.ItemType " " "" }}: {ID: {{ $key }}, Name: "{{ $value.ItemType }}", Code: "{{ $value.Code }}", Throwable: {{ if eq $value.Throwable "1" }}true{{ else }}false{{ end }}, Beltable: {{ if eq $value.Beltable "1" }}true{{ else }}false{{ end }}, BodyLocs: []LocationType{{ if $value.BodyLoc1 }}{ {{- $loc1 := $value.BodyLoc1 }}{{- $loc1 = replace $loc1 "tors" "Torso" }}{{- $loc1 = replace $loc1 "larm" "LeftArm" }}{{- $loc1 = replace $loc1 "rarm" "RightArm" }}{{- $loc1 = replace $loc1 "lrin" "LeftRing" }}{{- $loc1 = replace $loc1 "rrin" "RightRing" }}{{- $loc1 = replace $loc1 "glov" "Gloves" }}{{- $loc1 = replace $loc1 "feet" "Feet" }}{{- $loc1 = replace $loc1 "neck" "Neck" }}{{- $loc1 = replace $loc1 "head" "Head" }}{{- $loc1 = replace $loc1 "belt" "Belt" }}Loc{{ $loc1 }}{{ if and $value.BodyLoc2 (ne $value.BodyLoc2 $value.BodyLoc1) }}{{- $loc2 := $value.BodyLoc2 }}{{- $loc2 = replace $loc2 "tors" "Torso" }}{{- $loc2 = replace $loc2 "larm" "LeftArm" }}{{- $loc2 = replace $loc2 "rarm" "RightArm" }}{{- $loc2 = replace $loc2 "lrin" "LeftRing" }}{{- $loc2 = replace $loc2 "rrin" "RightRing" }}{{- $loc2 = replace $loc2 "glov" "Gloves" }}{{- $loc2 = replace $loc2 "feet" "Feet" }}{{- $loc2 = replace $loc2 "neck" "Neck" }}{{- $loc2 = replace $loc2 "head" "Head" }}{{- $loc2 = replace $loc2 "belt" "Belt" }}, Loc{{ $loc2 }}{{ end }}}{{ else }}{}{{ end }}},
Type{{ replace $value.ItemType " " "" }}: {ID: {{ $key }}, Name: "{{ $value.ItemType }}", Code: "{{ $value.Code }}", Throwable: {{ if eq $value.Throwable "1" }}true{{ else }}false{{ end }}, Beltable: {{ if eq $value.Beltable "1" }}true{{ else }}false{{ end }}, BodyLocs: []LocationType{{ if $value.BodyLoc1 }}{ {{- $loc1 := $value.BodyLoc1 }}{{- $loc1 = replace $loc1 "tors" "Torso" }}{{- $loc1 = replace $loc1 "larm" "LeftArm" }}{{- $loc1 = replace $loc1 "rarm" "RightArm" }}{{- $loc1 = replace $loc1 "lrin" "LeftRing" }}{{- $loc1 = replace $loc1 "rrin" "RightRing" }}{{- $loc1 = replace $loc1 "glov" "Gloves" }}{{- $loc1 = replace $loc1 "feet" "Feet" }}{{- $loc1 = replace $loc1 "neck" "Neck" }}{{- $loc1 = replace $loc1 "head" "Head" }}{{- $loc1 = replace $loc1 "belt" "Belt" }}Loc{{ $loc1 }}{{ if and $value.BodyLoc2 (ne $value.BodyLoc2 $value.BodyLoc1) }}{{- $loc2 := $value.BodyLoc2 }}{{- $loc2 = replace $loc2 "tors" "Torso" }}{{- $loc2 = replace $loc2 "larm" "LeftArm" }}{{- $loc2 = replace $loc2 "rarm" "RightArm" }}{{- $loc2 = replace $loc2 "lrin" "LeftRing" }}{{- $loc2 = replace $loc2 "rrin" "RightRing" }}{{- $loc2 = replace $loc2 "glov" "Gloves" }}{{- $loc2 = replace $loc2 "feet" "Feet" }}{{- $loc2 = replace $loc2 "neck" "Neck" }}{{- $loc2 = replace $loc2 "head" "Head" }}{{- $loc2 = replace $loc2 "belt" "Belt" }}, Loc{{ $loc2 }}{{ end }}}{{ else }}{}{{ end }}},
{{- end }}
}`
@@ -22,7 +22,7 @@ package area
var Areas = map[ID]Area{
{{- range $key, $value := . }}
{{ $key }}: {Name: "{{ $value.LevelName }}", ID: {{ $key }}},
{{ $key }}: {Name: "{{ $value.LevelName }}", ID: {{ $key }}},
{{- end }}
}`
@@ -32,11 +32,11 @@ package skill
var Desc = map[SkillDesc]Description{
{{- range $key, $value := . }}
{{- if and (contains (index $value "str name") "kill") (extractInt (index $value "str name")) }}
{{- if ne (index $value "skilldesc") "townportal" }}
"{{ $value.skilldesc }}": {Page: {{ $value.SkillPage }}, Row: {{ $value.SkillRow }}, Column: {{ $value.SkillColumn }}, ListRow: {{ $value.ListRow }}, IconCel: {{ $value.IconCel }}},
{{- end }}
{{- end }}
{{- if and (contains (index $value "str name") "kill") (extractInt (index $value "str name")) }}
{{- if ne (index $value "skilldesc") "townportal" }}
"{{ $value.skilldesc }}": {Page: {{ $value.SkillPage }}, Row: {{ $value.SkillRow }}, Column: {{ $value.SkillColumn }}, ListRow: {{ $value.ListRow }}, IconCel: {{ $value.IconCel }}},
{{- end }}
{{- end }}
{{- end }}
}`
@@ -46,7 +46,7 @@ package skill
var Skills = map[ID]Skill{
{{- range $key, $value := . }}
{{ index $value "*Id" }}: {Name: "{{ $value.skill }}", SkillDesc: "{{ $value.skilldesc }}", ID: {{ $key }}, LeftSkill: {{ if eq $value.leftskill "1" }}true{{ else }}false{{ end }}, RightSkill: {{ if eq $value.rightskill "1" }}true{{ else }}false{{ end }}, ReqLevel: {{ default $value.reqlevel "0" }}, Class: "{{ default $value.charclass "" }}", ReqSkill1: "{{ default $value.reqskill1 "" }}", ReqSkill2: "{{ default $value.reqskill2 "" }}"},
{{ index $value "*Id" }}: {Name: "{{ $value.skill }}", SkillDesc: "{{ $value.skilldesc }}", ID: {{ $key }}, LeftSkill: {{ if eq $value.leftskill "1" }}true{{ else }}false{{ end }}, RightSkill: {{ if eq $value.rightskill "1" }}true{{ else }}false{{ end }}, ReqLevel: {{ default $value.reqlevel "0" }}, Class: "{{ default $value.charclass "" }}", ReqSkill1: "{{ default $value.reqskill1 "" }}", ReqSkill2: "{{ default $value.reqskill2 "" }}"},
{{- end }}
}`
@@ -56,12 +56,12 @@ package item
var Desc = map[int]Description{
{{- range $key, $value := . }}
{{ $value.ID }}: {Name: "{{ $value.name }}", ID: {{ $value.ID }}, Code: "{{ $value.code }}", NormalCode: "{{ $value.normcode }}", UberCode: "{{ $value.ubercode }}", UltraCode: "{{ $value.ultracode }}", InventoryWidth: {{ $value.invwidth }}, InventoryHeight: {{ $value.invheight }}, MinDefense: {{ $value.minac }}, MaxDefense: {{ $value.maxac }}, MinDamage: {{ $value.mindam }}, MaxDamage: {{ $value.maxdam }}, TwoHandMinDamage: {{ index $value "2handmindam" }}, TwoHandMaxDamage: {{ index $value "2handmaxdam" }}, MinMissileDamage: {{ $value.minmisdam }}, MaxMissileDamage: {{ $value.maxmisdam }}, Speed: {{ $value.speed }}, StrengthBonus: {{ $value.StrBonus }}, DexterityBonus: {{ $value.DexBonus }}, RequiredStrength: {{ $value.reqstr }}, RequiredDexterity: {{ $value.reqdex }}, Durability: {{ $value.durability }}, RequiredLevel: {{ $value.levelreq }}, MaxSockets: {{ $value.gemsockets }}, Type: "{{ $value.type }}"},
{{ $value.ID }}: {Name: "{{ $value.name }}", ID: {{ $value.ID }}, Code: "{{ $value.code }}", NormalCode: "{{ $value.normcode }}", UberCode: "{{ $value.ubercode }}", UltraCode: "{{ $value.ultracode }}", InventoryWidth: {{ $value.invwidth }}, InventoryHeight: {{ $value.invheight }}, MinDefense: {{ $value.minac }}, MaxDefense: {{ $value.maxac }}, MinDamage: {{ $value.mindam }}, MaxDamage: {{ $value.maxdam }}, TwoHandMinDamage: {{ index $value "2handmindam" }}, TwoHandMaxDamage: {{ index $value "2handmaxdam" }}, MinMissileDamage: {{ $value.minmisdam }}, MaxMissileDamage: {{ $value.maxmisdam }}, Speed: {{ $value.speed }}, StrengthBonus: {{ $value.StrBonus }}, DexterityBonus: {{ $value.DexBonus }}, RequiredStrength: {{ $value.reqstr }}, RequiredDexterity: {{ $value.reqdex }}, Durability: {{ $value.durability }}, RequiredLevel: {{ $value.levelreq }}, MaxSockets: {{ $value.gemsockets }}, Type: "{{ $value.type }}"},
{{- end }}`
const templateArmorAndMisc = `
{{- range $key, $value := . }}
{{ $value.ID }}: {Name: "{{ $value.name }}", ID: {{ $value.ID }}, Code: "{{ $value.code }}", NormalCode: "{{ $value.normcode }}", UberCode: "{{ $value.ubercode }}", UltraCode: "{{ $value.ultracode }}", InventoryWidth: {{ $value.invwidth }}, InventoryHeight: {{ $value.invheight }}, MinDefense: {{ $value.minac }}, MaxDefense: {{ $value.maxac }}, MinDamage: {{ $value.mindam }}, MaxDamage: {{ $value.maxdam }}, TwoHandMinDamage: {{ index $value "2handmindam" }}, TwoHandMaxDamage: {{ index $value "2handmaxdam" }}, MinMissileDamage: {{ $value.minmisdam }}, MaxMissileDamage: {{ $value.maxmisdam }}, Speed: {{ $value.speed }}, StrengthBonus: {{ $value.StrBonus }}, DexterityBonus: {{ $value.DexBonus }}, RequiredStrength: {{ $value.reqstr }}, RequiredDexterity: {{ $value.reqdex }}, Durability: {{ $value.durability }}, RequiredLevel: {{ $value.levelreq }}, MaxSockets: {{ $value.gemsockets }}, Type: "{{ $value.type }}"},
{{ $value.ID }}: {Name: "{{ $value.name }}", ID: {{ $value.ID }}, Code: "{{ $value.code }}", NormalCode: "{{ $value.normcode }}", UberCode: "{{ $value.ubercode }}", UltraCode: "{{ $value.ultracode }}", InventoryWidth: {{ $value.invwidth }}, InventoryHeight: {{ $value.invheight }}, MinDefense: {{ $value.minac }}, MaxDefense: {{ $value.maxac }}, MinDamage: {{ $value.mindam }}, MaxDamage: {{ $value.maxdam }}, TwoHandMinDamage: {{ index $value "2handmindam" }}, TwoHandMaxDamage: {{ index $value "2handmaxdam" }}, MinMissileDamage: {{ $value.minmisdam }}, MaxMissileDamage: {{ $value.maxmisdam }}, Speed: {{ $value.speed }}, StrengthBonus: {{ $value.StrBonus }}, DexterityBonus: {{ $value.DexBonus }}, RequiredStrength: {{ $value.reqstr }}, RequiredDexterity: {{ $value.reqdex }}, Durability: {{ $value.durability }}, RequiredLevel: {{ $value.levelreq }}, MaxSockets: {{ $value.gemsockets }}, Type: "{{ $value.type }}"},
{{- end }}
`
@@ -142,7 +142,7 @@ package entrance
var Desc = map[int]Description{
{{- range $key, $value := . }}
{{ $value.UniqueId }}: {ID: {{ $value.UniqueId }}, Name: "{{ $value.Name }}", SelectX: {{ $value.SelectX }}, SelectY: {{ $value.SelectY }}, SelectDX: {{ $value.SelectDX }}, SelectDY: {{ $value.SelectDY }}, OffsetX: {{ $value.OffsetX }}, OffsetY: {{ $value.OffsetY }}, Direction: "{{ $value.Direction }}"},
{{ $value.UniqueId }}: {ID: {{ $value.UniqueId }}, Name: "{{ $value.Name }}", SelectX: {{ $value.SelectX }}, SelectY: {{ $value.SelectY }}, SelectDX: {{ $value.SelectDX }}, SelectDY: {{ $value.SelectDY }}, OffsetX: {{ $value.OffsetX }}, OffsetY: {{ $value.OffsetY }}, Direction: "{{ $value.Direction }}"},
{{- end }}
}`
const templateRarePrefixes = `// Code generated by cmd/txttocode. DO NOT EDIT.
@@ -150,15 +150,15 @@ const templateRarePrefixes = `// Code generated by cmd/txttocode. DO NOT EDIT.
package item
type RarePrefix struct {
ID int
Name string
ItemTypes []string
ExcludeTypes []string
ID int
Name string
ItemTypes []string
ExcludeTypes []string
}
var RarePrefixDesc = map[int]RarePrefix{
{{- range $index, $value := . }}
{{ add $index 156 }}: {ID: {{ add $index 156 }}, Name: "{{ $value.name }}", ItemTypes: []string{ {{- $types := slice }}{{- range $i := iterate 7 }}{{- with index $value (printf "itype%d" (add $i 1)) }}{{- if ne . "" }}{{- $types = append $types . }}{{- end }}{{- end }}{{- end }}{{- range $i, $type := $types }}{{if $i}}, {{end}}"{{ $type }}"{{- end -}} }, ExcludeTypes: []string{ {{- $types := slice }}{{- range $i := iterate 4 }}{{- with index $value (printf "etype%d" (add $i 1)) }}{{- if ne . "" }}{{- $types = append $types . }}{{- end }}{{- end }}{{- end }}{{- range $i, $type := $types }}{{if $i}}, {{end}}"{{ $type }}"{{- end -}} }},
{{ add $index 156 }}: {ID: {{ add $index 156 }}, Name: "{{ $value.name }}", ItemTypes: []string{ {{- $types := slice }}{{- range $i := iterate 7 }}{{- with index $value (printf "itype%d" (add $i 1)) }}{{- if ne . "" }}{{- $types = append $types . }}{{- end }}{{- end }}{{- end }}{{- range $i, $type := $types }}{{if $i}}, {{end}}"{{ $type }}"{{- end -}} }, ExcludeTypes: []string{ {{- $types := slice }}{{- range $i := iterate 4 }}{{- with index $value (printf "etype%d" (add $i 1)) }}{{- if ne . "" }}{{- $types = append $types . }}{{- end }}{{- end }}{{- end }}{{- range $i, $type := $types }}{{if $i}}, {{end}}"{{ $type }}"{{- end -}} }},
{{- end }}
}`
const templateRareSuffixes = `// Code generated by cmd/txttocode. DO NOT EDIT.
@@ -166,9 +166,9 @@ const templateRareSuffixes = `// Code generated by cmd/txttocode. DO NOT EDIT.
package item
type RareSuffix struct {
ID int
Name string
ItemTypes []string
ID int
Name string
ItemTypes []string
}
var RareSuffixDesc = map[int]RareSuffix{
@@ -181,22 +181,22 @@ const templateMagicPrefixes = `// Code generated by cmd/txttocode. DO NOT EDIT.
package item
type MagicPrefix struct {
ID int
Name string
Rare bool
Level int
LevelReq int
Group int
Mods []Mod
TransformColor string
ItemTypes []string
ExcludeTypes []string
ID int
Name string
Rare bool
Level int
LevelReq int
Group int
Mods []Mod
TransformColor string
ItemTypes []string
ExcludeTypes []string
}
var MagicPrefixDesc = map[int]MagicPrefix{
{{- range $index, $value := . }}
{{- if ne $value.Name "" }}
{{ add $index 747 }}: {ID: {{ add $index 747 }}, Name: "{{ $value.Name }}", Rare: {{ if eq $value.rare "1" }}true{{ else }}false{{ end }}, Level: {{ if eq $value.level "" }}0{{ else }}{{ $value.level }}{{ end }}, LevelReq: {{ if eq $value.levelreq "" }}0{{ else }}{{ $value.levelreq }}{{ end }}, Group: {{ if eq $value.group "" }}0{{ else }}{{ $value.group }}{{ end }}, Mods: []Mod{ {{- $mods := slice }}{{- if ne $value.mod1code "" }}{{- $mods = append $mods (printf "{Code: \"%s\", Param: \"%s\", Min: %s, Max: %s}" $value.mod1code $value.mod1param (default $value.mod1min "0") (default $value.mod1max "0")) }}{{- end }}{{- if ne $value.mod2code "" }}{{- $mods = append $mods (printf "{Code: \"%s\", Param: \"%s\", Min: %s, Max: %s}" $value.mod2code $value.mod2param (default $value.mod2min "0") (default $value.mod2max "0")) }}{{- end }}{{- if ne $value.mod3code "" }}{{- $mods = append $mods (printf "{Code: \"%s\", Param: \"%s\", Min: %s, Max: %s}" $value.mod3code $value.mod3param (default $value.mod3min "0") (default $value.mod3max "0")) }}{{- end }}{{- range $i, $mod := $mods }}{{if $i}}, {{end}}{{ $mod }}{{- end -}} }, TransformColor: "{{ $value.transformcolor }}", ItemTypes: []string{ {{- $types := slice }}{{- range $i := iterate 7 }}{{- with index $value (printf "itype%d" (add $i 1)) }}{{- if ne . "" }}{{- $types = append $types . }}{{- end }}{{- end }}{{- end }}{{- range $i, $type := $types }}{{if $i}}, {{end}}"{{ $type }}"{{- end -}} }, ExcludeTypes: []string{ {{- $types := slice }}{{- range $i := iterate 5 }}{{- with index $value (printf "etype%d" (add $i 1)) }}{{- if ne . "" }}{{- $types = append $types . }}{{- end }}{{- end }}{{- end }}{{- range $i, $type := $types }}{{if $i}}, {{end}}"{{ $type }}"{{- end -}} }},
{{ add $index 747 }}: {ID: {{ add $index 747 }}, Name: "{{ $value.Name }}", Rare: {{ if eq $value.rare "1" }}true{{ else }}false{{ end }}, Level: {{ if eq $value.level "" }}0{{ else }}{{ $value.level }}{{ end }}, LevelReq: {{ if eq $value.levelreq "" }}0{{ else }}{{ $value.levelreq }}{{ end }}, Group: {{ if eq $value.group "" }}0{{ else }}{{ $value.group }}{{ end }}, Mods: []Mod{ {{- $mods := slice }}{{- if ne $value.mod1code "" }}{{- $mods = append $mods (printf "{Code: \"%s\", Param: \"%s\", Min: %s, Max: %s}" $value.mod1code $value.mod1param (default $value.mod1min "0") (default $value.mod1max "0")) }}{{- end }}{{- if ne $value.mod2code "" }}{{- $mods = append $mods (printf "{Code: \"%s\", Param: \"%s\", Min: %s, Max: %s}" $value.mod2code $value.mod2param (default $value.mod2min "0") (default $value.mod2max "0")) }}{{- end }}{{- if ne $value.mod3code "" }}{{- $mods = append $mods (printf "{Code: \"%s\", Param: \"%s\", Min: %s, Max: %s}" $value.mod3code $value.mod3param (default $value.mod3min "0") (default $value.mod3max "0")) }}{{- end }}{{- range $i, $mod := $mods }}{{if $i}}, {{end}}{{ $mod }}{{- end -}} }, TransformColor: "{{ $value.transformcolor }}", ItemTypes: []string{ {{- $types := slice }}{{- range $i := iterate 7 }}{{- with index $value (printf "itype%d" (add $i 1)) }}{{- if ne . "" }}{{- $types = append $types . }}{{- end }}{{- end }}{{- end }}{{- range $i, $type := $types }}{{if $i}}, {{end}}"{{ $type }}"{{- end -}} }, ExcludeTypes: []string{ {{- $types := slice }}{{- range $i := iterate 5 }}{{- with index $value (printf "etype%d" (add $i 1)) }}{{- if ne . "" }}{{- $types = append $types . }}{{- end }}{{- end }}{{- end }}{{- range $i, $type := $types }}{{if $i}}, {{end}}"{{ $type }}"{{- end -}} }},
{{- end }}
{{- end }}
}`
@@ -206,29 +206,29 @@ const templateMagicSuffixes = `// Code generated by cmd/txttocode. DO NOT EDIT.
package item
type MagicSuffix struct {
ID int
Name string
Rare bool
Level int
LevelReq int
Group int
Mods []Mod
TransformColor string
ItemTypes []string
ExcludeTypes []string
ID int
Name string
Rare bool
Level int
LevelReq int
Group int
Mods []Mod
TransformColor string
ItemTypes []string
ExcludeTypes []string
}
type Mod struct {
Code string
Param string
Min int
Max int
Code string
Param string
Min int
Max int
}
var MagicSuffixDesc = map[int]MagicSuffix{
{{- range $index, $value := . }}
{{- if ne $value.Name "" }}
{{ $index }}: {ID: {{ $index }}, Name: "{{ $value.Name }}", Rare: {{ if eq $value.rare "1" }}true{{ else }}false{{ end }}, Level: {{ if eq $value.level "" }}0{{ else }}{{ $value.level }}{{ end }}, LevelReq: {{ if eq $value.levelreq "" }}0{{ else }}{{ $value.levelreq }}{{ end }}, Group: {{ if eq $value.group "" }}0{{ else }}{{ $value.group }}{{ end }}, Mods: []Mod{ {{- $mods := slice }}{{- if ne $value.mod1code "" }}{{- $mods = append $mods (printf "{Code: \"%s\", Param: \"%s\", Min: %s, Max: %s}" $value.mod1code $value.mod1param (default $value.mod1min "0") (default $value.mod1max "0")) }}{{- end }}{{- if ne $value.mod2code "" }}{{- $mods = append $mods (printf "{Code: \"%s\", Param: \"%s\", Min: %s, Max: %s}" $value.mod2code $value.mod2param (default $value.mod2min "0") (default $value.mod2max "0")) }}{{- end }}{{- if ne $value.mod3code "" }}{{- $mods = append $mods (printf "{Code: \"%s\", Param: \"%s\", Min: %s, Max: %s}" $value.mod3code $value.mod3param (default $value.mod3min "0") (default $value.mod3max "0")) }}{{- end }}{{- range $i, $mod := $mods }}{{if $i}}, {{end}}{{ $mod }}{{- end -}} }, TransformColor: "{{ $value.transformcolor }}", ItemTypes: []string{ {{- $types := slice }}{{- range $i := iterate 7 }}{{- with index $value (printf "itype%d" (add $i 1)) }}{{- if ne . "" }}{{- $types = append $types . }}{{- end }}{{- end }}{{- end }}{{- range $i, $type := $types }}{{if $i}}, {{end}}"{{ $type }}"{{- end -}} }, ExcludeTypes: []string{ {{- $types := slice }}{{- range $i := iterate 5 }}{{- with index $value (printf "etype%d" (add $i 1)) }}{{- if ne . "" }}{{- $types = append $types . }}{{- end }}{{- end }}{{- end }}{{- range $i, $type := $types }}{{if $i}}, {{end}}"{{ $type }}"{{- end -}} }},
{{ $index }}: {ID: {{ $index }}, Name: "{{ $value.Name }}", Rare: {{ if eq $value.rare "1" }}true{{ else }}false{{ end }}, Level: {{ if eq $value.level "" }}0{{ else }}{{ $value.level }}{{ end }}, LevelReq: {{ if eq $value.levelreq "" }}0{{ else }}{{ $value.levelreq }}{{ end }}, Group: {{ if eq $value.group "" }}0{{ else }}{{ $value.group }}{{ end }}, Mods: []Mod{ {{- $mods := slice }}{{- if ne $value.mod1code "" }}{{- $mods = append $mods (printf "{Code: \"%s\", Param: \"%s\", Min: %s, Max: %s}" $value.mod1code $value.mod1param (default $value.mod1min "0") (default $value.mod1max "0")) }}{{- end }}{{- if ne $value.mod2code "" }}{{- $mods = append $mods (printf "{Code: \"%s\", Param: \"%s\", Min: %s, Max: %s}" $value.mod2code $value.mod2param (default $value.mod2min "0") (default $value.mod2max "0")) }}{{- end }}{{- if ne $value.mod3code "" }}{{- $mods = append $mods (printf "{Code: \"%s\", Param: \"%s\", Min: %s, Max: %s}" $value.mod3code $value.mod3param (default $value.mod3min "0") (default $value.mod3max "0")) }}{{- end }}{{- range $i, $mod := $mods }}{{if $i}}, {{end}}{{ $mod }}{{- end -}} }, TransformColor: "{{ $value.transformcolor }}", ItemTypes: []string{ {{- $types := slice }}{{- range $i := iterate 7 }}{{- with index $value (printf "itype%d" (add $i 1)) }}{{- if ne . "" }}{{- $types = append $types . }}{{- end }}{{- end }}{{- end }}{{- range $i, $type := $types }}{{if $i}}, {{end}}"{{ $type }}"{{- end -}} }, ExcludeTypes: []string{ {{- $types := slice }}{{- range $i := iterate 5 }}{{- with index $value (printf "etype%d" (add $i 1)) }}{{- if ne . "" }}{{- $types = append $types . }}{{- end }}{{- end }}{{- end }}{{- range $i, $type := $types }}{{if $i}}, {{end}}"{{ $type }}"{{- end -}} }},
{{- end }}
{{- end }}
}`
@@ -240,43 +240,43 @@ package item
type UniqueName string
const (
None UniqueName = ""
None UniqueName = ""
{{- range $key, $value := . }}
{{- if and (ne $value.index "") (ne $value.enabled "0") (ne (index $value "lvl req") "") }}
{{- if eq $value.index "Rainbow Facet" }}
{{- if contains $value.prop4 "death-skill" }}
RainbowFacet{{ replace $value.par4 " " "" }}Death UniqueName = "Rainbow Facet ({{ $value.par4 }} Death)"
{{- else if contains $value.prop4 "levelup-skill" }}
RainbowFacet{{ replace $value.par4 " " "" }}Level UniqueName = "Rainbow Facet ({{ $value.par4 }} Level)"
{{- end }}
{{- else }}
{{ replace (replace (replace $value.index "'" "") " " "") "-" "" }} UniqueName = "{{ $value.index }}"
{{- end }}
{{- end }}
{{- if and (ne $value.index "") (ne $value.enabled "0") (ne (index $value "lvl req") "") }}
{{- if eq $value.index "Rainbow Facet" }}
{{- if contains $value.prop4 "death-skill" }}
RainbowFacet{{ replace $value.par4 " " "" }}Death UniqueName = "Rainbow Facet ({{ $value.par4 }} Death)"
{{- else if contains $value.prop4 "levelup-skill" }}
RainbowFacet{{ replace $value.par4 " " "" }}Level UniqueName = "Rainbow Facet ({{ $value.par4 }} Level)"
{{- end }}
{{- else }}
{{ replace (replace (replace $value.index "'" "") " " "") "-" "" }} UniqueName = "{{ $value.index }}"
{{- end }}
{{- end }}
{{- end }}
)
type UniqueItemInfo struct {
Name string
Code string
LevelReq int
Rarity int
ID int
Name string
Code string
LevelReq int
Rarity int
ID int
}
var UniqueItems = map[UniqueName]UniqueItemInfo{
{{- range $key, $value := . }}
{{- if and (ne $value.index "") (ne $value.enabled "0") (ne (index $value "lvl req") "") }}
{{- if eq $value.index "Rainbow Facet" }}
{{- if contains $value.prop4 "death-skill" }}
RainbowFacet{{ replace $value.par4 " " "" }}Death: {Name: "Rainbow Facet", Code: "{{ $value.code }}", LevelReq: {{ index $value "lvl req" }}, Rarity: {{ $value.rarity }}, ID: {{ index $value "*ID" }}},
{{- else if contains $value.prop4 "levelup-skill" }}
RainbowFacet{{ replace $value.par4 " " "" }}Level: {Name: "Rainbow Facet", Code: "{{ $value.code }}", LevelReq: {{ index $value "lvl req" }}, Rarity: {{ $value.rarity }}, ID: {{ index $value "*ID" }}},
{{- end }}
{{- else }}
{{ replace (replace (replace $value.index "'" "") " " "") "-" "" }}: {Name: "{{ $value.index }}", Code: "{{ $value.code }}", LevelReq: {{ index $value "lvl req" }}, Rarity: {{ $value.rarity }}, ID: {{ index $value "*ID" }}},
{{- end }}
{{- end }}
{{- if and (ne $value.index "") (ne $value.enabled "0") (ne (index $value "lvl req") "") }}
{{- if eq $value.index "Rainbow Facet" }}
{{- if contains $value.prop4 "death-skill" }}
RainbowFacet{{ replace $value.par4 " " "" }}Death: {Name: "Rainbow Facet", Code: "{{ $value.code }}", LevelReq: {{ index $value "lvl req" }}, Rarity: {{ $value.rarity }}, ID: {{ index $value "*ID" }}},
{{- else if contains $value.prop4 "levelup-skill" }}
RainbowFacet{{ replace $value.par4 " " "" }}Level: {Name: "Rainbow Facet", Code: "{{ $value.code }}", LevelReq: {{ index $value "lvl req" }}, Rarity: {{ $value.rarity }}, ID: {{ index $value "*ID" }}},
{{- end }}
{{- else }}
{{ replace (replace (replace $value.index "'" "") " " "") "-" "" }}: {Name: "{{ $value.index }}", Code: "{{ $value.code }}", LevelReq: {{ index $value "lvl req" }}, Rarity: {{ $value.rarity }}, ID: {{ index $value "*ID" }}},
{{- end }}
{{- end }}
{{- end }}
}`
@@ -288,28 +288,28 @@ type SetName string
type SetItemName string
const (
SetItemNone SetItemName = ""
SetItemNone SetItemName = ""
{{- range $key, $value := . }}
{{- if ne $value.index "" }}
{{ replace (replace (replace $value.index "'" "") " " "") "-" "" }} SetItemName = "{{ $value.index }}"
{{- end }}
{{- if ne $value.index "" }}
{{ replace (replace (replace $value.index "'" "") " " "") "-" "" }} SetItemName = "{{ $value.index }}"
{{- end }}
{{- end }}
)
type SetItemInfo struct {
Name string
SetName string
Code string
LevelReq int
Rarity int
ID int
Name string
SetName string
Code string
LevelReq int
Rarity int
ID int
}
var SetItems = map[SetItemName]SetItemInfo{
{{- range $key, $value := . }}
{{- if ne $value.index "" }}
{{ replace (replace (replace $value.index "'" "") " " "") "-" "" }}: {Name: "{{ $value.index }}", SetName: "{{ $value.set }}", Code: "{{ $value.item }}", LevelReq: {{ index $value "lvl req" }}, Rarity: {{ $value.rarity }}, ID: {{ index $value "*ID" }}},
{{- end }}
{{- if ne $value.index "" }}
{{ replace (replace (replace $value.index "'" "") " " "") "-" "" }}: {Name: "{{ $value.index }}", SetName: "{{ $value.set }}", Code: "{{ $value.item }}", LevelReq: {{ index $value "lvl req" }}, Rarity: {{ $value.rarity }}, ID: {{ index $value "*ID" }}},
{{- end }}
{{- end }}
}
@@ -317,26 +317,26 @@ var Sets = map[string][]SetItemName{
{{- $currentSet := "" }}
{{- $setItems := slice }}
{{- range $key, $value := . }}
{{- if ne $value.index "" }}
{{- if ne $currentSet $value.set }}
{{- if ne $currentSet "" }}
"{{ $currentSet }}": {
{{- range $setItems }}
{{ . }},
{{- end }}
},
{{- end }}
{{- $currentSet = $value.set }}
{{- $setItems = slice }}
{{- end }}
{{- $setItems = append $setItems (printf "%s" (replace (replace (replace $value.index "'" "") " " "") "-" "")) }}
{{- end }}
{{- if ne $value.index "" }}
{{- if ne $currentSet $value.set }}
{{- if ne $currentSet "" }}
"{{ $currentSet }}": {
{{- range $setItems }}
{{ . }},
{{- end }}
},
{{- end }}
{{- $currentSet = $value.set }}
{{- $setItems = slice }}
{{- end }}
{{- $setItems = append $setItems (printf "%s" (replace (replace (replace $value.index "'" "") " " "") "-" "")) }}
{{- end }}
{{- end }}
{{- if ne $currentSet "" }}
"{{ $currentSet }}": {
{{- range $setItems }}
{{ . }},
{{- end }}
},
"{{ $currentSet }}": {
{{- range $setItems }}
{{ . }},
{{- end }}
},
{{- end }}
}`