|
Digimon World 3 decomp
The European version, SLES_039.36
|
WFIGHTMN.PRO: the battle's sub-overlay. More...
#include "battle/battle_mode.h"Go to the source code of this file.
Data Structures | |
| struct | BattleMenu |
| The battle menu (WFIGHTMN_start), registered as BATTLE_TASK_MENU. More... | |
| struct | BattleLoader |
| The task that loads the battle menu's files (WFIGHTMN_createLoader) More... | |
| struct | BattleMenuChildren |
| The battle menu's children. More... | |
| struct | EffectLook |
| A technique's look (TechData's script fields) by its effect, for WFIGHTMN_bringLastEnemy. More... | |
| struct | ElementLook |
| A technique's look by its element, for WFIGHTMN_bringLastEnemy. More... | |
| struct | ScriptLook |
| A battle script's look (BattleScript.effect and sound) More... | |
Macros | |
| #define | WFIGHTMN_RECOVERY_ITEM 0x140 |
| The item a partner can equip that makes FIGHTSTG's FIGHTSTG_queueRecovery act on it at the start of the battle. | |
Functions | |
| void | WFIGHTMN_loadFiles (BattleLoader *task) |
| Loads the battle menu's images into VRAM, one file a frame, then its other files, and ends. | |
| BattleLoader * | WFIGHTMN_createLoader (void) |
| Starts loading the battle menu's files. | |
| void | WFIGHTMN_createLayers (void) |
| setup.c | |
| void | WFIGHTMN_initFighters (s32 digimon) |
| Fills the battle's fighters: the party's partners (the first one with the id DIGIMON) and the encounter's enemies, with their battle table items. | |
| s32 | WFIGHTMN_rollAmbush (void) |
| Checks the chance in BATTLE_SETUP.ambushChance, scaled by how far the first partner's level and the first enemy's level are under 32. | |
| void | WFIGHTMN_checkParty (void) |
| Checks each of the party's three partners for WFIGHTMN_RECOVERY_ITEM (WFIGHTMN_checkEquip) | |
| void | WFIGHTMN_markFought (void) |
| Marks in BATTLE_RESULT that the current partner fought, and with which of its slots' Digimon if it isn't in its own form. | |
| void | WFIGHTMN_markPicked (BattleMenu *task, BattleMenuChildren *children) |
| Records in BATTLE_RESULT that the partner of the player's turn fought, and which of its digivolution slots it fought as. | |
| void | WFIGHTMN_updateMenu (BattleMenu *task, BattleMenuChildren *children) |
| menu.c | |
| void | WFIGHTMN_cancelBlast (void) |
| Ends the current partner's temporary Digimon and the actions that go with it. | |
| void | WFIGHTMN_runTurn (BattleMenu *task) |
| The battle menu's main state: waits for FIGHTSTG's turn (FIGHTSTG_events.funcs.pop), then runs the state of the command it gets (WFIGHTMN_states) | |
| void | WFIGHTMN_runCommand (BattleMenu *task, BattleMenuChildren *children) |
| The states in WFIGHTMN_states. | |
| void | WFIGHTMN_digivolve (BattleMenu *task, BattleMenuChildren *children) |
| The state that changes the current partner's Digimon to the one picked (commands->digimon), then says so. | |
| void | WFIGHTMN_tag (BattleMenu *task, BattleMenuChildren *children) |
| Swaps the partner on the field for the one picked (children->commands): message 0x38, then the swap effect with current[0] set to the new partner's slot for it, then the switch itself and message 0x39. | |
| void | WFIGHTMN_pairTech (BattleMenu *task, BattleMenuChildren *children) |
| State 6, the pair technique (the player turn's action 6): the outgoing and incoming partners do commands->pairTech, then the incoming one tags in (state 5, past its message) while an enemy is left; otherwise the turn ends with the partner marked as fought. | |
| void | WFIGHTMN_endBattle (BattleMenu *task, BattleMenuChildren *children) |
| After a won battle, picks the enemy whose item the player may get; saves the partners' HP and MP, fades out and requests the next mode. | |
| void | WFIGHTMN_runAway (BattleMenu *task, BattleMenuChildren *children) |
| Asks FIGHTSTG (FIGHTSTG_battleFuncs.testRunAway) whether the current action's actor gets away; if so shows message 0x43 (a partner) or 0x5F (an enemy) and waits for the window to close, otherwise sets the event's time from getDelay. | |
| void | WFIGHTMN_endAutoRecover (BattleMenu *task, BattleMenuChildren *children) |
| Removes the current action's EVENT_RECOVERY event, unless the partner it is for has WFIGHTMN_RECOVERY_ITEM equipped. | |
| void | WFIGHTMN_recover (BattleMenu *task, BattleMenuChildren *children) |
| A fighter's recovery (EVENT_RECOVERY): unless its HP is full, plays technique 0xBD on it when it is the side's active fighter, shows message 0xA with the amount and adds it, up to the maximum. | |
| void | WFIGHTMN_clearField (BattleMenu *task, BattleMenuChildren *children) |
| EVENT_CLEAR_FIELD: shows message 0x6A and ends the element boost (FIGHTSTG_battle.state.boost.element) | |
| void | WFIGHTMN_takeDamage (BattleMenu *task, BattleMenuChildren *children) |
| Carries out the current action's damage (FIGHTSTG_battleFuncs.getDamage) on its unit. | |
| void | WFIGHTMN_cureStatus (BattleMenu *task, BattleMenuChildren *children) |
| States 13-15: end the current action's unit's paralysis, confusion or sleep. | |
| void | WFIGHTMN_endBoost (BattleMenu *task, BattleMenuChildren *children) |
| Clears the boost (BattleFighter.boosts) that the current action ends. | |
| void | WFIGHTMN_runConfusedCommand (BattleMenu *task, BattleMenuChildren *children) |
| A confused partner's turn (FIGHTER_CONFUSED): the player's turn at step 3, where only an attack does anything. | |
| void | WFIGHTMN_endRestriction (BattleMenu *task, BattleMenuChildren *children) |
| Clears the restriction that the current action ends (FIGHTER_NO_SWITCH or FIGHTER_NO_DIGIVOLVE) from its unit. | |
| void | WFIGHTMN_blast (BattleMenu *task, BattleMenuChildren *children) |
| Digivolves the current partner for the battle, to the Digimon its level reaches (DigimonData.blastForms), and heals it when the change ends. | |
| void | WFIGHTMN_endBlast (BattleMenu *task, BattleMenuChildren *children) |
| Turns the current partner back into the Digimon it was (prevId) | |
| void | WFIGHTMN_knockOut (BattleMenu *task, BattleMenuChildren *children) |
| EVENT_KNOCK_OUT (substate 0x15), a fighter's fall: case 0 takes its event off the queue, shows message 0x50 or 0x51 and clears its status (announceKnockOut); case 1 looks for the side's next fighter standing. | |
| void | WFIGHTMN_endSpecial (BattleMenu *task, BattleMenuChildren *children) |
| The end of the partner's special state (EVENT_SPECIAL_END): clears it and shows message 0x59. | |
| void | WFIGHTMN_digidevolve (BattleMenu *task, BattleMenuChildren *children) |
| EVENT_DIGIDEVOLVE: the partner goes back to its own form, its blast and its queued technique are dropped, and it comes in again with message 0x47. | |
| void | WFIGHTMN_showWon (BattleMenu *task, BattleMenuChildren *children) |
| Shows the won message (from WFIGHTMN_knockOut) for its time, then closes it. | |
| void | WFIGHTMN_bringLastEnemy (BattleMenu *task, BattleMenuChildren *children) |
| The enemy's third fighter comes in (BATTLE_KIND_FINAL_LAST), takes the first's place, and technique 440 is made from 443 with FIGHTSTG_battle.state.tech's effect (its look from WFIGHTMN_effectVisuals) and element (from WFIGHTMN_elementVisuals) before message 0x16 names it (?) | |
| void | WFIGHTMN_restoreEnemy (BattleMenu *task, BattleMenuChildren *children) |
| The end of the enemy's weakness (EVENT_WEAKNESS_END): its lowered stats come back and it takes its turn first. | |
| 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 is not 5 or 12 and it has an effect (not 0-1, 9-10 or 12) or an element; WFIGHTMN_bringLastEnemy makes technique 440 from it. | |
Variables | |
| RECT | WFIGHTMN_screen |
| The screen its layers cover. | |
| EffectLook | WFIGHTMN_effectVisuals [] |
| A technique's look (its scriptEffect and scriptSound) by its effect, for WFIGHTMN_bringLastEnemy; the list ends at the first -1, so the USA version's three entries after it are never read. | |
| ElementLook | WFIGHTMN_elementVisuals [] |
| A technique's look (its scriptEffect, scriptSound and scriptStage) by its element, for WFIGHTMN_bringLastEnemy when WFIGHTMN_effectVisuals gives none. | |
| ScriptLook | WFIGHTMN_actionEffects [] |
| WFIGHTMN_startTech's effects. | |
| void(* | WFIGHTMN_states [])(BattleMenu *task, BattleMenuChildren *children) |
| The battle menu's states, by its substate. | |
WFIGHTMN.PRO: the battle's sub-overlay.
FIGHTSTG loads it (file 0x1FA) at STAGE_VRAM for a normal battle, and WFIGHTTS in its place for the battle test.
Definition in file normal_battle.h.
| #define WFIGHTMN_RECOVERY_ITEM 0x140 |
The item a partner can equip that makes FIGHTSTG's FIGHTSTG_queueRecovery act on it at the start of the battle.
Definition at line 12 of file normal_battle.h.
| void WFIGHTMN_loadFiles | ( | BattleLoader * | task | ) |
Loads the battle menu's images into VRAM, one file a frame, then its other files, and ends.
< MFIGHT: WFIGHTMN's
< DIGNAM
< SKLNAM
< SKLINF
< ITMNAM
< ITMINF
< MFIGHT: WFIGHTMN's
< DIGNAM
< SKLNAM
< SKLINF
< ITMNAM
< ITMINF
Definition at line 10 of file loader.c.
Referenced by WFIGHTMN_createLoader().
| BattleLoader * WFIGHTMN_createLoader | ( | void | ) |
Starts loading the battle menu's files.
Definition at line 125 of file loader.c.
Referenced by WFIGHTMN_updateMenu().
| void WFIGHTMN_createLayers | ( | void | ) |
< the battle camera's and the lights'
< the models' wireframe copies, in a Digimon change
< the HUD, the menus and the messages
< the fades, the flashes and the sprite effects over all
Definition at line 7 of file setup.c.
Referenced by WFIGHTMN_updateMenu().
| void WFIGHTMN_initFighters | ( | s32 | digimon | ) |
Fills the battle's fighters: the party's partners (the first one with the id DIGIMON) and the encounter's enemies, with their battle table items.
Definition at line 20 of file setup.c.
Referenced by addFighters().
| s32 WFIGHTMN_rollAmbush | ( | void | ) |
Checks the chance in BATTLE_SETUP.ambushChance, scaled by how far the first partner's level and the first enemy's level are under 32.
Definition at line 60 of file setup.c.
Referenced by addFighters().
| void WFIGHTMN_checkParty | ( | void | ) |
Checks each of the party's three partners for WFIGHTMN_RECOVERY_ITEM (WFIGHTMN_checkEquip)
Definition at line 99 of file setup.c.
Referenced by WFIGHTMN_updateMenu().
| void WFIGHTMN_markFought | ( | void | ) |
Marks in BATTLE_RESULT that the current partner fought, and with which of its slots' Digimon if it isn't in its own form.
Definition at line 109 of file setup.c.
Referenced by WFIGHTMN_digivolve(), WFIGHTMN_tag(), and WFIGHTMN_updateMenu().
| void WFIGHTMN_markPicked | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
Records in BATTLE_RESULT that the partner of the player's turn fought, and which of its digivolution slots it fought as.
Definition at line 132 of file setup.c.
Referenced by WFIGHTMN_pairTech().
| void WFIGHTMN_updateMenu | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
menu.c
menu.c
< the battle camera's and the lights'
< the battle camera's and the lights'
Definition at line 124 of file menu.c.
Referenced by WFIGHTMN_start().
| void WFIGHTMN_cancelBlast | ( | void | ) |
Ends the current partner's temporary Digimon and the actions that go with it.
< a technique of the partner's, run as its command
Definition at line 211 of file menu.c.
Referenced by WFIGHTMN_digidevolve(), WFIGHTMN_digivolve(), WFIGHTMN_endBattle(), WFIGHTMN_endBlast(), and WFIGHTMN_tag().
| void WFIGHTMN_runTurn | ( | BattleMenu * | task | ) |
The battle menu's main state: waits for FIGHTSTG's turn (FIGHTSTG_events.funcs.pop), then runs the state of the command it gets (WFIGHTMN_states)
< FIGHTSTG_endBattle
< its second enemy
< its third enemy; winning plays the ending
< the damage of a poisoned fighter (FIGHTER_POISONED)
< 10-12: the end of FIGHTER_PARALYZED, FIGHTER_CONFUSED or FIGHTER_ASLEEP
< 10-12: the end of FIGHTER_PARALYZED, FIGHTER_CONFUSED or FIGHTER_ASLEEP
< 10-12: the end of FIGHTER_PARALYZED, FIGHTER_CONFUSED or FIGHTER_ASLEEP
< 13-15: the end of a boost, by the stat
< 13-15: the end of a boost, by the stat
< 13-15: the end of a boost, by the stat
< 16-17: the end of a restriction (FIGHTER_NO_SWITCH or FIGHTER_NO_DIGIVOLVE)
< 16-17: the end of a restriction (FIGHTER_NO_SWITCH or FIGHTER_NO_DIGIVOLVE)
< the partner's digivolution for the battle
< the end of the partner's special state
< the last battle's third enemy comes in
< the end of the enemy's weakness (BATTLE_KIND_FINAL_LAST)
Definition at line 1333 of file menu.c.
Referenced by WFIGHTMN_updateMenu().
| void WFIGHTMN_runCommand | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
| void WFIGHTMN_digivolve | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
| void WFIGHTMN_tag | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
| void WFIGHTMN_pairTech | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
State 6, the pair technique (the player turn's action 6): the outgoing and incoming partners do commands->pairTech, then the incoming one tags in (state 5, past its message) while an enemy is left; otherwise the turn ends with the partner marked as fought.
Definition at line 428 of file menu.c.
| void WFIGHTMN_endBattle | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
After a won battle, picks the enemy whose item the player may get; saves the partners' HP and MP, fades out and requests the next mode.
< a side ran away
< a side ran away
< its third enemy; winning plays the ending
< STFGTREP
< STDWTITL's title screen; its movies follow
Definition at line 456 of file menu.c.
| void WFIGHTMN_runAway | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
Asks FIGHTSTG (FIGHTSTG_battleFuncs.testRunAway) whether the current action's actor gets away; if so shows message 0x43 (a partner) or 0x5F (an enemy) and waits for the window to close, otherwise sets the event's time from getDelay.
< a side ran away
Definition at line 569 of file menu.c.
| void WFIGHTMN_endAutoRecover | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
| void WFIGHTMN_recover | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
| void WFIGHTMN_clearField | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
| void WFIGHTMN_takeDamage | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
| void WFIGHTMN_cureStatus | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
| void WFIGHTMN_endBoost | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
Clears the boost (BattleFighter.boosts) that the current action ends.
Definition at line 790 of file menu.c.
| void WFIGHTMN_runConfusedCommand | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
| void WFIGHTMN_endRestriction | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
| void WFIGHTMN_blast | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
Digivolves the current partner for the battle, to the Digimon its level reaches (DigimonData.blastForms), and heals it when the change ends.
< the fighters'
< 10-12: the end of FIGHTER_PARALYZED, FIGHTER_CONFUSED or FIGHTER_ASLEEP
Definition at line 865 of file menu.c.
| void WFIGHTMN_endBlast | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
| void WFIGHTMN_knockOut | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
EVENT_KNOCK_OUT (substate 0x15), a fighter's fall: case 0 takes its event off the queue, shows message 0x50 or 0x51 and clears its status (announceKnockOut); case 1 looks for the side's next fighter standing.
The player's side picks one (FIGHTSTG_setPlayerTurnStep(4)), the enemy's brings in the first; with none left the battle ends (endBattleOnKnockOut: 0x53 lost, 0x52 won). Case 5 brings in the enemy's second fighter in BATTLE_KIND_FINAL (bringSecondEnemy).
< battle 0x144, the last one: its first enemy
Definition at line 1064 of file menu.c.
| void WFIGHTMN_endSpecial | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
| void WFIGHTMN_digidevolve | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
| void WFIGHTMN_showWon | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
| void WFIGHTMN_bringLastEnemy | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
The enemy's third fighter comes in (BATTLE_KIND_FINAL_LAST), takes the first's place, and technique 440 is made from 443 with FIGHTSTG_battle.state.tech's effect (its look from WFIGHTMN_effectVisuals) and element (from WFIGHTMN_elementVisuals) before message 0x16 names it (?)
< its third enemy; winning plays the ending
< under it, the technique has none
< does nothing but for the enemy whose battle table entry lists it first
< the enemy's item
< under it, the technique has none
Definition at line 1230 of file menu.c.
| void WFIGHTMN_restoreEnemy | ( | BattleMenu * | task, |
| BattleMenuChildren * | children | ||
| ) |
In BATTLE_KIND_FINAL, keeps the partner's technique ID in FIGHTSTG_battle.state.tech when its script is not 5 or 12 and it has an effect (not 0-1, 9-10 or 12) or an element; WFIGHTMN_bringLastEnemy makes technique 440 from it.
< battle 0x144, the last one: its first enemy
Definition at line 11 of file techs.c.
Referenced by setTechIdleMotions().
|
extern |
The screen its layers cover.
Definition at line 6 of file wfightmn_2.c.
Referenced by WFIGHTMN_createLayers().
|
extern |
A technique's look (its scriptEffect and scriptSound) by its effect, for WFIGHTMN_bringLastEnemy; the list ends at the first -1, so the USA version's three entries after it are never read.
Definition at line 24 of file wfightmn_2.c.
Referenced by WFIGHTMN_bringLastEnemy().
|
extern |
A technique's look (its scriptEffect, scriptSound and scriptStage) by its element, for WFIGHTMN_bringLastEnemy when WFIGHTMN_effectVisuals gives none.
Definition at line 37 of file wfightmn_2.c.
Referenced by WFIGHTMN_bringLastEnemy().
|
extern |
WFIGHTMN_startTech's effects.
WFIGHTMN_startTech's effects.
Definition at line 58 of file wfightmn_2.c.
Referenced by choosePartnerScript().
|
extern |
The battle menu's states, by its substate.
Definition at line 47 of file wfightmn_2.c.
Referenced by WFIGHTMN_runTurn().