Baka Fighter minigame
The casino’s one-on-one fighting cabinet. The player picks a battle-form party member and climbs a ladder of CPU opponents in best-of-three matches. Each exchange is a rock-paper-scissors matchup between three attacks, with damage scaled by per-fighter stats and combo length. Won rungs build a coin pot that can be banked or risked on the next rung.
At a glance
- Overlay
- PROT 0976,
0xE000bytes at base0x801CE818; initFUN_801CF00C - Cabinet state machine
FUN_801CF388, state wordDAT_801DBF44, 37 states- Round state machine
FUN_801D3468, phaseDAT_801DBF78- Exchange resolver
FUN_801D3A14- Damage / critical
FUN_801D3B18/FUN_801D6660- CPU move pick
FUN_801D487C- Fighter data
- Roster table
0x801D769C, 17 records, stride0x6C - Art
- Party pack PROT 1204 / 1205; ladder fighters 1206..=1219; HUD + stage 1203
- Pot
- Prize accumulator
_DAT_80084440, banked into the coin bank0x800845A4 - Port
engine-minigames:baka_fighter,baka_cabinet; 3D duelengine-minigame-scenes::baka_duel_scene
Getting there
The door is the mode-24 minigame warp: field-VM op 0x3E with op0 = 104 (sub-id 4) sets game mode 0x18 and loads the overlay. It is the ordinary scene-backup, overlay-load, return-to-field sequence, so the game returns to the exact field state it suspended. The mechanism is on the field / event VM page.
The three casino cabinets are interchangeable doors behind an entry gate and a one-coin fee. A fourth site on an overworld map is dev residue: a bare record with nothing but the warp, in a slot no reachable script spawns.
The seat is choreographed by the cabinet’s own script. The interaction walks the player onto the stool tile, turns them to the machine, plays the sit clip, takes the fee and washes the screen to black (a subtractive white held at full) before the warp. A second pass after the warp clears the wash and stands the player up; the scene’s system script starts it once the field is back, off a per-cabinet flag the seat raised. The port runs both passes on both play hosts, and draws no field wash over the duel itself.
The exchange and the round
| P1 \ P2 | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
0 idle | undecided | undecided | undecided | undecided | P2 |
1 | undecided | draw | P2 | P1 | P2 |
2 | undecided | P1 | draw | P2 | P2 |
3 | undecided | P2 | P1 | draw | P2 |
4 special | P1 | P1 | P1 | P1 | P1 |
The resolver’s settle timer is vestigial: nothing in the overlay ever stores a positive value to it. Exchange pacing comes from the two per-fighter cooldowns.
Damage
hit = power + power * ATK / 100
dmg = (hit * (200 - (mod + mod * DEF / 100)) * 0x20) / 100 + (combo - 1) * 0x40
critical pending on the winner: dmg = power << 7
- ATK is the winner’s and DEF the loser’s, each picked from three values by that fighter’s HP tier (above
0x8C0, above0x3C0, below). combois the loser’s count of consecutive hits taken; winning an exchange clears it.- A critical is rolled only while a fighter’s own HP is above zero and below
0x280- a comeback mechanic. - The special’s HP delta is zero by construction. Its power is 0 for all seventeen fighters, and it only ever runs against a foe already at 0 HP. Its whole payoff is the round win, credited on its final keyframe.
How the CPU picks
Each opponent mixes random throws with a canned sequence. With no pattern running, a roll of rand() % 6 gives a three-in-six chance of one uniformly random attack and a three-in-six chance of starting the opponent’s pattern. Once started, the pattern is consumed back to front to exhaustion regardless of later rolls. The result is always one of the three attacks; the CPU never opens with a special.
The ladder, the pot and the secret rungs
- A match is best of three. The stage counter is seeded to 2 and maps to roster ids
stage + 3, so the twelve rungs served first are roster ids 5 to 16, with prize gold strictly rising across them. - The two secret opponents are score-gated, not lap-gated. Clearing stage 5 with a running high score above 250,000, or stage 13 above 700,000, arms an override that inserts one of them without advancing the stage. A score exactly on the threshold does not qualify.
- Only the score tally adds to the pot. A mid-run loss forfeits it: the game-over state zeroes the accumulator before its banner spawns.
- Every exit pays the accumulator into the casino coin bank, not party gold. A shutout pays a 30,000-point first tally row instead of 20,000.
The duel HUD
One renderer draws it every frame of the duel: the two VITAL bars in their three-cell frames, the round-win pips, the attack-icon columns, the "HIT!" counters, and the top strip with the STAGE number and the blinking PRESS SELECT TO MENU prompt. Its own pieces sort one layer under the round banners, so a ROUND or FIGHT! card always draws over it.
- The bars are textured. Each samples a tiny grey patch of a system texture page, so its red comes out a shade darker than its vertex colour: 160 for a vertex red of 188, as a retail capture measures.
- The counters are crossed. Each side shows the other fighter's hits-taken count, which is the streak that side is landing.
- The lit icon flashes. The row of the attack a fighter just chose brightens, dims for three frames, then brightens again, off a timer the combat tick runs from the commit.
Both play hosts draw this layer through one shared builder, whether the duel opened from a Sol Tower cabinet seat or from the launcher. Before that builder existed, a seated duel showed a lone round digit: the HUD model was ported and built every frame, but neither host drew it.
See also
The 37 cabinet states, the fighter packs and action tables, the strike clock, the arena camera, the effect pair and the whole HUD are in docs/subsystems/minigame-baka-fighter.md.