Alchemy
Loading...
Searching...
No Matches

battle.c

Go to the documentation of this file.
1/// @file
2/// The battle object: a battle from its opening transition to its spoils.
3/// battle_internal.h holds what the parts share (the includes and the names
4/// two or more of them use); the code is in the files under battle/, included
5/// here in the order it has in the ROM. Camelot's own files are not
6/// recoverable: the ROM shows one object, and these parts are ours, cut where
7/// one family ends and the next begins.
8///
9/// A battle runs from Battle_RunEncounter (encounter.c). Each round the
10/// actions are gathered and put in turn order (round.c, or auto_battle.c under
11/// auto battle), and each action is announced and planned
12/// (BattleCommand_BuildPlan, plan.c), staged
13/// (BattlePresentation_DispatchAction, staging.c) and applied to each target
14/// (BattleTargetExec, target_exec.c), which queues the battle events
15/// BattleEvent_Playback plays (playback.c). README.md in this folder gives the
16/// words, prefixes and spellings the parts use.
17
18#include "battle_internal.h"
19
20// The battle object's code, in ROM order. Each part is compiled here, as
21// part of this one object, never on its own: the order of these includes is
22// the order of the code in the ROM.
23#include "battle/debug.c"
24#include "battle/setup.c"
25#include "battle/link.c"
26#include "battle/encounter.c"
27#include "battle/sprites.c"
28#include "battle/placement.c"
29#include "battle/objects.c"
30#include "battle/motion.c"
31#include "battle/auto_battle.c"
32#include "battle/round.c"
33#include "battle/staging.c"
34#include "battle/targeting.c"
35#include "battle/events.c"
36#include "battle/target_exec.c"
37#include "battle/enemy_ai.c"
38#include "battle/playback.c"
39#include "battle/plan.c"
40#include "battle/turn_end.c"
41#include "battle/transition.c"
42#include "battle/background.c"
43#include "battle/star_field.c"
44#include "battle/formation.c"
45#include "battle/classes.c"
46#include "battle/spoils.c"
Auto battle: the actions it builds and plays, without the command menu.
The battle background, its palette and perspective, the camera's zoom and the units' highlights.
The enemy classes' battle sprite table, gSummon_EntryTable.
Debug: the party presets, the message viewer and the battle test menu.
A whole battle, Battle_RunEncounter, and the lists of the units in it.
Battle events: a downed unit's reset, waiting for the player, and the event queue,...
Each frame's sprite priorities, the status icons, the poses and the sprites of the battle objects.
The battle camera each frame, the opening announcement, the unit lists, and the party's battle state ...
Battle sprites: enemy sprite slots and the party's weapon sprites.
The opening transition: the curtain, or the Venus Lighthouse storm.
What every part of the battle object shares: its includes, in their original order,...
An enemy's choice of action, BattleCommand_SelectAutomatic.
Enemy formations: the enemies chosen, levelled and lettered.
The units' movements: returning, running, leaping and knocked back, and their positions on the screen...
Battle objects made and placed on the battlefield.
An action announced and planned, BattleCommand_BuildPlan.
Battle events played over frames, BattleEvent_Playback.
A round's actions: the party's commands, the enemies' or the link opponent's, and their turn order.
The spoils: coins, experience, items and level ups.
An action played: its targets, and how an attack, a cast, an item, a summon or an escape is staged.
A unit's elemental glow: the star field and the other glows.
An ability applied to one target, BattleTargetExec: damage, healing and its added effect.
The targets an enemy's or a confused unit's ability picks.
The end of a turn and of a round: counters, Djinn recovery, poison and the Grim Reaper.