ensure( ) → void
Define the class weapons in weaponsKit (safe to call many times, on every peer).
weaponFor(cls: any) → string
The weaponsKit weapon a class holds (`classes.weapon` overrides it), or the warrior's.
equip(body: any, cls: any, look: string?) → void
Put the class weapon in the hero's hand, aimed and fired by arpgKit (no first-person view, crosshair or ammo panel). `look` is a weaponsKit look family.
| arg | type | description |
|---|
| body | any | |
| cls | any | |
| look | string? | |
power(id: string, base: number, share: number?) → void
The damage multiplier a hit from `id` carries: gear and level damage over
the weapon's base (abilitiesKit damage multiplier, weapon and elemental
damage, a crit roll), times the move's own share.
| arg | type | description |
|---|
| id | string | |
| base | number | |
| share | number? | |
attackSpeed(id: string) → number
| arg | type | description |
|---|
| id | string | |
aimPoint(body: any, aim: any) → vector
| arg | type | description |
|---|
| body | any | |
| aim | any | |
fire(body: any, aim: any, share: number?, step: number?) → boolean
Fire the hero's weapon once at the aim ({ point?, dir? }) with gear applied. `share` scales the hit (a skill's power), `step` picks a melee swing. Returns false when the hero holds no weapon.
| arg | type | description |
|---|
| body | any | |
| aim | any | |
| share | number? | |
| step | number? | |
press(body: any, button: string, aim: any?) → void
Press a fight button for the warrior ("LP" light, "HP" heavy, "MP" whirlwind), or force a move by id ("leap"). `aim` is where the swings go.
| arg | type | description |
|---|
| body | any | |
| button | string | |
| aim | any? | |
hold(body: any, button: string, on: boolean) → void
Hold or let go of a fight button (a held Heavy charges into the Charged Heavy).
| arg | type | description |
|---|
| body | any | |
| button | string | |
| on | boolean | |
move(body: any) → void
The warrior's current move ("light2", "spin", ...) and phase, or nil.
| arg | type | description |
|---|
| body | any | |
combo(body: any) → number
The warrior's combo counter (hits in the current string).
| arg | type | description |
|---|
| body | any | |
moveShare(fight: any, moveId: string) → number
the move's share of the hit: comboKit's damage for it over the light jab's
| arg | type | description |
|---|
| fight | any | |
| moveId | string | |
runFight(body: any, b: any, dt: number) → void
| arg | type | description |
|---|
| body | any | |
| b | any | |
| dt | number | |
busy(body: any) → boolean
Whether the warrior is in the middle of a move (the hero stands still for it).
| arg | type | description |
|---|
| body | any | |
update(body: any, dt: number) → void
Call once a frame for the local hero: runs the warrior's fight clock and the gear stats that tick (health regen, max mana).
| arg | type | description |
|---|
| body | any | |
| dt | number | |
attach(body: any) → void
Start the hit rules for this peer's hero `body`: life on hit and life steal heal it when it lands a hit; resistances cut elemental hits on it; thorns hurt back what hits it. Safe to call again.
| arg | type | description |
|---|
| body | any | |
detach( ) → void
Stop this peer's hit rules (when the hero leaves).