115#elif VERSION_EU || VERSION_JP
123 for (i = 0; i < count; i++) {
124#elif VERSION_EU || VERSION_JP
125 for (i = 1; i < count; i++) {
241 if (fighter->
mp != 0) {
272 for (i = 0; i < 3; i++) {
289 for (i = 0; i < 3; i++) {
309#if VERSION_EU || VERSION_JP
310 s32 files[2] = { 0x1B9, 0x1BA };
316 for (i = 0; i < 2; i++) {
319#if VERSION_EU || VERSION_JP
408 entry = &
TECHS[tech - 1];
421 switch (entry->
icon) {
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
#define TECH_EFFECT_POISON
#define BATTLE_ACTION_STATE_SIZE
FIGHTSTG_action's bytes before start, which a new action clears.
#define TECH_EFFECT_DOUBLE_MAGIC
two magic hits, as techniques 0x1B9 and 0x1BA
#define HIT_DRAIN
its power is in 128ths of the damage
#define TECH_EFFECT_MULTI_HIT
#define TECH_EFFECT_FIRST
A technique's effect (TechData.effect), which FIGHTSTG_applyTechEffect carries out when its hit lands...
#define TECH_EFFECT_SLEEP
#define TECH_EFFECT_CONFUSION
#define BATTLE_KIND_NORMAL
The kinds of battle (Battle.kind), which WFIGHTMN picks by the battle and the mode it came from.
#define TECH_EFFECT_PARALYSIS
#define TECH_MAGIC
FIGHTSTG_rollMagicHit and FIGHTSTG_computeMagicDamage.
#define BATTLE_KIND_UNK2
the enemy keeps an eleventh of its HP
#define TECH_EFFECT_DRAIN_MP
the partner's, in 128ths of its max MP
#define TECH_EFFECT_ENEMY_ONLY
does nothing but for the enemy whose battle table entry lists it first
#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 TECH_EFFECT_DRAIN
HP, in 128ths of the damage.
#define HIT_POISON
The statuses a weapon's hits can inflict (BattleStats.statuses)
#define TECH_EFFECT_RAISE_ALL_STATUS
#define ACTIVE_FIGHTER(side)
SIDE's active fighter as its row plus the index, which GCC adds with the row's address first.
#define TECH_PHYSICAL
TechData.icon's kinds of attack.
#define HIT_KNOCK_OUT
its power is read by nothing
#define BATTLE_KIND_FINAL_LAST
its third enemy; winning plays the ending
#define TECH_EFFECT_LOWER_DEFENSE
#define TECH_EFFECT_NO_SWITCH
FIGHTER_NO_SWITCH for a while.
#define TECH_EFFECT_LOWER_ATTACK
#define TECH_EFFECT_STEAL
the enemy's item
#define TECH_EFFECT_RAISE_EACH_STATUS
each one that a roll lets
#define TECH_EFFECT_RAISE_ONE_STATUS
PartnerStats.status: one at random.
#define TECH_EFFECT_CRITICAL
raises the critical hit chance
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.
BattleTableEntry *(* FIGHTSTG_battleTableFunc)(s32 id)
how the fight stage and WFIGHTMN read the battle table
GameState GAME
The save data, the game mode and the methods.
#define TEXT_ITEM_NAMES
ITMNAM.
FileCache FILE_CACHE
The file cache.
#define BATTLE_BLOCK_LOWER_ATTACK
to 10: attack, defense, speed (a technique's boost stat + 8)
Heap HEAP
The functions that return what a call left in v0 (allocMemHigh, findTask) and the ones that take othe...
TechData TECHS[443]
The techniques, from 1: technique n is TECHS[n - 1].
FIGHTSTG_action: the technique being carried out.
u8 side
the acting side, SIDE_PLAYER or SIDE_ENEMY
s32 drain
the HP or MP that TECH_EFFECT_DRAIN or TECH_EFFECT_DRAIN_MP takes
u8 effects[0x28]
by TECH_EFFECT_*: what each one does, 0 for none
s16 hitCount
rolled in hits
u8 hits[4]
whether each hit lands
s32 hitDamage[2]
TECH_EFFECT_DOUBLE_MAGIC's.
One of the battle's fighters, three on each side (WFIGHTMN's BattleUnit): a partner's HP and MP go ba...
u8 special
the partner's special state (EVENT_SPECIAL_END): doubles its effects
s32(* rollMagicHit)(u8 side, s32 id)
s32(* rollSleep)(u8 side, s32 id)
void(* changeBoost)(u8 side, s32 index, s32 stat, s32 percent)
changes a fighter's stat boost
s32(* rollKnockOut)(u8 side, s32 id)
BattleStats stats[2]
the player's, then the enemy's
s32(* rollNoSwitch)(s32 actor, s32 id)
s32(* rollConfusion)(u8 side, s32 id)
s32(* rollPoison)(u8 side, s32 id)
s32(* rollHit)(u8 side, s32 tech)
whether a hit lands
s32(* computeMagicDamage)(u8 side, s32 id)
s32(* rollDrain)(u8 side, s32 id)
s32(* rollSteal)(u8 side, s32 id)
s32(* rollStatusRaise)(s32 actor, s32 id)
s32(* computeDamage)(u8 side, s32 tech)
of each hit
s32(* rollParalysis)(u8 side, s32 id)
u8 blocks[12]
by BATTLE_BLOCK_*: what the player can't do in the battle
s32 active[2]
each side's fighter
BattleFighter fighters[2][3]
s16 kind
the kind of battle
u8 tripleHit
plain physical techniques hit 3 times for 0.4 of the damage
HitStatus statuses[5]
by HIT_*, from the weapon
FIGHTSTG_battle: the battle.
void(* request)(s32 file)
struct PartnerStats *(* getPartnerStats)(s32 partner)
s32(* getPartyMember)(u32 index)
void(* zero)(void *ptr, s32 size)
A partner Digimon from its name on (Partner.info), as getPartnerStats gives it.
s32(* next)(void)
0 to RANDOM_COUNT - 1
A technique (TECHS, from 1: technique n is TECHS[n - 1])
u8 effect
TECH_EFFECT_* (fightstg/battle.h), under TECH_EFFECT_FIRST none.
u8 effectPower
the effect's strength (a boost's amount, a drain's 128ths)
u8 icon
a frame of the menu sprites, from 0x37
u8 script
its script in the user's archive (BattleScript.index); 5 and 12 are special
void FIGHTSTG_trySleep(void)
TECH_EFFECT_SLEEP: puts the target to sleep when rollSleep lets it, twice as strongly when the acting...
void FIGHTSTG_raiseOneStatus(void)
TECH_EFFECT_RAISE_ONE_STATUS: when rollStatusRaise lets it, raises one of the partner's status values...
void FIGHTSTG_tryDrain(void)
When rollDrain allows it, the action's drain becomes its damage times a 128th of the technique's effe...
void FIGHTSTG_markEnemyOnly(void)
TECH_EFFECT_ENEMY_ONLY outside its own enemy's hands: marks the effect, which takes the place of the ...
void FIGHTSTG_tryConfusion(void)
TECH_EFFECT_CONFUSION: confuses the target when rollConfusion lets it, with the technique's effectPow...
void FIGHTSTG_tryNoSwitch(void)
TECH_EFFECT_NO_SWITCH: marks the effect when rollNoSwitch lets it.
void FIGHTSTG_tryKnockOut(void)
TECH_EFFECT_KNOCK_OUT: knocks the target out when rollKnockOut lets it.
static void markTechEffect(void)
Marks the action's technique's effect with the effect itself.
void FIGHTSTG_markCritical(void)
TECH_EFFECT_CRITICAL: marks the effect, which rollCritical has used.
void FIGHTSTG_startAction(u8 side, s32 tech)
Starts side's technique: rolls its hits and damage, then its effect or, for the player's plain techni...
void FIGHTSTG_tryPoison(void)
TECH_EFFECT_POISON: poisons the target when rollPoison lets it, twice as strongly when the acting fig...
void FIGHTSTG_startDoubleMagic(void)
Starts a TECH_EFFECT_DOUBLE_MAGIC technique: two magic hits, each with the damage of technique 0x1B9 ...
void FIGHTSTG_drainMp(void)
TECH_EFFECT_DRAIN_MP: takes the technique's effectPower in 128ths of the player's fighter's max MP,...
void FIGHTSTG_lowerAttack(void)
TECH_EFFECT_LOWER_ATTACK: lowers the attack of the other side's active fighter by the technique's eff...
void FIGHTSTG_lowerDefense(void)
TECH_EFFECT_LOWER_DEFENSE: lowers the defense of the other side's active fighter by the technique's e...
void FIGHTSTG_trySteal(void)
TECH_EFFECT_STEAL: when the enemy's active fighter holds an item and rollSteal lets the player take i...
void FIGHTSTG_tryParalysis(void)
TECH_EFFECT_PARALYSIS: paralyzes the target when rollParalysis lets it, with the technique's effectPo...
void FIGHTSTG_applyTechEffect(void)
Carries out the effect of a technique whose hit landed.
void FIGHTSTG_startEndBattle(void)
Starts a TECH_EFFECT_END_BATTLE technique: in BATTLE_KIND_UNK2 its effect, elsewhere a plain physical...
void FIGHTSTG_rollMultiHit(void)
TECH_EFFECT_MULTI_HIT and the triple-hit accessory: rolls the other hits, 3 or the technique's hitCou...
void FIGHTSTG_raiseAllStatus(void)
TECH_EFFECT_RAISE_ALL_STATUS: when rollStatusRaise lets it, raises all of the partner's status values...
void FIGHTSTG_raiseEachStatus(void)
TECH_EFFECT_RAISE_EACH_STATUS: raises each of the partner's status values that rollStatusRaise lets b...
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...