battle
A module script.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2Turn-based battle engine: HP/PP/level/XP, 4 moves, type chart, STAB, catch, run, faint/switch/whiteout, level-up + move learning. Renders the classic GB layout.
stageMul(st: ?) → void
| arg | type | description |
|---|---|---|
| st | ? |
newBattler(mon: ?) → void
| arg | type | description |
|---|---|---|
| mon | ? |
say(b: ?, text: ?, opts: ?) → void
| arg | type | description |
|---|---|---|
| b | ? | |
| text | ? | |
| opts | ? |
sfx(b: ?, name: ?) → void
| arg | type | description |
|---|---|---|
| b | ? | |
| name | ? |
calcDamage(atkB: ?, defB: ?, move: ?) → void
| arg | type | description |
|---|---|---|
| atkB | ? | |
| defB | ? | |
| move | ? |
applyEffect(b: ?, atkB: ?, defB: ?, move: ?) → void
| arg | type | description |
|---|---|---|
| b | ? | |
| atkB | ? | |
| defB | ? | |
| move | ? |
doAttack(b: ?, atkB: ?, defB: ?, moveName: ?) → void
| arg | type | description |
|---|---|---|
| b | ? | |
| atkB | ? | |
| defB | ? | |
| moveName | ? |
enemyChooseMove(b: ?) → void
| arg | type | description |
|---|---|---|
| b | ? |
spendPP(mon: ?, moveName: ?) → void
| arg | type | description |
|---|---|---|
| mon | ? | |
| moveName | ? |
startTurn(b: ?, playerMove: ?) → void
| arg | type | description |
|---|---|---|
| b | ? | |
| playerMove | ? |
resolveStep(b: ?) → void
advance the resolve sequence one attacker at a time (called when msg queue drains)
| arg | type | description |
|---|---|---|
| b | ? |
gainXP(b: ?, amount: ?) → void
| arg | type | description |
|---|---|---|
| b | ? | |
| amount | ? |
tryCatch(b: ?) → void
| arg | type | description |
|---|---|---|
| b | ? |
start(S: ?, opts: ?, onEnd: ?) → void
| arg | type | description |
|---|---|---|
| S | ? | |
| opts | ? | |
| onEnd | ? |
finish(b: ?, result: ?) → void
| arg | type | description |
|---|---|---|
| b | ? | |
| result | ? |
tickMessages(b: ?, dt: ?, pressed: ?) → void
process the head of the message queue (typewriter + advance)
| arg | type | description |
|---|---|---|
| b | ? | |
| dt | ? | |
| pressed | ? |
checkFaints(b: ?) → void
check for faints after a message drains
| arg | type | description |
|---|---|---|
| b | ? |
tick(S: ?, dt: ?, pressed: ?) → void
| arg | type | description |
|---|---|---|
| S | ? | |
| dt | ? | |
| pressed | ? |
approach(cur: ?, target: ?) → void
smooth HP bar animation toward real values
| arg | type | description |
|---|---|---|
| cur | ? | |
| target | ? |
hpBar(gb: ?, fb: ?, x: ?, y: ?, w: ?, frac: ?) → void
| arg | type | description |
|---|---|---|
| gb | ? | |
| fb | ? | |
| x | ? | |
| y | ? | |
| w | ? | |
| frac | ? |
infoBox(gb: ?, fb: ?, x: ?, y: ?, mon: ?, hpAnim: ?, showHpNum: ?, showXp: ?) → void
| arg | type | description |
|---|---|---|
| gb | ? | |
| fb | ? | |
| x | ? | |
| y | ? | |
| mon | ? | |
| hpAnim | ? | |
| showHpNum | ? | |
| showXp | ? |
draw(S: ?, gb: ?, fb: ?) → void
| arg | type | description |
|---|---|---|
| S | ? | |
| gb | ? | |
| fb | ? |
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.