12 if (task->
side == 0) {
19 if (task->
side != 0 && tech->
mp > fighter->
mp) {
21 task->
lines[0] = 0x8D;
33 s32 other = 1 - (task->
side >> 4);
53#if VERSION_EU || VERSION_JP
54 if (task->
damage >= 10000) {
75 task->
lines[0] = 0x1D;
91 if (struck->
hp <= 0) {
102 task->
lines[0] = 0x2B;
107 countered->
flags &= ~FIGHTER_ASLEEP;
134 switch (task->
state) {
144 if (children[0].task ==
NULL) {
149 if (task->
side != 0) {
158 if (children[0].task ==
NULL) {
165 if (children[0].task ==
NULL) {
169 }
else if (task->
step != 0) {
171 }
else if (task->
damage == 0) {
184 if (children[0].task ==
NULL) {
189 index = task->
side == 0;
204 if (children[0].task !=
NULL) {
205 if (children[0].task->
state != 2) {
213 if (children[0].task ==
NULL) {
219 if (children[0].task ==
NULL) {
224 if (children[0].task ==
NULL) {
ActionEvents * FIGHTSTG_startActionEvents(s32 side)
Starts running the current action's events for SIDE (FIGHTSTG_updateActionEvents)
BattleAction FIGHTSTG_action
the command being carried out
Battle FIGHTSTG_battle
the battle: its fighters, speed and drawing functions
BattleFuncs FIGHTSTG_battleFuncs
the battle's stats and the functions that compute with them
void FIGHTSTG_queueKnockOut(u8 side)
Queues the fall of side's active fighter (event 20), first.
static BattleFighter * FIGHTSTG_getActiveFighter(s32 row)
Row's active fighter (FIGHTSTG_battle.state.fighters[row][active[row]]), as the row's offset in bytes...
#define TECH_EFFECT_MULTI_HIT
#define TECH_EFFECT_KNOCK_OUT
#define TECH_EFFECT_END_BATTLE
in BATTLE_KIND_UNK2: takes 70 percent of the partner's HP, ends as BATTLE_FLED
#define ACTIVE_FIGHTER(side)
SIDE's active fighter as its row plus the index, which GCC adds with the row's address first.
#define BATTLE_KIND_FINAL_LAST
its third enemy; winning plays the ending
#define FIGHTER_ASLEEP
can't act or run away; a hit may wake it up
EventQueue FIGHTSTG_events
the battle's events and their functions
FIGHTSTG.PRO: the battle.
BattleTableEntry *(* FIGHTSTG_battleTableFunc)(s32 id)
how the fight stage and WFIGHTMN read the battle table
Counterattack * FIGHTSTG_startCounterattack(s32 side, s32 received, s32 noKnockOutEvent)
Starts SIDE's counterattack (FIGHTSTG_updateCounterattack) to RECEIVED damage; NOKNOCKOUTEVENT keeps ...
EnemyAttack * FIGHTSTG_startEnemyAttack(s32 kind, s32 noKnockout)
Starts an attack on the player's active fighter (FIGHTSTG_updateEnemyAttack): kind 0 for the enemy's ...
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
static void announceFirstTech(FirstTech *task, BattleChild *children)
Picks the side's first technique and says it is used (or, for an enemy without the MP,...
static void wakeCounteredUp(FirstTech *task, BattleChild *children, BattleFighter *countered, s32 index)
Wakes up COUNTERED, the sleeping fighter the technique struck in row INDEX, says so and ends its slee...
static void takeFirstTechDamage(FirstTech *task)
Takes the damage from the other side's active fighter, queueing its knockout at 0 HP (and setting ste...
void FIGHTSTG_updateFirstTech(FirstTech *task, BattleChild *children)
A side's first technique (FIGHTSTG_startFirstTech): the partner's skills[0] or the enemy's battle tab...
static void showFirstTechResult(FirstTech *task, BattleChild *children)
Shows the technique's result (its hits, its knockout, the 70 percent of the partner's HP that TECH_EF...
FirstTech * FIGHTSTG_startFirstTech(s32 side)
Starts side's first technique (FIGHTSTG_updateFirstTech)
DigimonData *(* GET_DIGIMON)(s32 id)
getDigimon for the overlays, in the small data (.sdata) between game/items.c's and file/file_table....
TechData TECHS[443]
The techniques, from 1: technique n is TECHS[n - 1].
BattleMessageBox * FIGHTSTG_createMessage(void)
Creates a battle message box (FIGHTSTG_updateMessage)
u8 effects[0x28]
by TECH_EFFECT_*: what each one does, 0 for none
void(* start)(u8 side, s32 tech)
FIGHTSTG_startAction.
u8 hits[4]
whether each hit lands
One of the battle's fighters, three on each side (WFIGHTMN's BattleUnit): a partner's HP and MP go ba...
s16 charge
added in 64ths to its next technique's damage, which uses it up
s16 id
the Digimon (DIGIMON_DATA)
s32(* testWakeUp)(u8 side, s32 value)
void(* show)()
FIGHTSTG_showMessage: (task, type, data)
s32 active[2]
each side's fighter
BattleFighter fighters[2][3]
s16 kind
the kind of battle
s16 techs[3]
its first, then those of FIGHTSTG_getEnemyAction's kinds 2 and 3
u16 skills[7]
[1]-[6] are learnt at skillLevels
s32(* find)(s32 type, u8 side, s32 fighter)
FIGHTSTG_updateFirstTech's task (FIGHTSTG_startFirstTech): a side's first technique.
u8 side
the side that uses it, 0 or 0x10
void(* nextSubstate)(struct FirstTech *task)
void(* nextState)(struct FirstTech *task)
s32 asleep
whether the other side's fighter was asleep
void(* setState)(struct FirstTech *task, s32 state)
void(* setSubstate)(struct FirstTech *task, s32 substate)
s32 lines[8]
FIGHTSTG_updateMessage's.
s16 type
0 for a free entry
Any task, seen through its header.
A technique (TECHS, from 1: technique n is TECHS[n - 1])
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
BattleScript * WFIGHTMN_startTech(u8 actor, s32 id)
Starts the effect of actor's move id (FIGHTSTG's FIGHTSTG_createBattleScript): its kind and motions f...
void WFIGHTMN_chargeGauge(u8 side, s32 damage)
Adds what damage gives to the current partner's gauge (BATTLE_SETUP.gauges), up to 1000.
A turn's or a counterattack's one child, and what WFIGHTMN's battle menu waits for (NULL when it is d...
Counterattack * counter
a counterattack (FIGHTSTG_startCounterattack)
ActionEvents * events
the queued events (FIGHTSTG_startActionEvents)
BattleMessageBox * message
FIGHTSTG_createMessage.
BattleScript * script
a technique's (FIGHTSTG_createBattleScript)
EnemyAttack * enemyAttack
an attack on the player's fighter (FIGHTSTG_startEnemyAttack)