src/battle
Guide: Battle Engine
Files
| File | Description |
|---|---|
ability_staging.c | How each ability is staged in battle: the outcome staging btActionRunBuild gives it and the effect it plays, by ability id, and the effect chance it rolls ahead. |
action_weights.c | The enemies' action weights. |
battle.c | The battle object: a battle from its opening transition to its spoils. |
battle_ability.c | Applying an ability to each of its targets: damage, healing, statuses, stat changes, Djinn and special effects. |
battle_action.c | An action announced and built for its targets, btActionRunBuild, with whether a unit is in its side's list and how many Djinn a side has on standby. |
battle_auto_battle.c | Auto battle: the actions it builds and plays without the command menu, the shoulder-key camera and the escape. |
battle_background.c | The battle background, its palette and modes, the camera's zoom and the units' highlights. |
battle_debug.c | Debug: the unit snapshot, the parameter sets and the battle test menu. |
battle_element_glow.c | A unit's element glow: the star field of a cast, the streaks, the pillar and the burst, and restoring the background palette. |
battle_enemy_ai.c | |
battle_formation.c | Enemy formations: choosing, levelling and building a formation's enemies and assigning their name suffixes. |
battle_internal.h | What every part of the battle object shares: its includes, in their original order, and the names two or more parts use. |
battle_link.c | Link battles: the parties and Djinn exchanged, and the turn handshake. |
battle_motion.c | The units' movements: returning to their spots, running and leaping, and their positions on the screen. |
battle_objects.c | Each tick's sprite priorities, the status icons, the poses and the sprites of the battle objects, and the camera they are projected through. |
battle_placement.c | Battle objects made and placed on the battlefield. |
battle_playback.c | Battle playback: starting it, scheduling its phases, resetting it and waiting until it is ready. |
battle_playback_queue.c | The battle playback queue: clearing statuses, waiting for the player to advance messages, and queuing and running playback events. |
battle_run.c | A battle from its setup to its end (btRun), the party's reserves stepping in for the fallen, the Doom Dragon's change of form, and the lists of the units that fight. |
battle_setup.c | The battle camera each tick, the opening announcement, the unit lists, the tile pattern, and the party's battle state and Djinn as a battle starts. |
battle_spoils.c | The spoils: coins, experience, items and level ups. |
battle_sprite.c | Each enemy's battle sprite, palette, size, attack effect, hop, impact, defeat sound and effect height getters. |
battle_sprite_slots.c | Battle sprites: every unit's sprite placed, enemy sprite slots and the party's weapon sprites. |
battle_sprites.c | The battle sprite rows, by unit id: the eight characters', then the enemies'. |
battle_staging.c | Playing one action of a turn: the staging its ability calls for (an attack, a cast, a summon over a faded field, an item, a flight), the extra strikes that Daedalus, Megaera and Iris add, and a unit's motion graphics. |
battle_tables.c | The battle's small tables: where a formation's enemies stand, the party's weapon sprites, the camera's command matrix, how an ability weakens with distance, and the forms Dullahan takes. |
battle_targeting.c | How an enemy, or a confused unit, picks whom to aim at: a random living target, the strongest ally, or one its ability would affect, the enemies with a strategy favouring those with the most HP. |
battle_transition.c | How the screen goes into a battle: the mosaic fade to black, then the curtain that opens from the middle of the screen as the camera swings round to the party, or the Doom Dragon's shattering opening; and the zoomed background's maps and HBlank scroll they show. |
battle_turn.c | A turn's actions: the party's commands, the enemies' or the link opponent's, and their action order. |
battle_turn_end.c | The end of a turn and of each action: the Djinn recovering and set again, each unit's regeneration, stat changes and statuses counted down with a message for each that ends, the Djinn an enemy drains, and what follows a unit's own action (its summon's power boost, the haunt, poison and the Grim Reaper). |
battle_unit_tables.c | What every battle unit starts with: its actor script, and the kind of weapon each item is. |
color_scale_kernel.c | The BGR555 palette scaling kernel, compiled as ARM code: btColorBufferScale (color_scale.s) copies it to the stack and runs it there, entered in Thumb through ColorBufferScaleKernelCode. |
debug_parameter_sets.c | The debug parameter sets: runs of party members, each run ended by DEBUG_PARAMETER_SET_END, that btDebugParamSetLoad gives the party when the man hidden below the Battle lobby is given the run's number. |
element_glow_tables.c | Where the element glow's sparks and rings sit on their sprite sheet. |
formations.c | The 660 enemy formations, by formation id, each run of them headed by the battle or place it is for, and the enemies a Battle Arena monster battle never picks. |
highlight_tables.c | The highlighted units' lightening. |
knockback_tables.c | How far, how fast and how high each knockback sends a unit, by variant (BATTLE_KNOCKBACK). |
scripted_battle_units.c | The units Karst and Agatio's battle carries over between its parts. |
turn_end_tables.c | The order the two sides take their turn-end effects in, and two tables after it that no code names. |
unused_portrait_pairs.c | Unused: a copy of the speakers' portrait maps, linked among the battle code and read by nothing. |