Battle
One-paragraph description of what this component does and what it attaches to. Mention any required sibling components (e.g. Model, Transform).
Battle
One-paragraph description of what this component does and what it attaches to. Mention any required sibling components (e.g. Model, Transform).
Public fields
exampleNumber: number— what it controls, units, valid range.exampleString: string— what it controls.exampleBool: boolean— what it controls.
Methods
:methodName(arg)— what it does and when to call it.
Lifecycle
awake()— same-frame attach hook. What initial state this component sets up.start()— first-frame-after-awake hook. Cross-component setup that needs the other components on the entity to have finishedawake.update(dt)— per-frame while the gameplay clock runs. What this component does each tick.onDestroy()— cleanup performed on detach / entity despawn.
See man components for the full hook list (onEnable, fixedUpdate,
onPropertyChanged, etc.) and the timing details.
Usage
entity(id).component.add("Battle", { exampleNumber = 1.0 })
entity(id).component.get("Battle"):methodName("foo")
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2game.battle.Battle — the Persona-style turn battle of IN THE WIRE. Lives on Anchors/Battle. Provides the "battle" service (design/spec.md): battle.start(spec) returns at once; emits Wire "battleEnded" { won, spec, ... } spec = { enemies = { "postman" }, party = { "scribble" } | { "scribble", "teddy" }, scripted = "awakening" | nil, canFlee = false, integrity = number? (starting Integrity override, for tests / story beats) } battle.isRunning() battle.state() (a snapshot for tools) battle.forfeit() While a battle runs it owns the camera (its BattleCamera wins the viewport), holds Wire.lock("battle"), activates game.battle.battle_menu (which stands the walking controls down), and draws the screens "battle_hud" and "battle_fx". Everything it shows is built at runtime under its own entity at the arena (Wire.layout.arena, z = -400): a wireframe street fading to black, the graphite hero, the Echo SCRIBBLE, Teddy, the enemies, and the FX lines. Rules: turn order by speed; ATTACK / DRAW (Echo skills cost Ink) / GUARD / ITEM / ESCAPE; elements + affinities (Wire.damage); a WEAK hit or a crit knocks the enemy Down and grants an OVERDRAW extra action; every enemy Down -> ERASE ALL; Fill stacks, 3 = Textured (the member loses control 2 turns). scripted = "awakening": flail only, Fill climbs, then the Awakening cut-in summons SCRIBBLE and unlocks DRAW (Slash = Cut, Erase Light = Lumen).
add(a: ?, b: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| b | ? |
sub(a: ?, b: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| b | ? |
mul(a: ?, s: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| s | ? |
dot(a: ?, b: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| b | ? |
cross(a: ?, b: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| b | ? |
norm(a: ?) → void
| arg | type | description |
|---|---|---|
| a | ? |
lerp(a: ?, b: ?, t: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| b | ? | |
| t | ? |
lerp3(a: ?, b: ?, t: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| b | ? | |
| t | ? |
qyaw(t: ?) → void
| arg | type | description |
|---|---|---|
| t | ? |
qx(t: ?) → void
| arg | type | description |
|---|---|---|
| t | ? |
qmul(a: ?, b: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| b | ? |
nextId(prefix: string) → string
| arg | type | description |
|---|---|---|
| prefix | string |
svc(name: string) → any
| arg | type | description |
|---|---|---|
| name | string |
sfx(name: string) → void
| arg | type | description |
|---|---|---|
| name | string |
music(track: string) → void
| arg | type | description |
|---|---|---|
| track | string |
alive(e: any) → boolean
| arg | type | description |
|---|---|---|
| e | any |
newMesh(segs: ?, thick: ?) → void
| arg | type | description |
|---|---|---|
| segs | ? | |
| thick | ? |
lineEnt(name: string, parent: any, mat: any, pos: any) → void
| arg | type | description |
|---|---|---|
| name | string | |
| parent | any | |
| mat | any | |
| pos | any |
setDynamic(slot: ?, segs: ?, thick: ?) → void
a mesh rebuilt every time (dynamic): the previous dynamic handle is freed
| arg | type | description |
|---|---|---|
| slot | ? | |
| segs | ? | |
| thick | ? |
setCached(slot: ?, key: string, build: ?, thick: ?) → void
a mesh kept in the cache by key (line boil cycles through a few)
| arg | type | description |
|---|---|---|
| slot | ? | |
| key | string | |
| build | ? | |
| thick | ? |
loadMats( ) → void
Materials
light(parent: ?, name: ?, pos: ?, col: ?, intensity: ?, radius: ?) → void
Visuals: built once per play session, hidden between battles
| arg | type | description |
|---|---|---|
| parent | ? | |
| name | ? | |
| pos | ? | |
| col | ? | |
| intensity | ? | |
| radius | ? |
buildVisuals( ) → void
ensureVisuals( ) → void
smearStandin(parent: ?) → void
Enemies on the field
| arg | type | description |
|---|---|---|
| parent | ? |
spawnEnemyModel(key: string, pos: ?) → void
| arg | type | description |
|---|---|---|
| key | string | |
| pos | ? |
refresh( ) → void
UI plumbing
screenSize( ) → void
project(p: ?) → void
| arg | type | description |
|---|---|---|
| p | ? |
popup(world: ?, text: string, kind: string, size: number?, life: number?) → void
| arg | type | description |
|---|---|---|
| world | ? | |
| text | string | |
| kind | string | |
| size | number? | |
| life | number? |
callout(text: string, opts: any?) → void
| arg | type | description |
|---|---|---|
| text | string | |
| opts | any? |
flash(color: string, peak: number, life: number) → void
| arg | type | description |
|---|---|---|
| color | string | |
| peak | number | |
| life | number |
setShot(name: string, rate: number?) → void
| arg | type | description |
|---|---|---|
| name | string | |
| rate | number? |
punch(amount: number) → void
| arg | type | description |
|---|---|---|
| amount | number |
shake(amount: number) → void
| arg | type | description |
|---|---|---|
| amount | number |
wait(sec: number) → void
Timing helpers (run inside the battle task)
| arg | type | description |
|---|---|---|
| sec | number |
say(msg: string, sec: number?) → void
| arg | type | description |
|---|---|---|
| msg | string | |
| sec | number? |
hideMenus( ) → void
setHeroPose(pose: string, opts: any?) → void
| arg | type | description |
|---|---|---|
| pose | string | |
| opts | any? |
anim(c: ?, kind: string, dur: number, dir: any?, dist: number?) → void
| arg | type | description |
|---|---|---|
| c | ? | |
| kind | string | |
| dur | number | |
| dir | any? | |
| dist | number? |
chest(c: ?) → void
| arg | type | description |
|---|---|---|
| c | ? |
showFx(slot: ?, segs: ?, pos: ?, scale: number, life: number, thick: number?) → void
| arg | type | description |
|---|---|---|
| slot | ? | |
| segs | ? | |
| pos | ? | |
| scale | number | |
| life | number | |
| thick | number? |
pushInput(kind: string, index: number?, tag: string?) → void
Input
| arg | type | description |
|---|---|---|
| kind | string | |
| index | number? | |
| tag | string? |
activateControls( ) → void
releaseControls( ) → void
choose(menu: ?, timeout: number?) → void
Open a menu and wait for a choice. Returns the item, or nil on cancel.
| arg | type | description |
|---|---|---|
| menu | ? | |
| timeout | number? |
aliveList(list: ?) → void
Rules
| arg | type | description |
|---|---|---|
| list | ? |
over( ) → string
allDown( ) → boolean
helpless( ) → boolean
visOf(c: ?) → void
| arg | type | description |
|---|---|---|
| c | ? |
eraseEnemyVisual(e: ?) → void
| arg | type | description |
|---|---|---|
| e | ? |
hitEnemy(p: ?, e: ?, power: number, element: string, physical: boolean) → boolean
One hit from a party member on an enemy. Returns true when it earns an Overdraw.
| arg | type | description |
|---|---|---|
| p | ? | |
| e | ? | |
| power | number | |
| element | string | |
| physical | boolean |
overdraw(p: ?) → void
| arg | type | description |
|---|---|---|
| p | ? |
chooseEnemy( ) → void
Actions
chooseAlly(title: string) → void
| arg | type | description |
|---|---|---|
| title | string |
doAttack(p: ?, e: ?) → boolean
| arg | type | description |
|---|---|---|
| p | ? | |
| e | ? |
doSkill(p: ?, key: string, e: ?) → boolean
| arg | type | description |
|---|---|---|
| p | ? | |
| key | string | |
| e | ? |
useItem(p: ?, item: ?, target: ?) → void
| arg | type | description |
|---|---|---|
| p | ? | |
| item | ? | |
| target | ? |
echoHeadLocal( ) → void
The Awakening (scripted)
awaken(p: ?) → void
| arg | type | description |
|---|---|---|
| p | ? |
eraseAll(p: ?) → void
Erase All
| arg | type | description |
|---|---|---|
| p | ? |
cmdMenu(p: ?) → void
Turns
| arg | type | description |
|---|---|---|
| p | ? |
skillMenu(p: ?) → void
| arg | type | description |
|---|---|---|
| p | ? |
itemMenu( ) → void
partyCommand(p: ?) → string
returns "overdraw" | "done"
| arg | type | description |
|---|---|---|
| p | ? |
texturedTurn(p: ?) → void
| arg | type | description |
|---|---|---|
| p | ? |
partyTurn(p: ?) → void
| arg | type | description |
|---|---|---|
| p | ? |
pickMove(e: ?) → void
| arg | type | description |
|---|---|---|
| e | ? |
enemyTurn(e: ?) → void
| arg | type | description |
|---|---|---|
| e | ? |
makeParty(spec: ?) → void
Battle lifecycle
| arg | type | description |
|---|---|---|
| spec | ? |
makeEnemies(spec: ?) → void
| arg | type | description |
|---|---|---|
| spec | ? |
teardown( ) → void
finish(result: any) → void
| arg | type | description |
|---|---|---|
| result | any |
victory( ) → void
defeat(fled: boolean) → void
| arg | type | description |
|---|---|---|
| fled | boolean |
run(spec: ?) → void
| arg | type | description |
|---|---|---|
| spec | ? |
start(spec: any) → void
| arg | type | description |
|---|---|---|
| spec | any |
animOffset(c: ?) → void
Per-frame: camera, figures, boil, FX expiry, UI refresh
| arg | type | description |
|---|---|---|
| c | ? |
stepCamera(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
stepFigures(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
stepUi( ) → void
expire(list: ?) → void
| arg | type | description |
|---|---|---|
| list | ? |
start(spec: any) → void
The API
| arg | type | description |
|---|---|---|
| spec | any |
isRunning( ) → void
forfeit( ) → void
state( ) → void
awake( ) → void
Lifecycle
update(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
onCallback(id: ?, data: ?) → void
| arg | type | description |
|---|---|---|
| id | ? | |
| data | ? |
onDestroy( ) → void
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.