16 for (i = 0; i < 2; i++) {
28 for (j = 0; j < 2; j++) {
37 if (hp != task->
hp[j].
to) {
70 if (windows[0] ==
NULL) {
77 if (windows[1] ==
NULL) {
84 for (i = 0; i < 2; i++) {
93 { { 0xAF, 0x25 }, { 0x12F, 0x25 }, { 0xAF, 0x2B }, { 0x12F, 0x2B } },
94 { { 0x0F, 0x25 }, { 0x8F, 0x25 }, { 0x0F, 0x2B }, { 0x8F, 0x2B } },
96#elif VERSION_EU || VERSION_JP
98 { { 0xAF, 0x25 }, { 0x12F, 0x25 }, { 0xAF, 0x2B }, { 0x12F, 0x2B } },
99 { { 0x8F, 0x25 }, { 0x0F, 0x25 }, { 0x8F, 0x2B }, { 0x0F, 0x2B } },
104 { 0x00, 0x71, 0x28, 0x00 },
105 { 0x00, 0xC8, 0x3E, 0x00 },
106 { 0xB3, 0x37, 0x16, 0x00 },
107 { 0xFF, 0x37, 0x0D, 0x00 },
111 { 0x109, 0x3E }, { 0x131, 0x3E }, { 0x109, 0x46 }, { 0x131, 0x46 },
114 { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
118 { 0x010F, 0x011A, 0x0125 },
119 { 0x0025, 0x001A, 0x000F },
141 drawer.
draw(sheet, 0, 8, 0xF);
142 drawer.
draw(sheet, 1, 0xA1, 0xF);
145 if (windows[4] ==
NULL) {
150 if (windows[3] ==
NULL) {
155 for (i = 0; i < 2; i++) {
158 if (task->
hp[i].
value > 0 && width < 4) {
161#if VERSION_EU || VERSION_JP
185 drawer.
draw(sheet, 0x1E, 0x104, 0x3D);
193 drawer.
draw(sheet, blink + 0x33, 0x109, 0x3E);
195 drawer.
draw(sheet, blink + 0x37, 0x109, 0x3E);
197 drawer.
draw(sheet, 0xB, 0x104, 0x3D);
198 for (side = 0; side < 2; side++) {
199 for (slot = 0; slot < 3; slot++) {
204 if (fighter->
id != 0) {
205 if (fighter->
flags != 0) {
207 }
else if (fighter->
hp == 0) {
210 frame = fighter->
hp != fighter->
maxHp;
230 switch (task->
state) {
245 for (i = 0; i < 2; i++) {
Battle FIGHTSTG_battle
the battle: its fighters, speed and drawing functions
#define BATTLE_KIND_FINAL
battle 0x144, the last one: its first enemy
#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_DIGIMON_NAMES
DIGNAM.
#define FILE_BATTLE_MENU
The battle menu's files (WFIGHTMN, WFIGHTTS): FILE_BATTLE_IMAGES is an archive whose entries go throu...
FileCache FILE_CACHE
The file cache.
DVECTOR FIGHTSTG_hpBars[2][4]
FIGHTSTG_drawHud's HP bars, one row per side; the European version swaps side 1's ends,...
void FIGHTSTG_stepHpTween(HpTween *tween)
Eases an HP number towards its target over its duration, along a sine.
CVECTOR FIGHTSTG_techGaugeColors[4]
CVECTOR FIGHTSTG_hpBarColors[4]
the bars' colours: above and at a quarter of the HP
void FIGHTSTG_updateHud(HpDisplay *task, TextWindow **windows)
The battle HUD's task: makes its windows and starts the HP numbers at the fighters' HP,...
void FIGHTSTG_drawHud(HpDisplay *task, TextWindow **windows)
Draws the battle HUD: both HP bars, the technique gauge (full at 1000) and the fighters' icons.
void FIGHTSTG_showFighterNames(HpDisplay *task, TextWindow **windows)
Shows the names of both sides' active fighters, when they changed.
void FIGHTSTG_updateHpTweens(HpDisplay *task, TextWindow **windows)
Every frame: the hp tween of a side whose active fighter changed jumps to that fighter's hp; every in...
DVECTOR FIGHTSTG_techGauge[4]
the technique gauge, and its colours
s16 FIGHTSTG_iconX[2][3]
the fighter icons' x, for each side and slot
HpDisplay * FIGHTSTG_createHud(void)
Creates the battle HUD (FIGHTSTG_updateHud)
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)
s16 gauges[8]
filled in battle, up to 1000
s32 active[2]
each side's fighter
BattleFighter fighters[2][3]
s16 kind
the kind of battle
s16 nameId
string in file 0x4F
void(* drawQuad)(s32 layerId, s32 depth, DVECTOR *xy, CVECTOR *colors)
void *(* getEntry)(u32 fileAndIndex)
s32(* getPartyMember)(u32 index)
Partner partners[PARTNER_COUNT]
s32(* getFrameTime)(void)
FIGHTSTG_createHud's task: the names and the hp of the fighters out.
s32 interval
how often the hp is checked
s32 shown[2]
the fighters the names are of
void(* nextState)(struct HpDisplay *task)
A number that eases from one value to another (FIGHTSTG_stepHpTween)
s16 fighter
whose hp it is
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(* draw)()
(sheet, frame, x, y)
void(* setTexture)()
(x, y)
A text window (createTextWindow): up to six text buffers (0 is shown, 1-5 are "work" buffers that con...
void(* setRightAlign)()
no prototype: callers would truncate u8 args
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)