33 element = element * 3 + 0x21;
45 }
else if (tech->
script == 5) {
62 if (task->
side != 0) {
77 task->
lines[0] = 0x1D;
86 if (fighter->
hp <= 0) {
108 switch (task->
state) {
115 other = task->
side != 0;
121 if (task->
side == 0) {
130#elif VERSION_EU || VERSION_JP
151 if (task->
tech == 1) {
161 if (task->
hit != 0) {
173 if (children[0].message ==
NULL) {
179 if (children[0].script ==
NULL) {
185 if (children[0].message ==
NULL) {
209#if VERSION_EU || VERSION_JP
218 if (fighters[fighter].
id == 0) {
221 for (i = 0; i < 6; i++) {
227 if (fighters[fighter].hp == 0) {
230 fighters[fighter].
flags = 0;
231 fighters[fighter].
hp = fighters[fighter].
maxHp;
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.
#define FIGHTER_PARALYZED
loses turns at random (FIGHTSTG_battleFuncs.testParalysis)
#define BATTLE_KIND_NORMAL
The kinds of battle (Battle.kind), which WFIGHTMN picks by the battle and the mode it came from.
#define ACTIVE_FIGHTER(side)
SIDE's active fighter as its row plus the index, which GCC adds with the row's address first.
#define EVENT_PARTNER_TECH
a technique of the partner's, run as its command
#define SIDE_PLAYER
The battle's sides, as the functions that take a side want them: side >> 4 is its row of FIGHTSTG_bat...
#define ELEMENT_FIRST
The elements (TechData.element, BattleStats.element) and the families (TechData.family,...
EventQueue FIGHTSTG_events
the battle's events and their functions
void FIGHTSTG_queueBoostEnd(u8 side, s32 fighter, s32 kind, s32 tech)
Queues the end of a fighter's boost of stat kind, 12 frames on when a technique (tech) gave it and 8 ...
FIGHTSTG.PRO: the battle.
BattleScript * FIGHTSTG_createBattleScript(void)
Creates a battle script, which plays a technique (FIGHTSTG_updateBattleScript)
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 ...
static void playCounterTech(Counterattack *task, BattleChild *children)
Starts the battle script of the counterattack's technique, with its element's stage,...
void FIGHTSTG_reviveFighter(s32 tech, s32 fighter)
Revives one of the player's fighters at full HP, clearing its status events, and raises its defense b...
static void showCounterResult(Counterattack *task, BattleChild *children)
Shows whether the counterattack hit and for how much, and takes the damage from the countered fighter...
void FIGHTSTG_updateCounterattack(Counterattack *task, BattleChild *children)
A counterattack (FIGHTSTG_startCounterattack): the player's from an event of type 8 or the partner's ...
s32 FIGHTSTG_getEnemyAction(u8 kind)
What an enemy's action target makes it do (EnemyTurn.target): 1 its first technique,...
s32 FIGHTSTG_testEnemyCondition(u8 condition, s16 arg)
Whether the condition of an enemy's action holds (BattleTableAction): always, a chance in 128,...
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
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)
void WFIGHTMN_checkEquip(s32 member)
Queues a recovery (FIGHTSTG_queueRecovery) for party member MEMBER's partner when it has WFIGHTMN_REC...
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(* rollCounter)(s32 arg0, s32 arg1)
void(* changeBoost)(u8 side, s32 index, s32 stat, s32 percent)
changes a fighter's stat boost
s32(* computeCounterDamage)(u8 side, s32 id, s32 value)
s32(* testParalysis)(u8 side)
whether side's paralysis costs it the turn
s32(* rollHit)(u8 side, s32 tech)
whether a hit lands
BattleStats *(* computeStats)(u8 side, s32 which, s32 index)
void(* show)()
FIGHTSTG_showMessage: (task, type, data)
s32 enemy
the script is the enemy's (nonzero) or the partner's
s32 sound
what the sound commands' 0x62 and 0x63 stand for on a hit
s32 effect
the sprite effect the effect command's 9999 stands for
s32 hits[4]
0 a hit, 3 a miss; [3] how it ended
s32 index
the script, in the fighter's archive
s32 stage
what the stage command's 0x38 stands for
s32 active[2]
each side's fighter
BattleFighter fighters[2][3]
s16 kind
the kind of battle
A side's stats as FIGHTSTG_computeStats works them out.
u8 counter
answers hits with the partner's first skill
u8 element
the accessory's, for techniques without one
BattleTableAction counter
its counterattack (FIGHTSTG_updateCounterattack)
s16 techs[3]
its first, then those of FIGHTSTG_getEnemyAction's kinds 2 and 3
A counterattack (FIGHTSTG_startCounterattack)
s32 noKnockOutEvent
a knockout doesn't call FIGHTSTG_queueKnockOut
s32 lines[8]
FIGHTSTG_updateMessage's.
s32 hit
whether the technique hits (FIGHTSTG_battleFuncs.rollHit)
void(* nextState)(struct Counterattack *task)
u8 side
the side that counters, 0 or 0x10
s32 received
the damage it answers, 0 for none
u16 skills[7]
[1]-[6] are learnt at skillLevels
s32(* find)(s32 type, u8 side, s32 fighter)
s16 type
0 for a free entry
A technique (TECHS, from 1: technique n is TECHS[n - 1])
u8 scriptSound
its script's hit sound (BattleScript.sound)
u8 scriptEffect
its script's sprite effect (BattleScript.effect)
u8 effectPower
the effect's strength (a boost's amount, a drain's 128ths)
u8 element
ELEMENT_FIRST and up, under it none.
u8 script
its script in the user's archive (BattleScript.index); 5 and 12 are special
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
s32 FIGHTSTG_clearIds[]
the event types that the European version's FIGHTSTG_reviveFighter clears
s32 WFIGHTMN_limitDamage(u8 side, s32 damage, s32 hits)
In BATTLE_KIND_ESCAPE and BATTLE_KIND_UNK2, cuts the damage that the partner's hits do so that the en...
void WFIGHTMN_countHit(u8 side, s32 damage)
In BATTLE_KIND_FINAL_LAST, the partner's third hit that does damage weakens the enemy (FIGHTSTG's FIG...
void WFIGHTMN_chargeGauge(u8 side, s32 damage)
Adds what damage gives to the current partner's gauge (BATTLE_SETUP.gauges), up to 1000.
s32 WFIGHTMN_setIdleMotion(u8 id, s32 damage)
Sets the idle motion of side id >> 4's fighter: 1 (weak) if damage leaves it with a quarter of its HP...
A turn's or a counterattack's one child, and what WFIGHTMN's battle menu waits for (NULL when it is d...
BattleMessageBox * message
FIGHTSTG_createMessage.
BattleScript * script
a technique's (FIGHTSTG_createBattleScript)