horsegen: skill activation duration scaling
This commit is contained in:
38
horse/durscale_string.go
Normal file
38
horse/durscale_string.go
Normal file
@@ -0,0 +1,38 @@
|
||||
// Code generated by "stringer -type DurScale -trimprefix Duration -linecomment"; DO NOT EDIT.
|
||||
|
||||
package horse
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[DurationDirect-1]
|
||||
_ = x[DurationFrontDistance-2]
|
||||
_ = x[DurationRemainingHP-3]
|
||||
_ = x[DurationIncrementPass-4]
|
||||
_ = x[DurationMidSideBlock-5]
|
||||
_ = x[DurationRemainingHP2-7]
|
||||
}
|
||||
|
||||
const (
|
||||
_DurScale_name_0 = "directlyscaling with distance from the frontscaling with remaining HPincreasing with each pass while activescaling with mid-race phase blocked side time"
|
||||
_DurScale_name_1 = "scaling with remaining HP"
|
||||
)
|
||||
|
||||
var (
|
||||
_DurScale_index_0 = [...]uint8{0, 8, 44, 69, 107, 152}
|
||||
)
|
||||
|
||||
func (i DurScale) String() string {
|
||||
switch {
|
||||
case 1 <= i && i <= 5:
|
||||
i -= 1
|
||||
return _DurScale_name_0[_DurScale_index_0[i]:_DurScale_index_0[i+1]]
|
||||
case i == 7:
|
||||
return _DurScale_name_1
|
||||
default:
|
||||
return "DurScale(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -46,6 +46,7 @@ type Activation struct {
|
||||
Precondition string
|
||||
Condition string
|
||||
Duration TenThousandths
|
||||
DurScale DurScale
|
||||
Cooldown TenThousandths
|
||||
Abilities []Ability
|
||||
}
|
||||
@@ -126,6 +127,18 @@ func (a Ability) String() string {
|
||||
return string(r)
|
||||
}
|
||||
|
||||
type DurScale int8
|
||||
|
||||
//go:generate go run golang.org/x/tools/cmd/stringer@v0.41.0 -type DurScale -trimprefix Duration -linecomment
|
||||
const (
|
||||
DurationDirect DurScale = 1 // directly
|
||||
DurationFrontDistance DurScale = 2 // scaling with distance from the front
|
||||
DurationRemainingHP DurScale = 3 // scaling with remaining HP
|
||||
DurationIncrementPass DurScale = 4 // increasing with each pass while active
|
||||
DurationMidSideBlock DurScale = 5 // scaling with mid-race phase blocked side time
|
||||
DurationRemainingHP2 DurScale = 7 // scaling with remaining HP
|
||||
)
|
||||
|
||||
type AbilityType int8
|
||||
|
||||
//go:generate go run golang.org/x/tools/cmd/stringer@v0.41.0 -type AbilityType -trimprefix Ability -linecomment
|
||||
|
||||
@@ -85,17 +85,40 @@ pub struct activation
|
||||
precondition: condition
|
||||
condition: condition
|
||||
duration: decimal // seconds
|
||||
dur-scale: dur-scale
|
||||
cooldown: decimal // seconds
|
||||
abilities: list<ability> // one to three elements
|
||||
|
||||
pub fun activation/show(a: activation, ?character/show: (character-id) -> string): string
|
||||
match a
|
||||
Activation("", condition, duration, _, abilities) | !duration.is-pos -> condition ++ " -> " ++ abilities.show
|
||||
Activation("", condition, duration, cooldown, abilities) | cooldown >= 500.decimal -> condition ++ " -> for " ++ duration.show ++ "s, " ++ abilities.show
|
||||
Activation("", condition, duration, cooldown, abilities) -> condition ++ " -> for " ++ duration.show ++ "s on " ++ cooldown.show ++ "s cooldown, " ++ abilities.show
|
||||
Activation(precondition, condition, duration, _, abilities) | !duration.is-pos -> precondition ++ " -> " ++ condition ++ " -> " ++ abilities.show
|
||||
Activation(precondition, condition, duration, cooldown, abilities) | cooldown >= 500.decimal -> precondition ++ " -> " ++ condition ++ " -> for " ++ duration.show ++ "s, " ++ abilities.show
|
||||
Activation(precondition, condition, duration, cooldown, abilities) -> precondition ++ " -> " ++ condition ++ " -> for " ++ duration.show ++ "s on " ++ cooldown.show ++ "s cooldown, " ++ abilities.show
|
||||
Activation("", condition, duration, _, _, abilities) | !duration.is-pos -> condition ++ " -> " ++ abilities.show
|
||||
Activation("", condition, duration, Direct-Dur, cooldown, abilities) | cooldown >= 500.decimal -> condition ++ " -> for " ++ duration.show ++ "s, " ++ abilities.show
|
||||
Activation("", condition, duration, dur-scale, cooldown, abilities) | cooldown >= 500.decimal -> condition ++ " -> for " ++ duration.show ++ "s " ++ dur-scale.show ++ ", " ++ abilities.show
|
||||
Activation("", condition, duration, Direct-Dur, cooldown, abilities) -> condition ++ " -> for " ++ duration.show ++ "s on " ++ cooldown.show ++ "s cooldown, " ++ abilities.show
|
||||
Activation("", condition, duration, dur-scale, cooldown, abilities) -> condition ++ " -> for " ++ duration.show ++ "s " ++ dur-scale.show ++ " on " ++ cooldown.show ++ "s cooldown, " ++ abilities.show
|
||||
Activation(precondition, condition, duration, _, _, abilities) | !duration.is-pos -> precondition ++ " -> " ++ condition ++ " -> " ++ abilities.show
|
||||
Activation(precondition, condition, duration, Direct-Dur, cooldown, abilities) | cooldown >= 500.decimal -> precondition ++ " -> " ++ condition ++ " -> for " ++ duration.show ++ "s, " ++ abilities.show
|
||||
Activation(precondition, condition, duration, dur-scale, cooldown, abilities) | cooldown >= 500.decimal -> precondition ++ " -> " ++ condition ++ " -> for " ++ duration.show ++ "s " ++ dur-scale.show ++ ", " ++ abilities.show
|
||||
Activation(precondition, condition, duration, Direct-Dur, cooldown, abilities) -> precondition ++ " -> " ++ condition ++ " -> for " ++ duration.show ++ "s on " ++ cooldown.show ++ "s cooldown, " ++ abilities.show
|
||||
Activation(precondition, condition, duration, dur-scale, cooldown, abilities) -> precondition ++ " -> " ++ condition ++ " -> for " ++ duration.show ++ "s " ++ dur-scale.show ++ " on " ++ cooldown.show ++ "s cooldown, " ++ abilities.show
|
||||
|
||||
// Special scaling types for skill activation durations.
|
||||
pub type dur-scale
|
||||
Direct-Dur
|
||||
Front-Distance-Dur
|
||||
Multiply-Remaining-HP
|
||||
Increment-Pass
|
||||
Midrace-Side-Block-Time-Dur
|
||||
Multiply-Remaining-HP2
|
||||
|
||||
pub fun dur-scale/show(s: dur-scale): string
|
||||
match s
|
||||
Direct-Dur -> "with no scaling"
|
||||
Front-Distance-Dur -> "scaling with distance from the front"
|
||||
Multiply-Remaining-HP -> "scaling with remaining HP"
|
||||
Increment-Pass -> "increasing with each pass while active"
|
||||
Midrace-Side-Block-Time-Dur -> "scaling with mid-race phase blocked side time"
|
||||
Multiply-Remaining-HP2 -> "scaling with remaining HP"
|
||||
|
||||
// Effects of activating a skill.
|
||||
pub struct ability
|
||||
|
||||
Reference in New Issue
Block a user