horse, horsegen: redesign approach for koka
This commit is contained in:
@@ -1,347 +1,213 @@
|
||||
{{- define "koka-skill-group" -}}
|
||||
module horse/{{ $.Region }}/skill-group
|
||||
|
||||
// Automatically generated with horsegen; DO NOT EDIT
|
||||
|
||||
// Skill groups.
|
||||
// A skill group may contain white, circle, double-circle, gold, and purple skills
|
||||
// for the same effect.
|
||||
// Sparks that grant skills refer to a skill group.
|
||||
pub type skill-group
|
||||
{{- range $g := $.Groups }}
|
||||
{{ kkenum $g.Name }}
|
||||
{{- end }}
|
||||
|
||||
// Map a skill group to its ID.
|
||||
pub fip fun skill-group/group-id(^sg: skill-group): int
|
||||
match sg
|
||||
{{- range $g := $.Groups }}
|
||||
{{ kkenum $g.Name }} -> {{ $g.ID }}
|
||||
{{- end }}
|
||||
|
||||
// Get the skill group for an ID.
|
||||
pub fip(1) fun skill-group/from-id(^id: int): maybe<skill-group>
|
||||
match id
|
||||
{{- range $g := $.Groups }}
|
||||
{{ $g.ID }} -> Just( {{- kkenum $g.Name -}} )
|
||||
{{- end }}
|
||||
_ -> Nothing
|
||||
|
||||
// Get the name for a skill group.
|
||||
// Skill group names are the name of the base skill in the group.
|
||||
pub fun skill-group/show(sg: skill-group): string
|
||||
match sg
|
||||
{{- range $g := $.Groups }}
|
||||
{{ kkenum $g.Name }} -> {{ printf "%q" $g.Name }}
|
||||
{{- end }}
|
||||
|
||||
// Compare two skill groups by ID order.
|
||||
pub fip fun skill-group/order2(a: skill-group, b: skill-group): order2<skill-group>
|
||||
match cmp(a.group-id, b.group-id)
|
||||
Lt -> Lt2(a, b)
|
||||
Eq -> Eq2(a)
|
||||
Gt -> Gt2(a, b)
|
||||
|
||||
pub fun skill-group/(==)(a: skill-group, b: skill-group): bool
|
||||
a.group-id == b.group-id
|
||||
|
||||
{{- end -}}
|
||||
|
||||
{{- define "koka-skill" -}}
|
||||
module horse/{{ $.Region }}/skill
|
||||
|
||||
// Automatically generated with horsegen; DO NOT EDIT
|
||||
|
||||
import std/data/rb-map
|
||||
import std/num/decimal
|
||||
pub import horse/{{ $.Region }}/skill-group
|
||||
import horse/game-id
|
||||
import horse/movement
|
||||
pub import horse/skill
|
||||
|
||||
// Skill instances.
|
||||
pub type skill
|
||||
val name2id: rbmap<string, skill-id> = rb-map/empty()
|
||||
{{- range $s := $.Skills }}
|
||||
{{ kkenum $s.Name }}{{ if ne $s.InheritID 0 }}-Inherit{{ end -}}
|
||||
.set({{ printf "%q" $s.Name }}{{ if $s.InheritID }} ++ " (Inherited)"{{ end }}, Skill-id({{ $s.ID }}))
|
||||
{{- end }}
|
||||
|
||||
// Map a skill to its ID.
|
||||
pub fip fun skill/skill-id(^s: skill): int
|
||||
match s
|
||||
{{- range $s := $.Skills }}
|
||||
{{ kkenum $s.Name }}{{ if ne $s.InheritID 0 }}-Inherit{{ end }} -> {{ $s.ID }}
|
||||
{{- end }}
|
||||
// Get the skill ID that has the given exact name.
|
||||
// Inherited skills have `" (Inherited)"` appended to their names.
|
||||
// If no skill matches the ID, the result is an invalid ID.
|
||||
pub fun from-name(name: string): skill-id
|
||||
name2id.lookup(name).default(Skill-id(0))
|
||||
|
||||
// Get the skill for an ID.
|
||||
pub fip(1) fun skill/from-id(^id: int): maybe<skill>
|
||||
match id
|
||||
// Get the name for a skill.
|
||||
// Inherited skills have `" (Inherited)"` appended to their names.
|
||||
// If no skill matches the ID, the result is the numeric ID.
|
||||
pub fun show(s: skill-id): string
|
||||
match s.game-id
|
||||
{{- range $s := $.Skills }}
|
||||
{{ $s.ID }} -> Just( {{- kkenum $s.Name -}}{{ if ne $s.InheritID 0 }}-Inherit{{ end -}} )
|
||||
{{ $s.ID }} -> {{ printf "%q" $s.Name }}{{ if $s.InheritID }} ++ " (Inherited)"{{ end }}
|
||||
{{- end }}
|
||||
x -> "skill " ++ x.show
|
||||
|
||||
// Get the description for a skill.
|
||||
// If no skill matches the ID, the result is the empty string.
|
||||
pub fun description(s: skill-id): string
|
||||
match s.game-id
|
||||
{{- range $s := $.Skills }}
|
||||
{{ $s.ID }} -> {{ printf "%q" $s.Description }}
|
||||
{{- end }}
|
||||
_ -> ""
|
||||
|
||||
// Get the skill group ID for a skill.
|
||||
// If no skill matches the ID, the result is an invalid ID.
|
||||
pub fun group(s: skill-id): skill-group-id
|
||||
match s.game-id
|
||||
{{- range $s := $.Skills }}
|
||||
{{ $s.ID }} -> Skill-group-id( {{- $s.GroupID -}} )
|
||||
{{- end }}
|
||||
_ -> Skill-group-id(0)
|
||||
|
||||
// Get the rarity of a skill.
|
||||
// If no skill matches the ID, the result is Common.
|
||||
pub fun rarity(s: skill-id): rarity
|
||||
match s.game-id
|
||||
{{- range $s := $.Skills }}
|
||||
{{ $s.ID }} -> {{ if eq $s.Rarity 1 }}Common{{ else if eq $s.Rarity 2 }}Rare{{ else if eq $s.Rarity 3 }}Unique-Low{{ else if eq $s.Rarity 4 }}Unique-Upgraded{{ else if eq $s.Rarity 5 }}Unique{{ else }}??? $s.Rarity={{ $s.Rarity }}{{ end }}
|
||||
{{- end }}
|
||||
_ -> Common
|
||||
|
||||
// Get the group rate of a skill.
|
||||
// If no skill matches the ID, the result is 0.
|
||||
pub fun group-rate(s: skill-id): int
|
||||
match s.game-id
|
||||
{{- range $s := $.Skills }}
|
||||
{{ $s.ID }} -> {{ $s.GroupRate }}
|
||||
{{- end }}
|
||||
_ -> 0
|
||||
|
||||
// Get the grade value of a skill.
|
||||
// If no skill matches the ID, the result is 0.
|
||||
pub fun grade-value(s: skill-id): int
|
||||
match s.game-id
|
||||
{{- range $s := $.Skills }}
|
||||
{{ $s.ID }} -> {{ $s.GradeValue }}
|
||||
{{- end }}
|
||||
_ -> 0
|
||||
|
||||
// Get whether a skill is a wit check.
|
||||
// If no skill matches the ID, the result is False.
|
||||
pub fun wit-check(s: skill-id): bool
|
||||
match s.game-id
|
||||
{{- range $s := $.Skills }}
|
||||
{{ $s.ID }} -> {{ if $s.WitCheck }}True{{ else }}False{{ end }}
|
||||
{{- end }}
|
||||
_ -> False
|
||||
|
||||
// Get the activations of a skill.
|
||||
// If no skill matches the ID, the result is an empty list.
|
||||
pub fun activations(s: skill-id): list<activation>
|
||||
match s.game-id
|
||||
{{- range $s := $.Skills }}
|
||||
{{ $s.ID }} -> [
|
||||
{{- range $a := $s.Activations }}
|
||||
{{- if $a.Condition }}
|
||||
Activation(
|
||||
precondition = {{ printf "%q" $a.Precondition }},
|
||||
condition = {{ printf "%q" $a.Condition }},
|
||||
duration = {{ $a.Duration }}.decimal{{ if gt $a.Duration 0 }}(-4){{ end }},
|
||||
cooldown = {{ $a.Cooldown }}.decimal{{ if gt $a.Cooldown 0 }}(-4){{ end }},
|
||||
abilities = [
|
||||
{{- range $abil := $a.Abilities }}
|
||||
{{- if $abil.Type }}
|
||||
Ability(
|
||||
ability-type = {{ if eq $abil.Type 1 }}Passive-Speed({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 2 }}Passive-Stamina({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 3 }}Passive-Power({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 4 }}Passive-Guts({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 5 }}Passive-Wit({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 6 }}Great-Escape
|
||||
{{- else if eq $abil.Type 8 }}Vision({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 9 }}HP({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 10 }}Gate-Delay({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 13 }}Frenzy({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 21 }}Current-Speed({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 27 }}Target-Speed({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 28 }}Lane-Speed({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 31 }}Accel({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 35 }}Lane-Change({{ $abil.Value }}.decimal(-4))
|
||||
{{- else }}??? $abil.Type={{$abil.Type}}
|
||||
{{- end }},
|
||||
value-usage = {{ if eq $abil.ValueUsage 1 }}Direct
|
||||
{{- else if eq $abil.ValueUsage 3 }}Team-Speed
|
||||
{{- else if eq $abil.ValueUsage 4 }}Team-Stamina
|
||||
{{- else if eq $abil.ValueUsage 5 }}Team-Power
|
||||
{{- else if eq $abil.ValueUsage 6 }}Team-Guts
|
||||
{{- else if eq $abil.ValueUsage 7 }}Team-Wit
|
||||
{{- else if eq $abil.ValueUsage 8 }}Multiply-Random
|
||||
{{- else if eq $abil.ValueUsage 9 }}Multiply-Random2
|
||||
{{- else if eq $abil.ValueUsage 10 }}Climax
|
||||
{{- else if eq $abil.ValueUsage 13 }}Max-Stat
|
||||
{{- else if eq $abil.ValueUsage 14 }}Passive-Count
|
||||
{{- else if eq $abil.ValueUsage 19 }}Front-Distance-Add
|
||||
{{- else if eq $abil.ValueUsage 20 }}Midrace-Side-Block-Time
|
||||
{{- else if eq $abil.ValueUsage 22 }}Speed-Scaling
|
||||
{{- else if eq $abil.ValueUsage 23 }}Speed-Scaling2
|
||||
{{- else if eq $abil.ValueUsage 24 }}Arc-Global-Potential
|
||||
{{- else if eq $abil.ValueUsage 25 }}Max-Lead-Distance
|
||||
{{- else }}??? $abil.ValueUsage={{ $abil.ValueUsage }}
|
||||
{{- end }},
|
||||
target = {{ if eq $abil.Target 1}}Self
|
||||
{{- else if eq $abil.Target 4 }}Sympathizers
|
||||
{{- else if eq $abil.Target 4 }}In-View
|
||||
{{- else if eq $abil.Target 4 }}Frontmost
|
||||
{{- else if eq $abil.Target 9 }}Ahead({{ $abil.TargetValue }})
|
||||
{{- else if eq $abil.Target 10 }}Behind({{ $abil.TargetValue }})
|
||||
{{- else if eq $abil.Target 4 }}All-Teammates
|
||||
{{- else if eq $abil.Target 18 }}Style({{ if eq $abil.TargetValue 1 }}Front-Runner{{ else if eq $abil.TargetValue 2 }}Pace-Chaser{{ else if eq $abil.TargetValue 3 }}Late-Surger{{ else if eq $abil.TargetValue 4 }}End-Closer{{ else }}??? $abil.TargetValue={{ $abil.TargetValue }}{{ end }})
|
||||
{{- else if eq $abil.Target 19 }}Rushing-Ahead({{ $abil.TargetValue }})
|
||||
{{- else if eq $abil.Target 20 }}Rushing-Behind({{ $abil.TargetValue }})
|
||||
{{- else if eq $abil.Target 21 }}Rushing-Style({{ if eq $abil.TargetValue 1 }}Front-Runner{{ else if eq $abil.TargetValue 2 }}Pace-Chaser{{ else if eq $abil.TargetValue 3 }}Late-Surger{{ else if eq $abil.TargetValue 4 }}End-Closer{{ else }}??? $abil.TargetValue={{ $abil.TargetValue }}{{ end }})
|
||||
{{- else if eq $abil.Target 22 }}Specific-Character(Character-id({{ $abil.TargetValue }}))
|
||||
{{- else if eq $abil.Target 23 }}Triggering
|
||||
{{- end }}
|
||||
),
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
]
|
||||
),
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
]
|
||||
{{- end }}
|
||||
_ -> Nil
|
||||
|
||||
// Get the owner of a unique skill.
|
||||
// If the skill is not unique, or if there is no skill with the given ID,
|
||||
// the result is Nothing.
|
||||
pub fun unique-owner(s: skill-id): maybe<trainee-id>
|
||||
match s.game-id
|
||||
{{- range $s := $.Skills }}
|
||||
{{- if $s.UniqueOwnerID }}
|
||||
{{ $s.ID }} -> Just(Trainee-id({{ $s.UniqueOwnerID }}))
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
_ -> Nothing
|
||||
|
||||
// Get the name of a skill.
|
||||
// Inherited skills have the same names as their original counterparts.
|
||||
pub fun skill/show(s: skill): string
|
||||
match s
|
||||
// Get the SP cost of a skill.
|
||||
// If there is no skill with the given ID, the result is 0.
|
||||
pub fun sp-cost(s: skill-id): int
|
||||
match s.game-id
|
||||
{{- range $s := $.Skills }}
|
||||
{{ kkenum $s.Name }}{{ if ne $s.InheritID 0 }}-Inherit{{ end }} -> {{ printf "%q" $s.Name }}
|
||||
{{ $s.ID }} -> {{ $s.SPCost }}
|
||||
{{- end }}
|
||||
_ -> 0
|
||||
|
||||
// Compare two skills by ID order.
|
||||
pub fip fun skill/order2(a: skill, b: skill): order2<skill>
|
||||
match cmp(a.skill-id, b.skill-id)
|
||||
Lt -> Lt2(a, b)
|
||||
Eq -> Eq2(a)
|
||||
Gt -> Gt2(a, b)
|
||||
// Get the icon ID of a skill.
|
||||
// If there is no skill with the given ID, the result is an invalid ID.
|
||||
pub fun icon-id(s: skill-id): skill-icon-id
|
||||
match s.game-id
|
||||
{{- range $s := $.Skills }}
|
||||
{{ $s.ID }} -> Skill-icon-id({{ $s.IconID }})
|
||||
{{- end }}
|
||||
_ -> Skill-icon-id(0)
|
||||
|
||||
pub fun skill/(==)(a: skill, b: skill): bool
|
||||
a.skill-id == b.skill-id
|
||||
|
||||
// Get the skills in a skill group.
|
||||
pub fun skill-group/skills(g: skill-group): list<skill>
|
||||
match g
|
||||
// Get the name for a skill group.
|
||||
// Skill group names are the name of the base skill in the group.
|
||||
// If there is no skill group with the given ID, the result is the numeric ID.
|
||||
pub fun skill-group/show(sg: skill-group-id): string
|
||||
match sg.game-id
|
||||
{{- range $g := $.Groups }}
|
||||
{{ kkenum $g.Name }} -> [ {{- range $s := index $.Related $g.ID }}{{ kkenum $s.Name }}{{ if ne $s.InheritID 0 }}-Inherit{{ end }}, {{ end }}]
|
||||
{{ $g.ID }} -> {{- printf "%q" $g.Name -}}
|
||||
{{- end }}
|
||||
x -> "skill group " ++ x.show
|
||||
|
||||
// Get complete skill info.
|
||||
pub fun skill/detail(^s: skill): skill-detail
|
||||
match s
|
||||
{{- range $s := $.Skills }}
|
||||
{{ kkenum $s.Name }}{{ if ne $s.InheritID 0 }}-Inherit{{ end }} -> {{ template "kk-render-skill-detail" $s }}
|
||||
// Get the list of skills in a skill group.
|
||||
pub fun skill-group/skills(sg: skill-group-id): list<skill-id>
|
||||
match sg.game-id
|
||||
{{- range $g := $.Groups }}
|
||||
{{ $g.ID }} -> [ {{- range $s := index $.Related $g.ID }}Skill-id({{ $s.ID }}), {{ end -}} ]
|
||||
{{- end }}
|
||||
_ -> Nil
|
||||
|
||||
// Details about a skill.
|
||||
pub struct skill-detail
|
||||
skill-id: int
|
||||
name: string
|
||||
description: string
|
||||
group: maybe<skill-group>
|
||||
rarity: rarity
|
||||
group-rate: int
|
||||
grade-value: int
|
||||
wit-check: bool
|
||||
activations: list<activation>
|
||||
sp-cost: int
|
||||
icon-id: int
|
||||
|
||||
// Automatically generated.
|
||||
// Shows a string representation of the `skill-detail` type.
|
||||
pub fun skill-detail/show(this : skill-detail) : e string
|
||||
match this
|
||||
Skill-detail(skill-id, name, description, group, rarity, group-rate, grade-value, wit-check, activations, sp-cost, icon-id) -> "Skill-detail(skill-id: " ++ skill-id.show ++ ", name: " ++ name.show ++ ", description: " ++ description.show ++ ", group: " ++ group.show ++ ", rarity: " ++ rarity.show ++ ", group-rate: " ++ group-rate.show ++ ", grade-value: " ++ grade-value.show ++ ", wit-check: " ++ wit-check.show ++ ", activations: " ++ activations.show ++ ", sp-cost: " ++ sp-cost.show ++ ", icon-id: " ++ icon-id.show ++ ")"
|
||||
|
||||
// Skill rarity.
|
||||
pub type rarity
|
||||
Common // white
|
||||
Rare // gold
|
||||
Unique-Low // 1*/2* unique
|
||||
Unique-Upgraded // 3*+ unique on a trainee upgraded from 1*/2*
|
||||
Unique // base 3* unique
|
||||
|
||||
pub fun rarity/show(r: rarity): string
|
||||
match r
|
||||
Common -> "Common"
|
||||
Rare -> "Rare"
|
||||
Unique-Low -> "Unique (1\u2606/2\u2606)"
|
||||
Unique-Upgraded -> "Unique (3\u2606+ from 1\u2606/2\u2606 upgraded)"
|
||||
Unique -> "Unique (3\u2606+)"
|
||||
|
||||
// Condition and precondition logic.
|
||||
pub alias condition = string
|
||||
|
||||
// Activation conditions and effects.
|
||||
// A skill has one or two activations.
|
||||
pub struct activation
|
||||
precondition: condition
|
||||
condition: condition
|
||||
duration: decimal // seconds
|
||||
cooldown: decimal // seconds
|
||||
abilities: list<ability> // one to three elements
|
||||
|
||||
pub fun activation/show(a: activation): string
|
||||
match a
|
||||
Activation("", condition, duration, _, abilities) | duration <= 0.decimal -> condition ++ " -> " ++ abilities.show
|
||||
Activation("", condition, duration, cooldown, abilities) | cooldown >= 500.decimal -> condition ++ " -> " ++ abilities.show ++ " for " ++ duration.show ++ "s"
|
||||
Activation("", condition, duration, cooldown, abilities) -> condition ++ " -> " ++ abilities.show ++ " for " ++ duration.show ++ "s on " ++ cooldown.show ++ "s cooldown"
|
||||
Activation(precondition, condition, duration, _, abilities) | duration <= 0.decimal -> precondition ++ " -> " ++ condition ++ " -> " ++ abilities.show
|
||||
Activation(precondition, condition, duration, cooldown, abilities) | cooldown >= 500.decimal -> precondition ++ " -> " ++ condition ++ " -> " ++ abilities.show ++ " for " ++ duration.show ++ "s"
|
||||
Activation(precondition, condition, duration, cooldown, abilities) -> precondition ++ "-> " ++ condition ++ " -> " ++ abilities.show ++ " for " ++ duration.show ++ "s on " ++ cooldown.show ++ "s cooldown"
|
||||
|
||||
// Effects of activating a skill.
|
||||
pub struct ability
|
||||
ability-type: ability-type
|
||||
value-usage: value-usage
|
||||
target: target
|
||||
|
||||
pub fun ability/show(a: ability): string
|
||||
match a
|
||||
Ability(t, Direct, Self) -> t.show
|
||||
Ability(t, Direct, target) -> t.show ++ " " ++ target.show
|
||||
Ability(t, v, Self) -> t.show ++ " scaling by " ++ v.show
|
||||
Ability(t, v, target) -> t.show ++ " " ++ target.show ++ " scaling by " ++ v.show
|
||||
|
||||
// Target of a skill activation effect.
|
||||
pub type ability-type
|
||||
Passive-Speed(bonus: decimal)
|
||||
Passive-Stamina(bonus: decimal)
|
||||
Passive-Power(bonus: decimal)
|
||||
Passive-Guts(bonus: decimal)
|
||||
Passive-Wit(bonus: decimal)
|
||||
Great-Escape
|
||||
Vision(bonus: decimal)
|
||||
HP(rate: decimal)
|
||||
Gate-Delay(rate: decimal)
|
||||
Frenzy(add: decimal)
|
||||
Current-Speed(rate: decimal)
|
||||
Target-Speed(rate: decimal)
|
||||
Lane-Speed(rate: decimal)
|
||||
Accel(rate: decimal)
|
||||
Lane-Change(rate: decimal)
|
||||
|
||||
pub fun ability-type/show(a: ability-type): string
|
||||
match a
|
||||
Passive-Speed(bonus) -> "passive " ++ bonus.show ++ " Speed"
|
||||
Passive-Stamina(bonus) -> "passive " ++ bonus.show ++ " Stamina"
|
||||
Passive-Power(bonus) -> "passive " ++ bonus.show ++ " Power"
|
||||
Passive-Guts(bonus) -> "passive " ++ bonus.show ++ " Guts"
|
||||
Passive-Wit(bonus) -> "passive " ++ bonus.show ++ " Wit"
|
||||
Great-Escape -> "enable Great Escape style"
|
||||
Vision(bonus) -> bonus.show ++ " vision"
|
||||
HP(rate) | rate >= 0.decimal -> show(rate * 100.decimal) ++ "% HP recovery"
|
||||
HP(rate) -> show(rate * 100.decimal) ++ "% HP loss"
|
||||
Gate-Delay(rate) -> rate.show ++ "× gate delay"
|
||||
Frenzy(add) -> add.show ++ "s longer Rushed"
|
||||
Current-Speed(rate) -> show(rate * 100.decimal) ++ "% current speed"
|
||||
Target-Speed(rate) -> show(rate * 100.decimal) ++ "% target speed"
|
||||
Lane-Speed(rate) -> show(rate * 100.decimal) ++ "% lane speed"
|
||||
Accel(rate) -> show(rate * 100.decimal) ++ "% acceleration"
|
||||
Lane-Change(rate) -> rate.show ++ " course width movement"
|
||||
|
||||
// Special scaling for skill activation effects.
|
||||
pub type value-usage
|
||||
Direct
|
||||
Team-Speed
|
||||
Team-Stamina
|
||||
Team-Power
|
||||
Team-Guts
|
||||
Team-Wit
|
||||
Multiply-Random
|
||||
|
||||
pub fun value-usage/show(v: value-usage): string
|
||||
match v
|
||||
Direct -> "no scaling"
|
||||
Team-Speed -> "team's Speed"
|
||||
Team-Stamina -> "team's Stamina"
|
||||
Team-Power -> "team's Power"
|
||||
Team-Guts -> "team's Guts"
|
||||
Team-Wit -> "team's Wit"
|
||||
Multiply-Random -> "random multiplier (0×, 0.02×, or 0.04×)"
|
||||
|
||||
// Who a skill activation targets.
|
||||
pub type target
|
||||
Self
|
||||
In-View
|
||||
Ahead(limit: int)
|
||||
Behind(limit: int)
|
||||
Style(style: style)
|
||||
Rushing-Ahead(limit: int)
|
||||
Rushing-Behind(limit: int)
|
||||
Rushing-Style(style: style)
|
||||
|
||||
pub fun target/show(t: target): string
|
||||
match t
|
||||
Self -> "self"
|
||||
In-View -> "others in field of view"
|
||||
Ahead(limit) | limit >= 18 -> "others ahead"
|
||||
Ahead(limit) -> "next " ++ limit.show ++ " others ahead"
|
||||
Behind(limit) | limit >= 18 -> "others behind"
|
||||
Behind(limit) -> "next " ++ limit.show ++ " others behind"
|
||||
Style(Front-Runner) -> "other Front Runners"
|
||||
Style(Pace-Chaser) -> "other Pace Chasers"
|
||||
Style(Late-Surger) -> "other Late Surgers"
|
||||
Style(End-Closer) -> "other End Closers"
|
||||
Rushing-Ahead(limit) | limit >= 18 -> "others rushing ahead"
|
||||
Rushing-Ahead(limit) -> "next " ++ limit.show ++ " others rushing ahead"
|
||||
Rushing-Behind(limit) | limit >= 18 -> "others rushing behind"
|
||||
Rushing-Behind(limit) -> "next " ++ limit.show ++ " others rushing behind"
|
||||
Rushing-Style(Front-Runner) -> "rushing Front Runners"
|
||||
Rushing-Style(Pace-Chaser) -> "rushing Pace Chasers"
|
||||
Rushing-Style(Late-Surger) -> "rushing Late Surgers"
|
||||
Rushing-Style(End-Closer) -> "rushing End Closers"
|
||||
|
||||
// Running style for skill targets.
|
||||
{{- /* TODO(zeph): there is definitely a better place for this to live */}}
|
||||
pub type style
|
||||
Front-Runner
|
||||
Pace-Chaser
|
||||
Late-Surger
|
||||
End-Closer
|
||||
|
||||
{{- end -}}
|
||||
|
||||
{{ define "kk-render-skill-detail" }}
|
||||
{{- /* Call with Skill structure as argument. */ -}}
|
||||
Skill-detail(skill-id = {{ $.ID -}}
|
||||
, name = {{ printf "%q" $.Name -}}
|
||||
, description = {{ printf "%q" $.Description -}}
|
||||
, group = {{ if ne $.GroupName "" }}Just({{ kkenum $.GroupName }}){{ else }}Nothing{{ end -}}
|
||||
, rarity = {{ if eq $.Rarity 1 }}Common{{ else if eq $.Rarity 2 }}Rare{{ else if eq $.Rarity 3 }}Unique-Low{{ else if eq $.Rarity 4 }}Unique-Upgraded{{ else if eq $.Rarity 5 }}Unique{{ else }}??? $.Rarity={{ $.Rarity }}{{ end -}}
|
||||
, group-rate = {{ $.GroupRate -}}
|
||||
, grade-value = {{ $.GradeValue -}}
|
||||
, wit-check = {{ if $.WitCheck }}True{{ else }}False{{ end -}}
|
||||
, activations = [
|
||||
{{- range $a := $.Activations -}}
|
||||
{{- if ne $a.Condition "" -}}
|
||||
Activation(precondition = {{ printf "%q" $a.Precondition -}}
|
||||
, condition = {{ printf "%q" $a.Condition -}}
|
||||
, duration = {{ $a.Duration -}}{{ if gt $a.Duration 0 }}.decimal(-4){{ else }}.decimal{{ end -}}
|
||||
, cooldown = {{ $a.Cooldown -}}{{ if gt $a.Cooldown 0 }}.decimal(-4){{ else }}.decimal{{ end -}}
|
||||
, abilities = [
|
||||
{{- range $abil := $a.Abilities -}}
|
||||
{{- if ne $abil.Type 0 -}}
|
||||
Ability(ability-type =
|
||||
{{- if eq $abil.Type 1 -}}Passive-Speed({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 2 -}}Passive-Stamina({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 3 -}}Passive-Power({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 4 -}}Passive-Guts({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 5 -}}Passive-Wit({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 6 -}}Great-Escape
|
||||
{{- else if eq $abil.Type 8 -}}Vision({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 9 -}}HP({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 10 -}}Gate-Delay({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 13 -}}Frenzy({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 21 -}}Current-Speed({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 27 -}}Target-Speed({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 28 -}}Lane-Speed({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 31 -}}Accel({{ $abil.Value }}.decimal(-4))
|
||||
{{- else if eq $abil.Type 35 -}}Lane-Change({{ $abil.Value }}.decimal(-4))
|
||||
{{- else -}}??? $abil.Type={{$abil.Type}}
|
||||
{{- end -}}
|
||||
, value-usage =
|
||||
{{- if eq $abil.ValueUsage 1 -}}Direct
|
||||
{{- else if eq $abil.ValueUsage 3 -}}Team-Speed
|
||||
{{- else if eq $abil.ValueUsage 4 -}}Team-Stamina
|
||||
{{- else if eq $abil.ValueUsage 5 -}}Team-Power
|
||||
{{- else if eq $abil.ValueUsage 6 -}}Team-Guts
|
||||
{{- else if eq $abil.ValueUsage 7 -}}Team-Wit
|
||||
{{- else if eq $abil.ValueUsage 8 -}}Multiply-Random
|
||||
{{- else -}}??? $abil.ValueUsage={{ $abil.ValueUsage }}
|
||||
{{- end -}}
|
||||
, target =
|
||||
{{- if eq $abil.Target 1 -}}Self
|
||||
{{- else if eq $abil.Target 4 -}}In-View
|
||||
{{- else if eq $abil.Target 9 -}}Ahead({{ $abil.TargetValue }})
|
||||
{{- else if eq $abil.Target 10 -}}Behind({{ $abil.TargetValue }})
|
||||
{{- else if eq $abil.Target 18 -}}Style({{ if eq $abil.TargetValue 1 }}Front-Runner{{ else if eq $abil.TargetValue 2 }}Pace-Chaser{{ else if eq $abil.TargetValue 3 }}Late-Surger{{ else if eq $abil.TargetValue 4 }}End-Closer{{ else }}??? $abil.TargetValue={{ $abil.TargetValue }}{{ end }})
|
||||
{{- else if eq $abil.Target 19 -}}Rushing-Ahead({{ $abil.TargetValue }})
|
||||
{{- else if eq $abil.Target 20 -}}Rushing-Behind({{ $abil.TargetValue }})
|
||||
{{- else if eq $abil.Target 21 -}}Rushing-Style({{ if eq $abil.TargetValue 1 }}Front-Runner{{ else if eq $abil.TargetValue 2 }}Pace-Chaser{{ else if eq $abil.TargetValue 3 }}Late-Surger{{ else if eq $abil.TargetValue 4 }}End-Closer{{ else }}??? $abil.TargetValue={{ $abil.TargetValue }}{{ end }})
|
||||
{{- end -}}
|
||||
),
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
]),
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
], sp-cost = {{ $.SPCost -}}
|
||||
, icon-id = {{ $.IconID -}}
|
||||
)
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
Reference in New Issue
Block a user