Skip to Content
The Alchemy Project

src/battle

Guide: Battle Engine

Files

FileDescription
ability_staging.cHow each ability is staged in battle: the outcome staging btActionRunBuild gives it and the effect it plays, by ability id.
action_weights.cThe enemies' action weights.
battle.cThe battle object: a battle from its opening transition to its spoils.
battle_ability.cAn ability applied to one target, btAbilityApplyToTarget: damage, healing and its added effect.
battle_action.cAn action announced and built for its targets, btActionRunBuild.
battle_auto_battle.cAuto battle, the battle test menu's mode (FLAG_AUTO_BATTLE, set by btDebugBattleRunMenu): no command menu opens, every unit attacks in action order, and each action is played by the simpler routines here instead of battle_staging.c's.
battle_background.cThe battle background, its palette and modes, the camera's zoom and the units' highlights.
battle_debug.cDebug: the parameter sets, the message viewer and the battle test menu.
battle_element_glow.cA unit's elemental glow: the star field and the other glows.
battle_enemy_ai.cAn enemy's choice of action, btAIChooseAction.
battle_formation.cEnemy formations: the enemies chosen, levelled and lettered.
battle_internal.hWhat every part of the battle object shares: its includes, in their original order, and the names two or more parts use.
battle_link.cLink battles: the parties and Djinn exchanged, and the turn handshake.
battle_motion.cThe units' movements: returning, running, leaping and knocked back, and their positions on the screen.
battle_objects.cEach tick's sprite priorities, the status icons, the poses and the sprites of the battle objects.
battle_placement.cBattle objects made and placed on the battlefield.
battle_playback.cPlayback over ticks, btPlaybackRun.
battle_playback_queue.cBattle playback: a downed unit's reset, waiting for the player, and the playback queue, filled by btPlaybackPush and played at once by btPlaybackRunAll.
battle_run.cA whole battle, btRun, and the lists of the units in it.
battle_setup.cThe battle camera each tick, the opening announcement, the unit lists, and the party's battle state and Djinn as a battle starts and ends.
battle_spoils.cThe spoils: coins, experience, items and level ups.
battle_sprite.cReading a unit's row of BattleSprites by its id (UNIT.id): an enemy's sprite, palette, size, attack and defeat sound.
battle_sprite_slots.cBattle sprites: enemy sprite slots and the party's weapon sprites.
battle_sprites.cThe battle sprite rows, by unit id: the eight characters', then the enemies'.
battle_staging.cAn action played: its targets, and how an attack, a cast, an item, a summon or a flight is staged.
battle_tables.cThe battle's small tables: where a formation's places fall, the party's weapon sprites, the camera's command matrix, how an ability weakens with distance, and the enemies' action weights.
battle_targeting.cThe targets an enemy's or a confused unit's ability picks.
battle_transition.cThe opening transition: the curtain, or the Venus Lighthouse storm.
battle_turn.cA turn's actions: the party's commands, the enemies' or the link opponent's, and their action order.
battle_turn_end.cThe end of an action and of a turn: counters, Djinn recovery, poison and the Grim Reaper.
battle_unit_tables.cWhat every battle unit starts with: its actor script, and the kind of weapon each item is.
debug_parameter_sets.cThe debug parameter sets: runs of party members, each run ended by DEBUG_PARAMETER_SET_END, that btDebugParamSetLoad gives the party.
element_glow_tables.cWhere the element glow's sparks and rings sit on their sprite sheet.
formations.cThe 380 enemy formations, by formation id, and the enemies a monster battle never draws.
highlight_tables.cThe highlighted units' lightening.
knockback_tables.cHow far, how fast and how high each knockback sends a unit, by variant (BATTLE_KNOCKBACK).
turn_end_tables.cThe order the two sides take their turn-end effects in, and two tables after it that no code names.
unused_portrait_pairs.cUnused: two tables pairing a speaker with a portrait, which no code names.

On this page