13 { 0 }, 0, 0, 0, 0, { 0 }, 0, 0, { 0 }, { 0 },
FIGHTSTG_startAction,
17 0, 0, { { 0 }, { { { 0 } } }, { 0, 0 }, 0, 0, 0, 0, 0 }, { 0, 0 },
22 0, 0, 0, 0,
NULL,
NULL, {
FIGHTSTG_getFighterInfo,
FIGHTSTG_cacheFighter,
FIGHTSTG_getFighterRange },
FIGHTSTG_getFighterFace,
32#if VERSION_EU || VERSION_JP
133#elif VERSION_EU || VERSION_JP
FighterCache FIGHTSTG_fighterCache
the fighters' data, loaded one at a time
s32 FIGHTSTG_techEvents[]
the event types of FIGHTSTG_startRestriction, by whether the technique's effect is TECH_EFFECT_NO_DIG...
void FIGHTSTG_queueBlast(void)
Queues the partner's digivolution for the battle (event 18), now.
BattleAction FIGHTSTG_action
the command being carried out
Battle FIGHTSTG_battle
the battle: its fighters, speed and drawing functions
void FIGHTSTG_weakenEnemy(void)
Weakens the enemy in BATTLE_KIND_FINAL_LAST: halves its boosts of stats 1 and 2 and queues the end (e...
void FIGHTSTG_startRestriction(s32 tech)
Restricts the partner with technique tech: sets FIGHTER_NO_SWITCH or FIGHTER_NO_DIGIVOLVE by the tech...
void FIGHTSTG_queueSpecialEnd(void)
Queues the end of the partner's special state (event 21): the USA version pushes back the one already...
BattleFuncs FIGHTSTG_battleFuncs
the battle's stats and the functions that compute with them
void FIGHTSTG_queueDigidevolve(void)
Queues the partner's digidevolution, first.
void FIGHTSTG_queueLastEnemy(void)
Queues the coming in of the last battle's third enemy, first.
void FIGHTSTG_queueKnockOut(u8 side)
Queues the fall of side's active fighter (event 20), first.
void FIGHTSTG_endEnemyWeakness(void)
Ends the enemy's weakness now: its queued event 24 runs next.
void FIGHTSTG_queueBlastEnd(s32 kind)
Queues the end of the partner's digivolution for the battle (event 19), after delay kind + 3.
void FIGHTSTG_queuePartnerTech(s32 tech)
Queues the partner's technique tech, to run as its command.
#define TECH_EFFECT_NO_DIGIVOLVE
FIGHTER_NO_DIGIVOLVE for a while.
#define EVENT_WEAKNESS_END
the end of the enemy's weakness (BATTLE_KIND_FINAL_LAST)
#define FIGHTER_NO_SWITCH
can't switch out or run away (TECH_EFFECT_NO_SWITCH)
#define EVENT_DIGIDEVOLVE
#define EVENT_LAST_ENEMY
the last battle's third enemy comes in
#define FIGHTER_NO_DIGIVOLVE
can't digivolve or use a switch-in technique (TECH_EFFECT_NO_DIGIVOLVE)
#define EVENT_SPECIAL_END
the end of the partner's special state
#define EVENT_PARTNER_TECH
a technique of the partner's, run as its command
#define EVENT_BLAST
the partner's digivolution for the battle
#define TECH_EFFECT_NO_SWITCH
FIGHTER_NO_SWITCH for a while.
#define EVENT_RESTRICTION_END
16-17: the end of a restriction (FIGHTER_NO_SWITCH or FIGHTER_NO_DIGIVOLVE)
void FIGHTSTG_pushEventFirst(BattleEvent *event)
FIGHTSTG_events.funcs.pushFirst: queues an event ahead of all the others, which wait its delay longer...
s32 FIGHTSTG_getEventDelay(u8 side, s32 kind)
FIGHTSTG_events.funcs.getDelay: the time until side's next event of kind (FIGHTSTG_eventDelays): rand...
void FIGHTSTG_pushEvent(BattleEvent *event)
FIGHTSTG_events.funcs.push: queues an event in the first free one of the 99 slots,...
EventQueue FIGHTSTG_events
the battle's events and their functions
s32 FIGHTSTG_findEvent(s32 type, u8 side, s32 fighter)
FIGHTSTG_events.funcs.find: the first queued event of type for side's fighter, or -1.
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
void FIGHTSTG_changeBoost(u8 side, s32 index, s32 stat, s32 percent)
Changes a fighter's stat boost by percent 128ths of the stat without it, between minus half the stat ...
s32 FIGHTSTG_getGaugeGain(s32 damage)
What the partner's damage adds to the gauge: the square of its percent of the max HP over 20,...
s32 FIGHTSTG_getTechCost(u8 side, s32 id)
A technique's MP cost; accessories 0x143 and 0x144 cut the player's, to no less than 1.
s32 FIGHTSTG_getHeal(u8 side, s32 index, s32 big)
The HP a fighter regains: 8 to 16 128ths of its max HP when big, 4 to 8 otherwise.
s32 FIGHTSTG_getDamage(s32 *args)
getDamage: the damage of an event (args: the side, the fighter and the base damage) to the fighter if...
s32 FIGHTSTG_computeDamage(u8 side, s32 id)
A technique's power from the user's attack against the target's defense (an enemy's scaled by its unk...
s32 FIGHTSTG_computeMagicDamage(u8 side, s32 id)
A magic technique's damage: its power by the user's spirit against the target's (half to twice as muc...
s32 FIGHTSTG_computeHeal(u8 side, s32 id)
The HP a healing technique restores: 64 times its power, and an eighth of it per point of the user's ...
s32 FIGHTSTG_computeCounterDamage(u8 side, s32 id, s32 value)
The damage of a counterattack on value: the partner's first skill deals it as one hit (the triple hit...
void FIGHTSTG_drawBlendedQuad(s32 layerId, s32 depth, DVECTOR *xy, CVECTOR *colors)
A Gouraud-shaded quad on a layer, blended.
void FIGHTSTG_drawQuad(s32 layerId, s32 depth, DVECTOR *xy, CVECTOR *colors)
A Gouraud-shaded quad on a layer.
void FIGHTSTG_projectPoint(Layer *layer, SVECTOR *pos, ShortVec3 *out)
Projects pos to the screen: its x and y, and its depth in the layer's ordering table.
void FIGHTSTG_cacheFighter(s32 index)
Loads entry index of the fighters file into FIGHTSTG_fighterCache: its id and kind,...
FaceRect * FIGHTSTG_getFighterFace(s32 id)
Fighter id's face parts (FaceRect), in the fighters file.
FighterInfo * FIGHTSTG_getFighterInfo(s32 id)
the match depends on reaching the cache through the symbol until a fighter is found,...
void FIGHTSTG_getFighterRange(u32 enemy, s32 *min, s32 *max)
The first and last entries of the fighters file that are enemies (enemy set) or partners.
TechData TECHS[443]
The techniques, from 1: technique n is TECHS[n - 1].
BattleEvent FIGHTSTG_newEvent
what FIGHTSTG_pushEvent is given
s32 FIGHTSTG_testWakeUp(u8 side, s32 value)
FIGHTSTG_battleFuncs.testWakeUp: whether a hit of value wakes side's fighter up, likelier the bigger ...
s32 FIGHTSTG_rollCounter(s32 side, s32 damage)
FIGHTSTG_battleFuncs.rollCounter: a random test, likelier the bigger damage is next to the player's f...
s32 FIGHTSTG_rollSleep(u8 side, s32 id)
Whether a hit puts the target to sleep, like rollPoison with the technique's chance (BATTLE_BLOCK_SLE...
s32 FIGHTSTG_rollNoSwitch(s32 actor, s32 id)
Whether TECH_EFFECT_NO_SWITCH works: the technique's chance.
s32 FIGHTSTG_rollMagicHit(u8 side, s32 id)
Whether a magic hit lands: the technique's accuracy with the wisdom and level differences; the player...
s32 FIGHTSTG_rollDrain(u8 side, s32 id)
Whether a hit drains HP: the technique's chance, or the accessory's for a technique without an effect...
s32 FIGHTSTG_rollNoDigivolve(s32 actor, s32 id)
Whether TECH_EFFECT_NO_DIGIVOLVE works: the technique's chance.
s32 FIGHTSTG_rollDedigivolve(s32 actor, s32 id)
Whether a technique turns the player's fighter back: never when it is one of the partners' own Digimo...
s32 FIGHTSTG_testParalysis(u8 side)
FIGHTSTG_battleFuncs.testParalysis: whether side's paralysis costs it the turn, a random test of its ...
s32 FIGHTSTG_rollSteal(u8 side, s32 id)
Whether the player steals the enemy's item: its itemChance in 1024 by the speed ratio (at most twice)...
s32 FIGHTSTG_rollHit(u8 side, s32 id)
Whether a physical hit lands: the technique's accuracy with the speed and level differences and the a...
s32 FIGHTSTG_rollParalysis(u8 side, s32 id)
Whether a hit paralyzes, like rollPoison (BATTLE_BLOCK_PARALYSIS keeps the player from it)
s32 FIGHTSTG_rollPoison(u8 side, s32 id)
The poison a hit inflicts, or 0: the technique's or the accessory's chance and an eighth of the user'...
s32 FIGHTSTG_testRunAway(u8 side)
FIGHTSTG_battleFuncs.testRunAway: a random test for side running away, from both sides' stats; the pl...
s32 FIGHTSTG_rollStatusRaise(s32 actor, s32 id)
Whether a status raise works: the technique's chance and an eighth of what the enemy's wisdom has ove...
s32 FIGHTSTG_testConfusion(u8 side)
FIGHTSTG_battleFuncs.testConfusion: a random test of side's confusion against its resists 9 and 3.
s32 FIGHTSTG_rollKnockOut(u8 side, s32 id)
Whether a hit knocks the target out, like rollPoison (BATTLE_BLOCK_KNOCK_OUT keeps the player from it...
s32 FIGHTSTG_rollConfusion(u8 side, s32 id)
Whether a hit confuses, like rollPoison (BATTLE_BLOCK_CONFUSION keeps the player from it)
void FIGHTSTG_countFrames(void)
How many frames the battle moves on this frame by its speed mode: as many as went by,...
void FIGHTSTG_setSpeed(s32 mode)
Sets the battle's speed mode and counts this frame again.
FIGHTSTG_action: the technique being carried out.
s32 type
EVENT_END_BATTLE...
One of the battle's fighters, three on each side (WFIGHTMN's BattleUnit): a partner's HP and MP go ba...
s16 boosts[4]
added to the stats FIGHTSTG_boostStats picks
s32 active[2]
each side's fighter
BattleFighter fighters[2][3]
u8 weakened
BATTLE_KIND_FINAL_LAST: the enemy is weakened (FIGHTSTG_weakenEnemy)
s16 stats[5]
by BATTLE_STAT_*, scaled by the enemy's strength / 16
FIGHTSTG_battle: the battle.
FIGHTSTG_fighterCache: the last fighter getInfo found, and the fighters' file's functions.
A queued event: its time counts down to when it runs.
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)
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...