20 if (!(kind <= 1 || (kind >= 9 && kind <= 10) || kind == 12)) {
39 if (side != 0 && damage != 0 && unit->
hp != 0 && unit->
temporary == 0) {
59 for (i = 2; i < 13; i++) {
67 if (task->
index == 0) {
68 for (i = 0; i < 3; i++) {
76 if (task->
index == 0) {
161 info = &
TECHS[
id - 1];
168 if (task->
stage <= 0) {
185 for (i = 0; i < 3; i++) {
215 for (i = 0; i < 2; i++) {
217 task->
hits[i * 3] = 0;
219 task->
hits[i * 3] = 3;
291 if (unit->
hp - damage <= unit->maxHp / 4) {
322 s32 other = side == 0;
331 limit = unit->
maxHp / 11;
335 total = damage * hits;
336 if (unit->
hp > limit) {
337 if (unit->
hp - total < limit) {
338 damage = (unit->
hp - limit) / hits;
343 }
else if (unit->
hp > limit) {
344 if (unit->
hp - damage < limit) {
345 damage = unit->
hp - limit;
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...
BattleFuncs FIGHTSTG_battleFuncs
the battle's stats and the functions that compute with them
void FIGHTSTG_endEnemyWeakness(void)
Ends the enemy's weakness now: its queued event 24 runs next.
#define TECH_EFFECT_DOUBLE_MAGIC
two magic hits, as techniques 0x1B9 and 0x1BA
#define BATTLE_KIND_ESCAPE
the enemy runs away under a tenth of its HP
#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_MAGIC
FIGHTSTG_rollMagicHit and FIGHTSTG_computeMagicDamage.
#define BATTLE_KIND_UNK2
the enemy keeps an eleventh of its HP
#define TECH_EFFECT_KNOCK_OUT
#define BATTLE_KIND_NO_DAMAGE
the partner's hits do no damage
#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 TECH_PHYSICAL
TechData.icon's kinds of attack.
#define BATTLE_KIND_FINAL
battle 0x144, the last one: its first enemy
#define BATTLE_KIND_FINAL_LAST
its third enemy; winning plays the ending
#define ELEMENT_FIRST
The elements (TechData.element, BattleStats.element) and the families (TechData.family,...
#define BATTLE_TASK_MENU
The ids that the battle's tasks register with, for the others to find them (TASK_REGISTRY....
BattleScript * FIGHTSTG_createBattleScript(void)
Creates a battle script, which plays a technique (FIGHTSTG_updateBattleScript)
GameState GAME
The save data, the game mode and the methods.
TechData TECHS[443]
The techniques, from 1: technique n is TECHS[n - 1].
WFIGHTMN.PRO: the battle's sub-overlay.
TaskRegistry TASK_REGISTRY
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 temporary
id is a temporary Digimon
s32(* getGaugeGain)(s32 damage)
from the partner's damage, up to 1000
s32(* computeHeal)(u8 side, s32 id)
BattleStats *(* computeStats)(u8 side, s32 which, s32 index)
A fighter's battle script (FIGHTSTG_updateBattleScript): a list of s16 commands in an archive entry o...
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
s16 gauges[8]
filled in battle, up to 1000
s8 hitCount
BATTLE_KIND_FINAL_LAST: the partner's hits that did damage.
s32 active[2]
each side's fighter
BattleFighter fighters[2][3]
s16 kind
the kind of battle
u8 weakened
BATTLE_KIND_FINAL_LAST: the enemy is weakened (FIGHTSTG_weakenEnemy)
s16 tech
a technique id, set by WFIGHTMN
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
u8 element
the accessory's, for techniques without one
s32(* getPartyMember)(u32 index)
void(* setIdleMotion)(struct Models *task, s32 id, s32 motion)
void *(* find)(s32 id, s32 key1, s32 key2)
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 effect
TECH_EFFECT_* (fightstg/battle.h), under TECH_EFFECT_FIRST none.
u8 family
FAMILY_FIRST and up, under it none.
u8 element
ELEMENT_FIRST and up, under it none.
u8 icon
a frame of the menu sprites, from 0x37
u8 scriptStage
its script's stage (BattleScript.stage)
u8 script
its script in the user's archive (BattleScript.index); 5 and 12 are special
static s32 getHealDamage(u8 actor, s32 id)
Returns what a technique that does not attack heals, as negative damage.
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...
static void chooseEnemyScript(BattleScript *task, TechData *info, BattleStats *other)
Gives the enemy's technique its own script, and its stage effect when it has an element or the target...
static void choosePartnerScript(BattleScript *task, TechData *info, BattleStats *own, BattleStats *other)
Picks the script of the partner's technique: 8 with the triple hit, 6 with an action effect or a weap...
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_recordTech(u8 side, s32 id)
In BATTLE_KIND_FINAL, keeps the partner's technique ID in FIGHTSTG_battle.state.tech when its script ...
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.
static void setTechIdleMotions(TechData *info, u8 actor, s32 id, s32 damage)
Sets the fighters' idle motions for the damage a technique does; an attack also counts for the final ...
void WFIGHTMN_endWeakness(u8 side)
In BATTLE_KIND_FINAL_LAST, anything the partner does but an attack ends the enemy's weakness (FIGHTST...
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...
ScriptLook WFIGHTMN_actionEffects[]
WFIGHTMN_startTech's effects (BattleScript.effect and sound) by the first of FIGHTSTG_action....