Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
normal_battle.h
Go to the documentation of this file.
1#ifndef WFIGHTMN_H
2#define WFIGHTMN_H
3
4/* WFIGHTMN.PRO: the battle's sub-overlay. FIGHTSTG loads it (file 0x1FA)
5 at STAGE_VRAM for a normal battle, and WFIGHTTS in its place for the
6 battle test. */
7
9
10/* The item a partner can equip that makes FIGHTSTG's FIGHTSTG_queueRecovery act on
11 it at the start of the battle */
12#define WFIGHTMN_RECOVERY_ITEM 0x140
13
14/* The battle menu (WFIGHTMN_start), registered as BATTLE_TASK_MENU */
15typedef struct BattleMenu {
17 /* 0x50 */ s32 args[8]; /* the message's arguments, or a BattleEvent to push first */
18 /* 0x70 */ s32 confusionSound;
20
21/* The task that loads the battle menu's files (WFIGHTMN_createLoader) */
22typedef struct BattleLoader {
24 /* 0x50 */ s32 pad; /* never read or written: createTask allocates 0x54 bytes */
26
27/* The battle menu's children */
28typedef struct BattleMenuChildren {
29 /* 0x00 */ BattleLoader *loader;
30 /* 0x04 */ PlayerTurn *commands; /* the player's turn (FIGHTSTG_startPlayerTurn) */
31 /* 0x08 */ BattleCamera *camera; /* FIGHTSTG_createBattleCamera */
32 /* 0x0C */ Lights *lights;
33 /* 0x10 */ FightStage *stage;
34 /* 0x14 */ Models *models;
35 /* 0x18 */ BattleChild cameraMove; /* the European version's shots, or the turn when the player loses */
36 /* 0x1C */ BattleChild task; /* what the state waits for, NULL when done */
38
39/* The screen its layers cover */
40extern RECT WFIGHTMN_screen;
41/* A technique's look (TechData's script fields) by its effect, for
42 WFIGHTMN_bringLastEnemy */
43typedef struct EffectLook {
44 /* 0x0 */ s32 effect; /* TechData.effect, -1 ends the list */
45 /* 0x4 */ s32 scriptEffect;
46 /* 0x8 */ s32 scriptSound;
48/* A technique's look by its element, for WFIGHTMN_bringLastEnemy */
49typedef struct ElementLook {
50 /* 0x0 */ s32 element; /* TechData.element */
51 /* 0x4 */ s32 scriptEffect;
52 /* 0x8 */ s32 scriptSound;
53 /* 0xC */ s32 scriptStage;
55/* A battle script's look (BattleScript.effect and sound) */
56typedef struct ScriptLook {
57 /* 0x0 */ s32 effect;
58 /* 0x4 */ s32 sound;
62/* WFIGHTMN_startTech's effects */
64/* The battle menu's states, by its substate */
65extern void (*WFIGHTMN_states[])(BattleMenu *task, BattleMenuChildren *children);
66
69
70/* setup.c */
71void WFIGHTMN_createLayers(void);
72void WFIGHTMN_initFighters(s32 digimon);
74void WFIGHTMN_checkParty(void);
75void WFIGHTMN_markFought(void);
77
78/* menu.c */
80void WFIGHTMN_cancelBlast(void);
82/* The states in WFIGHTMN_states */
85void WFIGHTMN_tag(BattleMenu *task, BattleMenuChildren *children);
97void WFIGHTMN_blast(BattleMenu *task, BattleMenuChildren *children);
102void WFIGHTMN_showWon(BattleMenu *task, BattleMenuChildren *children);
105void WFIGHTMN_recordTech(u8 side, s32 id);
106
107#endif /* WFIGHTMN_H */
FIGHTSTG.PRO: the battle.
signed int s32
Definition common.h:11
unsigned char u8
Definition common.h:8
#define TASK_HEADER(Type)
Definition task.h:39
ElementLook WFIGHTMN_elementVisuals[]
A technique's look (its scriptEffect, scriptSound and scriptStage) by its element,...
Definition wfightmn_2.c:37
void WFIGHTMN_endSpecial(BattleMenu *task, BattleMenuChildren *children)
The end of the partner's special state (EVENT_SPECIAL_END): clears it and shows message 0x59.
Definition menu.c:1150
void WFIGHTMN_createLayers(void)
setup.c
Definition setup.c:7
void WFIGHTMN_blast(BattleMenu *task, BattleMenuChildren *children)
Digivolves the current partner for the battle, to the Digimon its level reaches (DigimonData....
Definition menu.c:865
void WFIGHTMN_clearField(BattleMenu *task, BattleMenuChildren *children)
EVENT_CLEAR_FIELD: shows message 0x6A and ends the element boost (FIGHTSTG_battle....
Definition menu.c:681
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 t...
Definition menu.c:637
void WFIGHTMN_runCommand(BattleMenu *task, BattleMenuChildren *children)
The states in WFIGHTMN_states.
Definition menu.c:233
void WFIGHTMN_tag(BattleMenu *task, BattleMenuChildren *children)
Swaps the partner on the field for the one picked (children->commands): message 0x38,...
Definition menu.c:350
void WFIGHTMN_runAway(BattleMenu *task, BattleMenuChildren *children)
Asks FIGHTSTG (FIGHTSTG_battleFuncs.testRunAway) whether the current action's actor gets away; if so ...
Definition menu.c:569
void WFIGHTMN_bringLastEnemy(BattleMenu *task, BattleMenuChildren *children)
The enemy's third fighter comes in (BATTLE_KIND_FINAL_LAST), takes the first's place,...
Definition menu.c:1230
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 tu...
Definition menu.c:1315
EffectLook WFIGHTMN_effectVisuals[]
A technique's look (its scriptEffect and scriptSound) by its effect, for WFIGHTMN_bringLastEnemy; the...
Definition wfightmn_2.c:24
void WFIGHTMN_digivolve(BattleMenu *task, BattleMenuChildren *children)
The state that changes the current partner's Digimon to the one picked (commands->digimon),...
Definition menu.c:320
void WFIGHTMN_pairTech(BattleMenu *task, BattleMenuChildren *children)
State 6, the pair technique (the player turn's action 6): the outgoing and incoming partners do comma...
Definition menu.c:428
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 ...
Definition techs.c:11
s32 WFIGHTMN_rollAmbush(void)
Checks the chance in BATTLE_SETUP.ambushChance, scaled by how far the first partner's level and the f...
Definition setup.c:60
void WFIGHTMN_digidevolve(BattleMenu *task, BattleMenuChildren *children)
EVENT_DIGIDEVOLVE: the partner goes back to its own form, its blast and its queued technique are drop...
Definition menu.c:1166
void(* WFIGHTMN_states[])(BattleMenu *task, BattleMenuChildren *children)
The battle menu's states, by its substate.
Definition wfightmn_2.c:47
void WFIGHTMN_cancelBlast(void)
Ends the current partner's temporary Digimon and the actions that go with it.
Definition menu.c:211
void WFIGHTMN_endBlast(BattleMenu *task, BattleMenuChildren *children)
Turns the current partner back into the Digimon it was (prevId)
Definition menu.c:933
void WFIGHTMN_endRestriction(BattleMenu *task, BattleMenuChildren *children)
Clears the restriction that the current action ends (FIGHTER_NO_SWITCH or FIGHTER_NO_DIGIVOLVE) from ...
Definition menu.c:839
void WFIGHTMN_knockOut(BattleMenu *task, BattleMenuChildren *children)
EVENT_KNOCK_OUT (substate 0x15), a fighter's fall: case 0 takes its event off the queue,...
Definition menu.c:1064
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 ...
Definition menu.c:816
void WFIGHTMN_markFought(void)
Marks in BATTLE_RESULT that the current partner fought, and with which of its slots' Digimon if it is...
Definition setup.c:109
RECT WFIGHTMN_screen
The screen its layers cover.
Definition wfightmn_2.c:6
void WFIGHTMN_updateMenu(BattleMenu *task, BattleMenuChildren *children)
menu.c
Definition menu.c:124
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,...
Definition menu.c:456
void WFIGHTMN_endAutoRecover(BattleMenu *task, BattleMenuChildren *children)
Removes the current action's EVENT_RECOVERY event, unless the partner it is for has WFIGHTMN_RECOVERY...
Definition menu.c:606
void WFIGHTMN_endBoost(BattleMenu *task, BattleMenuChildren *children)
Clears the boost (BattleFighter.boosts) that the current action ends.
Definition menu.c:790
void WFIGHTMN_runTurn(BattleMenu *task)
The battle menu's main state: waits for FIGHTSTG's turn (FIGHTSTG_events.funcs.pop),...
Definition menu.c:1333
void WFIGHTMN_takeDamage(BattleMenu *task, BattleMenuChildren *children)
Carries out the current action's damage (FIGHTSTG_battleFuncs.getDamage) on its unit.
Definition menu.c:692
BattleLoader * WFIGHTMN_createLoader(void)
Starts loading the battle menu's files.
Definition loader.c:125
void WFIGHTMN_cureStatus(BattleMenu *task, BattleMenuChildren *children)
States 13-15: end the current action's unit's paralysis, confusion or sleep.
Definition menu.c:754
void WFIGHTMN_loadFiles(BattleLoader *task)
Loads the battle menu's images into VRAM, one file a frame, then its other files, and ends.
Definition loader.c:10
void WFIGHTMN_showWon(BattleMenu *task, BattleMenuChildren *children)
Shows the won message (from WFIGHTMN_knockOut) for its time, then closes it.
Definition menu.c:1204
ScriptLook WFIGHTMN_actionEffects[]
WFIGHTMN_startTech's effects.
Definition wfightmn_2.c:58
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 ...
Definition setup.c:132
void WFIGHTMN_initFighters(s32 digimon)
Fills the battle's fighters: the party's partners (the first one with the id DIGIMON) and the encount...
Definition setup.c:20
void WFIGHTMN_checkParty(void)
Checks each of the party's three partners for WFIGHTMN_RECOVERY_ITEM (WFIGHTMN_checkEquip)
Definition setup.c:99
The battle camera (FIGHTSTG_createBattleCamera), registered as BATTLE_TASK_CAMERA on a layer: set put...
Definition camera.h:66
The task that loads the battle menu's files (WFIGHTMN_createLoader)
s32 pad
never read or written: createTask allocates 0x54 bytes
The battle menu's children.
BattleCamera * camera
FIGHTSTG_createBattleCamera.
BattleLoader * loader
FightStage * stage
BattleChild task
what the state waits for, NULL when done
BattleChild cameraMove
the European version's shots, or the turn when the player loses
PlayerTurn * commands
the player's turn (FIGHTSTG_startPlayerTurn)
The battle menu (WFIGHTMN_start), registered as BATTLE_TASK_MENU.
s32 args[8]
the message's arguments, or a BattleEvent to push first
A technique's look (TechData's script fields) by its effect, for WFIGHTMN_bringLastEnemy.
s32 effect
TechData.effect, -1 ends the list.
A technique's look by its element, for WFIGHTMN_bringLastEnemy.
s32 element
TechData.element.
The fight stage (FIGHTSTG_createStage), registered as BATTLE_TASK_STAGE: its model,...
Definition stage.h:38
The stage lights (FIGHTSTG_createLights), registered as BATTLE_TASK_LIGHTS: set puts a light set,...
Definition stage.h:59
The fighters' models (FIGHTSTG_createModels), registered as BATTLE_TASK_MODELS: up to four,...
Definition model.h:284
The player's turn (FIGHTSTG_updatePlayerTurn, BATTLE_TASK_PLAYER_TURN): the battle menu,...
Definition menu.h:32
A battle script's look (BattleScript.effect and sound)
A turn's or a counterattack's one child, and what WFIGHTMN's battle menu waits for (NULL when it is d...
Definition task.h:16