27 drawer.
draw(sheet, 0x31, 0xB, 0xBC);
79 switch (task->
state) {
119 switch (filter->
type) {
122 for (i = 0; i < 3; i++) {
123 if (fighters[i].
id != 0 && fighters[i].hp != 0 && fighters[i].hp < fighters[i].maxHp) {
129 for (i = 0; i < 3; i++) {
130 if (fighters[i].
id != 0 && fighters[i].hp != 0 && (fighters[i].flags &
FIGHTER_POISONED)) {
136 for (i = 0; i < 3; i++) {
137 if (fighters[i].
id != 0 && fighters[i].hp != 0 && (fighters[i].flags &
FIGHTER_PARALYZED)) {
143 for (i = 0; i < 3; i++) {
144 if (fighters[i].
id != 0 && fighters[i].hp != 0 && (fighters[i].flags &
FIGHTER_CONFUSED)) {
150 for (i = 0; i < 3; i++) {
151 if (fighters[i].
id != 0 && fighters[i].hp != 0 && fighters[i].flags != 0) {
157 for (i = 0; i < 3; i++) {
158 if (fighters[i].
id != 0 && fighters[i].hp == 0) {
164 for (i = 0; i < 3; i++) {
165 if (fighters[i].
id != 0) {
173 for (i = 0; i < 3; i++) {
174 if (fighters[i].
id != 0 && fighters[i].hp != 0) {
207 if (fighter->
id != 0) {
333 task->
queue[2] = data[0];
334 task->
queue[3] = data[1];
335 task->
queue[4] = data[2];
376 total = data[1] * data[2];
409 task->
queue[2] = (data[0] == 0) << 4;
410 task->
queue[3] = data[1];
Battle FIGHTSTG_battle
the battle: its fighters, speed and drawing functions
#define FIGHTER_PARALYZED
loses turns at random (FIGHTSTG_battleFuncs.testParalysis)
#define FIGHTER_POISONED
BattleFighter.flags: the statuses, which the techniques give (FIGHTSTG_inflict*) and events of type E...
#define BATTLE_LAYER_MENUS
the HUD, the menus and the messages
FIGHTSTG.PRO: the battle.
BattleTableEntry *(* FIGHTSTG_battleTableFunc)(s32 id)
how the fight stage and WFIGHTMN read the battle table
GfxState GFX
GFX: the graphics state and its methods.
GameState GAME
The save data, the game mode and the methods.
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
#define TEXT_BATTLE_MENU
MFIGHT: WFIGHTMN's.
#define TEXT_SKILL_NAMES
SKLNAM.
#define TEXT_DIGIMON_NAMES
DIGNAM.
#define FILE_BATTLE_MENU
The battle menu's files (WFIGHTMN, WFIGHTTS): FILE_BATTLE_IMAGES is an archive whose entries go throu...
#define TEXT_ITEM_NAMES
ITMNAM.
#define FILE_MENU_SPRITES
Files the engine loads by number.
FileCache FILE_CACHE
The file cache.
void FIGHTSTG_drawMessageBox(BattleMessageBox *task)
Draws the message box and, once its lines are out, its blinking arrow.
BattleMessageBox * FIGHTSTG_createMessage(void)
Creates a battle message box (FIGHTSTG_updateMessage)
void FIGHTSTG_showFightersMessage(BattleMessageBox *task, BattleMessageBoxWindows *w, BattleMessage *msg)
Sets up a message about the fighters FIGHTSTG_findFighters found: their names (text 0x15 plus their c...
void FIGHTSTG_showMessage(BattleMessageBox *task, s32 type, s32 *data)
The message box's show: sets up the lines of message type from data, mostly a fighter's name with a t...
void FIGHTSTG_setMessageName(BattleMessageBox *task, BattleMessageBoxWindows *w, s32 side, s32 index)
Puts the name of side's fighter index (a partner's own, an enemy's from the battle table) into the me...
void FIGHTSTG_updateMessage(BattleMessageBox *task, void *children)
The battle message box's task: draws it and steps its message each frame.
void FIGHTSTG_findFighters(BattleMessageBox *task, FighterFilter *filter)
Lists in task's found the fighters of filter's side that its type picks: 0 the hurt,...
void FIGHTSTG_stepMessage(BattleMessageBox *task, BattleMessageBoxWindows *windows)
Shows the message's lines one by one, 3 frames apart, then on cross shows the queue's next message or...
void FIGHTSTG_finishMessage(BattleMessageBox *task)
The message box's finish: closes it after 0x14 frames or on cross.
PadState PAD
Controller input: cleared by initPad, then the methods.
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
#define SOUND_MENU_CONFIRM
SYSTEM07.
void initSpriteDrawer(SpriteDrawer *obj)
Clears a sprite drawer to neutral (no scale, gray tint, follows the scroll), gives it its methods and...
One of the battle's fighters, three on each side (WFIGHTMN's BattleUnit): a partner's HP and MP go ba...
s16 id
the Digimon (DIGIMON_DATA)
FIGHTSTG_updateMessage's children: the lines it shows one by one.
A battle message box (FIGHTSTG_createMessage): shows its messages a line at a time,...
s32 arrowTime
when it last changed
s32 interval
the time between them
void(* nextState)(struct BattleMessageBox *task)
s32 shown
the window being shown
void(* setSubstate)(struct BattleMessageBox *task, s32 substate)
void(* finish)(struct BattleMessageBox *task)
FIGHTSTG_finishMessage: closes after 0x14 ticks or Cross.
s32 arrowPalette
the arrow's palette, 0-4
s32 found[3]
the fighters FIGHTSTG_findFighters found
s32 showArrow
show the arrow
void(* show)()
FIGHTSTG_showMessage: (task, type, data)
s32 queue[9]
message types for show, some with args after them; 0 ends them
What FIGHTSTG_updateMessage's messages say, for some of their types.
s32 active[2]
each side's fighter
BattleFighter fighters[2][3]
s16 nameId
string in file 0x4F
Which fighters FIGHTSTG_findFighters looks for.
void *(* getEntry)(u32 fileAndIndex)
struct PartnerStats *(* getPartnerStats)(s32 partner)
s32(* getPartyMember)(u32 index)
s32(* getPressed)(s32 pad)
short(* playSound)(s32 id)
returns the voice of a key-on
Draws sprites from a sprite sheet (such as file 0x277, the menu graphics): a sheet has a table of fra...
void(* setLayerId)()
(id, depth)
void(* setClutRow)()
(row)
void(* draw)()
(sheet, frame, x, y)
void(* setTexture)()
(x, y)
void(* setVisible)(struct TextWindow *obj, u8 arg)
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
TextWindow * createTextWindow(s16 layerId, s16 style, s16 x, s16 y)
A text window on a layer, in a font style, at (x, y)