box(from: number, to: number, x: number, y: number, w: number, h: number) → void
| arg | type | description |
|---|
| from | number | |
| to | number | |
| x | number | |
| y | number | |
| w | number | |
| h | number | |
mv(id: string, name: string, input: string, s: number, a: number, r: number, dmg: number, extra: any?) → any
A move with its advantage worked out from its frames, so the comboKit
checker always agrees with it.
| arg | type | description |
|---|
| id | string | |
| name | string | |
| input | string | |
| s | number | |
| a | number | |
| r | number | |
| dmg | number | |
| extra | any? | |
moveSet(id: string, label: string, f: any) → any
The comboKit move set of a style from its frame table.
| arg | type | description |
|---|
| id | string | |
| label | string | |
| f | any | |
chain(into: { string }, from: number, to: number) → void
| arg | type | description |
|---|
| into | { string } | |
| from | number | |
| to | number | |
ensure(id: string) → void
Register a style's comboKit move set and weaponsKit weapon on this peer (safe to call often).
| arg | type | description |
|---|
| id | string | |
telegraphFor(id: string) → any
How an enemy fighting in style `id` should warn before it hits: Telegraphed settings { windup, rangedWindup, heavyEvery, staggerTime, warning, reachGrace? }. A style without its own `telegraph` gets one worked out from its frames (slower heavies wind up longer).
| arg | type | description |
|---|
| id | string | |
timeToHit(id: string, moveId: string) → number
Seconds from the press to the hit of move `moveId` in style `id` (startup frames at 60 fps).
| arg | type | description |
|---|
| id | string | |
| moveId | string | |
cost(id: string, moveId: string) → number
Stamina a move costs in style `id`: the heavy cost for heavy, finisher and counter, the attack cost otherwise.
| arg | type | description |
|---|
| id | string | |
| moveId | string | |
parryOpen(st: any, sinceGuard: number, window: number?) → boolean
Is a guard raised `sinceGuard` seconds ago still inside the parry window? `window` overrides the style's own (a stat hook's).
| arg | type | description |
|---|
| st | any | |
| sinceGuard | number | |
| window | number? | |
blockCost(st: any, amount: number) → number
Stamina a blocked hit of `amount` costs: the style's block cost, scaled by the hit (0.6x to 2.5x of a 15-damage hit) and divided by its poise.
| arg | type | description |
|---|
| st | any | |
| amount | number | |
strikeOutcome(st: any, ctx: any) → void
What a strike does to a fighter of this style: "dodge" (inside invulnerable frames), "parry" (guard raised inside the parry window), "guard" (blocked, soak = what still goes through), "guardBreak" (the block emptied stamina) or "hit". `ctx = { iframes, guarding, sinceGuard, unparryable, stamina, amount, parryWindow? }`.
| arg | type | description |
|---|
| st | any | |
| ctx | any | |
canSpend(stamina: number, cost: number) → boolean
Whether a fighter with `stamina` may start an action costing `cost` (it needs at least 35% of the cost; the bar may then run dry).
| arg | type | description |
|---|
| stamina | number | |
| cost | number | |
get(id: string) → any
One style's full definition (nil when unknown).
| arg | type | description |
|---|
| id | string | |
list( ) → void
Every style, in order: { id, label, description, tags, color, dodge kind, parry window }.
define(id: string, spec: any) → any
Add or replace a style. `spec` has the same shape as the built-ins: id, label, description, tags, color, frames, weapon, anims, guard, dodge, stamina, and optional ranged, power, lightCharge, charge, pull and telegraph.
| arg | type | description |
|---|
| id | string | |
| spec | any | |