weaponDamage(attacker: string, rpm: number, victim: string?) → number
Damage a hit from the attacker's PRIMARY weapon deals (bots.design derive `primaryWeapon`, via M.stats): its damage scaled by (rpm/maxRpm)^2 for spinners (0 below HIT_MIN_RPM_FRACTION), whole for a fired cycle weapon (rpm = charge x 8000), times the victim's area-weighted `armorScale` when `victim` is given. (In a fight bots.botcore resolves each weapon against the part it strikes; this is the summary number.)
| arg | type | description |
|---|
| attacker | string | "HAVOC" or "RIPTIDE" (corner slot). |
| rpm | number | The weapon's current RPM (a cycle weapon: charge x 8000). |
| victim | string? | Optional corner slot of the victim, for its armour scale. |
weaponKnockback(attacker: string, rpm: number) → number
Knockback speed (m/s) a hit from the attacker's primary weapon gives the victim (a spinner's attacker recoils at half of it).
| arg | type | description |
|---|
| attacker | string | "HAVOC" or "RIPTIDE" (corner slot). |
| rpm | number | The weapon's current RPM. |
hazardAt(x: number, z: number) → Hazard
Which hazard footprint (if any) contains the floor point (x, z).
| arg | type | description |
|---|
| x | number | World X. |
| z | number | World Z. |
freshBot(name: string) → void
| arg | type | description |
|---|
| name | string | |
state( ) → any
The live match table: phase, clock, countdown, winner, reason, round, camKick, shot, and bots[name] = { entityId, health, damageDealt, rpm, weaponFraction, immobileSeconds, flipped, stuck, destroyed }.
bot(name: string) → any
One bot's live record.
| arg | type | description |
|---|
| name | string | "HAVOC" or "RIPTIDE". |
opponent(name: string) → string
The other bot's name.
| arg | type | description |
|---|
| name | string | "HAVOC" or "RIPTIDE". |
isLive( ) → boolean
True while bots may drive and fight: phase "fight", or "free" when no MatchDirector runs.
on(event: string, fn: (any, string) → void
Subscribe to a rules event; returns a function that unsubscribes.
| arg | type | description |
|---|
| event | string | Event name, or "*" for every event (handler gets (payload, name)). |
| fn | (any, string | Handler. |
emit(event: string, payload: any) → void
Fire a rules event to every subscriber (errors in one handler are logged, not raised).
| arg | type | description |
|---|
| event | string | Event name. |
| payload | any | Event data. |
setDesign(slot: string, design: any) → void
Put a design in a corner ("HAVOC" = player, "RIPTIDE" = AI) and fire "design" { slot }. The design is normalized; its derived stats are cached.
| arg | type | description |
|---|
| slot | string | |
| design | any | |
design(slot: string) → any
The design standing in a corner (the preset of the slot's own name until one is set).
| arg | type | description |
|---|
| slot | string | |
stats(slot: string) → any
bots.design derive() of the design in a corner (cached).
| arg | type | description |
|---|
| slot | string | |
displayName(slot: string) → string
The name to show for a corner: its design's name ("HAVOC", "MAULER", a player's own build...).
| arg | type | description |
|---|
| slot | string | |
registerBot(name: string, entityId: string) → void
| arg | type | description |
|---|
| name | string | |
| entityId | string | |
setPhase(phase: string) → void
Change the match phase and fire "phase".
| arg | type | description |
|---|
| phase | string | "free" | "title" | "countdown" | "fight" | "ko" | "decision". |
applyDamage(victim: string, amount: number, cause: string, attacker: string?) → number
Take hit points off a bot, credit the damage to its opponent's judges' score, and fire "damage" (and "destroyed" at 0). Ignored while not live.
| arg | type | description |
|---|
| victim | string | "HAVOC" or "RIPTIDE". |
| amount | number | Hit points. |
| cause | string | "disc" | "bar" | a hazard kind | "other". |
| attacker | string? | Who gets the credit; defaults to the victim's opponent. |
decide( ) → string
Judges' decision: more total damage dealt wins; a tie goes to more health left; a dead tie goes to RIPTIDE (the player must beat it).
reset( ) → void
Reset health, scores, clock and counts for a new match (keeps phase and registered bots) and fire "reset".
kickCamera(strength: number) → void
Shake and push the chase camera in; strength 0..1 (a full-RPM disc hit is ~1). Decays over ~0.4 s.
| arg | type | description |
|---|
| strength | number | 0..1. |
setShot(shot: string, focus: string?) → void
Pick the camera shot: "chase" (behind HAVOC), "faceoff" (low front view of both bots, for the title), "orbit" (slow orbit of `focus`, for KO / decision).
| arg | type | description |
|---|
| shot | string | "chase" | "faceoff" | "orbit". |
| focus | string? | Bot name or entity id to orbit (orbit only). |
formatClock(seconds: number) → string
Format seconds as M:SS for the match clock.
| arg | type | description |
|---|
| seconds | number | Seconds remaining. |