13 for (j = 0; j < 5; j++) {
16 for (j = 0; j < 12; j++) {
20 if (fighter->
boosts[0] != 0) {
23 if (fighter->
boosts[1] != 0) {
26 if (fighter->
boosts[2] != 0) {
29 if (fighter->
boosts[3] != 0) {
72 if (digimon->
id != fighter->
id) {
74 for (i = 0; i < 5; i++) {
77 for (i = 0; i < 7; i++) {
84 if (fighter->
boosts[0] != 0) {
87 if (fighter->
boosts[1] != 0) {
90 if (fighter->
boosts[2] != 0) {
95 for (i = 0; i < 5; i++) {
96#if VERSION_EU || VERSION_JP
98 stats->
stats[i] = values[i];
103 stats->
stats[i] = values[i];
107 for (i = 0; i < 7; i++) {
108#if VERSION_EU || VERSION_JP
110 stats->
resist[i] = values[i];
115 stats->
resist[i] = values[i];
120 values = &partner->
equip[4];
121 for (i = 0; i < 2; i++) {
122 if (values[i] != 0) {
124 if (acc->
stat == 17) {
126 }
else if (acc->
stat == 18) {
128 }
else if (acc->
stat == 19) {
130 }
else if (acc->
stat == 20) {
132 }
else if (acc->
stat == 21) {
137 values = partner->
equip;
141 for (i = 0; i < 4; i++) {
144 if (info->
type >= 2 && info->
type <= 14) {
159 for (i = 0; i < 4; i++) {
160 if (i != 1 && values[i] > 0) {
162 if (values[i] == 0x97) {
166 }
else if (values[i] == 0xD2) {
170 }
else if (values[i] == 0xB4 || values[i] == 0xC2) {
174 }
else if (values[i] == 0x6D || values[i] == 0xBA) {
178 }
else if (values[i] == 0x5E || values[i] == 0x93 || values[i] == 0xAD) {
182 }
else if (values[i] == 0x96 || values[i] == 0xBF) {
189 values = &partner->
equip[4];
190 for (i = 0; i < 2; i++) {
191 if (values[i] == 0x13C) {
193 }
else if (values[i] == 0x13D) {
196 }
else if (values[i] == 0x13E) {
202 values = &partner->
equip[4];
203 for (i = 0; i < 2; i++) {
204 if (values[i] >= 0x153 && values[i] <= 0x167) {
206 if (values[i] < 0x156) {
208 }
else if (values[i] < 0x159) {
210 }
else if (values[i] < 0x15C) {
212 }
else if (values[i] < 0x15F) {
214 }
else if (values[i] < 0x162) {
216 }
else if (values[i] < 0x165) {
218 }
else if (values[i] < 0x168) {
222 }
else if (values[i] >= 0x145 && values[i] <= 0x146) {
225 }
else if (values[i] >= 0x14B && values[i] <= 0x14C) {
228 }
else if (values[i] >= 0x14D && values[i] <= 0x14E) {
231 }
else if (values[i] >= 0x14F && values[i] <= 0x150) {
234 }
else if (values[i] == 0x13F) {
237 }
else if (values[i] >= 0x147 && values[i] <= 0x148) {
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 HIT_DRAIN
its power is in 128ths of the damage
#define BATTLE_STAT_ATTACK
BattleStats.stats' indices: the partner's first five battle stats.
#define BATTLE_STAT_SPEED
physical accuracy, evasion and running away
#define HIT_POISON
The statuses a weapon's hits can inflict (BattleStats.statuses)
#define BATTLE_STAT_SPIRIT
magic damage, and against it
#define RESIST_POISON
BattleStats.resist's indices: against the elements (element - ELEMENT_FIRST), then against the status...
#define HIT_KNOCK_OUT
its power is read by nothing
#define BATTLE_STAT_DEFENSE
against it
static void computeEnemyStats(BattleStats *stats, BattleFighter *fighter, s32 index)
Works out an enemy's stats from its table entry, its strength and the fighter's boosts.
BattleStats * FIGHTSTG_computeStats(u8 side, s32 which, s32 index)
Works out a side's stats into its BattleStats: the partner's totals with the fighter's boosts,...
FIGHTSTG.PRO: the battle.
BattleTableEntry *(* FIGHTSTG_battleTableFunc)(s32 id)
how the fight stage and WFIGHTMN read the battle table
DigimonData DIGIMON_DATA[55]
55 entries: the 52 Digimon, then three placeholders (0x1D4-0x1D6)
GameState GAME
The save data, the game mode and the methods.
DigimonData *(* GET_DIGIMON)(s32 id)
getDigimon for the overlays, in the small data (.sdata) between game/items.c's and file/file_table....
Heap HEAP
The functions that return what a call left in v0 (allocMemHigh, findTask) and the ones that take othe...
An accessory's (types 21-24, ACCESSORY_DATA)
u8 evasion
added to the battle's (FIGHTSTG_computeStats)
s16 strength
its stats and techniques' power, in 16ths
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)
s16 boosts[4]
added to the stats FIGHTSTG_boostStats picks
BattleStats stats[2]
the player's, then the enemy's
BattleFighter fighters[2][3]
A side's stats as FIGHTSTG_computeStats works them out.
u8 tripleHit
plain physical techniques hit 3 times for 0.4 of the damage
u8 weaponFamilies[3]
from the equipment, as are the ones after
s16 stats[5]
with the fighter's boosts
u8 runAwayGuard
halves the enemy's chance to run away
u8 runAwayBonus
to the player's chance to run away
u8 damageCut
taken off each hit
u8 criticalBonus
to plain techniques' critical chance, off their accuracy
u8 damageBonus
in 64ths: the fighter's charge
HitStatus statuses[5]
by HIT_*, from the weapon
u8 counter
answers hits with the partner's first skill
u8 element
the accessory's, for techniques without one
s16 stats[5]
by BATTLE_STAT_*, scaled by the enemy's strength / 16
u8 family
FAMILY_*, the enemy's stats'.
Digimon definition (DIGIMON_DATA, 52 of them; the first 8 are the partners)
u8 statusResists[5]
against poison, paralysis, confusion, sleep and knock-outs
u8 family
the family it fights as (BattleStats.family)
struct PartnerStats *(* getPartnerStats)(s32 partner)
void(* computeStats)(s32 partner, union PartnerTotals *out)
s32(* getPartyMember)(u32 index)
void(* zero)(void *ptr, s32 size)
struct ItemInfo *(* get)(s32 item)
getItem
An item (ITEMS, ITEM_FUNCS)
u8 type
2-14 weapons, 15-20 armour, 21-24 accessories
ItemRecord data
the type's record, or the usable items' effect
A partner Digimon from its name on (Partner.info), as getPartnerStats gives it.
u8 statusChance
of the status its hits inflict
u8 family
its hits': FAMILY_FIRST and up, under it none
u8 accuracy
added to the battle's (FIGHTSTG_computeStats)
u8 statusPower
the status's, or the critical bonus
ItemInfo.data's record, by ItemInfo.type.
computeStats' result: the stats with the equipment added, by STAT_* or by name.
s16 battle[6]
strength (raised by weapons), defense (by armour), spirit, wisdom, speed and charisma (by all equipme...
struct PartnerTotals::@10 fields