Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
digivolve_panel.c
Go to the documentation of this file.
1/* The fourth object of STSTATUS.PRO (see card_screen.c), the fifth screen's
2 panel of STSTATUS_createDigivolvePanel: its rodata starts at 0x800827A0 (USA). */
3
4#include "menus/field_menu.h"
5
6/* Creates the digivolution panel's windows: the three slots, the question about
7 a slot, the entry's techniques and stats, the help and the MP cost */
9 WindowPos *layout;
10 WindowPos *pos;
11 s32 i;
12
13 for (i = 0; i < 3; i++) {
14 windows->slots[i] = createTextWindow(panel->layer, 1, 0xBD, i * 14 + 0x31);
15 }
16 windows->slotCursor = createCursor(panel->layer, panel->depth - 1, 0xB0, panel->slot * 14 + 0x31);
17 windows->slotCursor->setVisible(windows->slotCursor, 0);
18 windows->partnerName = createTextWindow(panel->layer, 1, 0x5E, 0x4D);
19 windows->choiceTitle = createTextWindow(panel->layer, 1, 0xB2, 0x2A);
20 for (i = 0; i < 2; i++) {
21 windows->options[i] = createTextWindow(panel->layer, 1, 0xBD, i * 14 + 0x3A);
22 }
23 windows->optionCursor = createCursor(panel->layer, panel->depth - 1, 0xB4, panel->option * 14 + 0x3A);
24 windows->optionCursor->setVisible(windows->optionCursor, 0);
25 windows->entryName = createTextWindow(panel->layer, 1, 0x4F, 0x68);
26 windows->skillLabel = createTextWindow(panel->layer, 1, 0xEB, 0x68);
27 windows->skillLevel = createTextWindow(panel->layer, 1, 0x12F, 0x68);
28 for (i = 0; i < 6; i++) {
29 windows->list[i] = createTextWindow(panel->layer, 1, 0x71, i * 14 + 0x7C);
30 }
31 for (i = 0; i < 7; i++) {
32 windows->list[i + 6] = createTextWindow(panel->layer, 1, 0x9B, i * 14 + 0x7C);
33 }
34 for (i = 0; i < 6; i++) {
35 windows->values[i] = createTextWindow(panel->layer, 1, 0xC4, i * 14 + 0x88);
36 }
37 windows->listCursor = createCursor(panel->layer, panel->depth - 1, 0xA9, 0x88);
38 windows->listCursor->setVisible(windows->listCursor, 0);
39 windows->title = createTextWindow(panel->layer, 1, 0x98, 0x13);
40 layout = STSTATUS_data.layout;
41 pos = &layout[12];
42 windows->help = createTextWindow(panel->layer, 1, pos->x, pos->y);
43 pos = &layout[13];
44 windows->mpLabel = createTextWindow(panel->layer, 1, pos->x, pos->y);
45 pos = &layout[14];
46 windows->mp = createTextWindow(panel->layer, 1, pos->x, pos->y);
47}
48
49/* The Digimon in the partner's three slots, the one it is highlighted, and
50 the partner's own name */
52 Partner *partner;
53 DigimonData *data;
54 s32 id;
55 s32 i;
56
57 if (show) {
58 id = GAME.funcs.getPartyMember(panel->member);
59 partner = &GAME.partners[id];
60 for (i = 0; i < 3; i++) {
61 if (panel->slots[i] > 0) {
62 data = GET_DIGIMON(panel->slots[i]);
63 windows->slots[i]->setString(windows->slots[i], FILE_CACHE.load(TEXT_FILE(TEXT_DIGIMON_NAMES)), data->nameId);
64 if (partner->battleDigivolve == panel->slots[i]) {
65 windows->slots[i]->setPalette(windows->slots[i], PALETTE_BLUE);
66 } else {
67 windows->slots[i]->setPalette(windows->slots[i], PALETTE_WHITE);
68 }
69 } else {
70 windows->slots[i]->setVisible(windows->slots[i], 0);
71 }
72 }
73 data = &DIGIMON_DATA[id];
75 } else {
76 for (i = 0; i < 3; i++) {
77 windows->slots[i]->setVisible(windows->slots[i], 0);
78 }
79 windows->partnerName->setVisible(windows->partnerName, 0);
80 }
81}
82
83/* Shows or hides the question about the chosen slot: its Digimon's name, then
84 to start battles as it (or to stop, when it already does) or its techniques */
86 Partner *partner;
87 DigimonData *data;
88 s32 i;
89
90 if (show) {
91 partner = &GAME.partners[GAME.funcs.getPartyMember(panel->member)];
92 data = GET_DIGIMON(panel->slots[panel->slot]);
94 if (partner->battleDigivolve == panel->slots[panel->slot]) {
95 windows->options[0]->setString(windows->options[0], FILE_CACHE.load(TEXT_FILE(TEXT_STATUS)), 0x3A);
96 } else {
97 windows->options[0]->setString(windows->options[0], FILE_CACHE.load(TEXT_FILE(TEXT_STATUS)), 0x39);
98 }
99 windows->options[1]->setString(windows->options[1], FILE_CACHE.load(TEXT_FILE(TEXT_STATUS)), 0x3B);
100 } else {
101 windows->choiceTitle->setVisible(windows->choiceTitle, 0);
102 for (i = 0; i < 2; i++) {
103 windows->options[i]->setVisible(windows->options[i], 0);
104 }
105 }
106}
107
108/* The stats and techniques of the slot's entry (or of the partner itself),
109 or hides them */
111 PartnerTotals totals;
112 PartnerEntry entry;
113 DigimonData *data;
114 s32 id;
115 s32 slot;
116 s32 value;
117 s32 tech;
118 s32 i;
119
120 if (show) {
121 id = GAME.funcs.getPartyMember(panel->member);
122 if (panel->fromEntry) {
123 slot = panel->slots[panel->slot];
124 GAME.funcs.getPartnerEntry(id, slot, &entry);
125 GAME.funcs.computeStats(id, &totals);
126 data = GET_DIGIMON(slot);
129 windows->skillLevel->setNumber(windows->skillLevel, 0, entry.level);
130 windows->skillLevel->setRightAlign(windows->skillLevel, 1);
131 for (i = 0; i < 6; i++) {
132 value = totals.stats[STSTATUS_panelStats[i]] + data->battleStats[i];
133 if (value >= 1000) {
134 value = 999;
135 }
136 windows->list[i]->setNumber(windows->list[i], 0, value);
137 if (i == 0) {
138 if (totals.fields.lowered[0]) {
139 windows->list[0]->setPalette(windows->list[0], PALETTE_PURPLE);
140 }
141 } else if (i == 1) {
142 if (totals.fields.lowered[1]) {
143 windows->list[1]->setPalette(windows->list[1], PALETTE_PURPLE);
144 }
145 } else if (i == 4 && totals.fields.lowered[2]) {
146 windows->list[4]->setPalette(windows->list[4], PALETTE_PURPLE);
147 }
148 }
149 for (i = 0; i < 7; i++) {
150 value = totals.stats[STSTATUS_panelStats[i + 6]] + data->resistances[i];
151 if (value >= 1000) {
152 value = 999;
153 }
154 windows->list[i + 6]->setNumber(windows->list[i + 6], 0, value);
155 }
156 for (i = 0; i < 13; i++) {
157 windows->list[i]->setRightAlign(windows->list[i], 1);
158 }
159 for (i = 0; i < 6; i++) {
160 tech = entry.skills[i];
161 if (tech != 0) {
162 windows->values[i]->setString(windows->values[i], FILE_CACHE.load(TEXT_FILE(TEXT_SKILL_NAMES)), tech & SKILL_ID);
163 if (tech & SKILL_LAST) {
164 windows->values[i]->setPalette(windows->values[i], PALETTE_YELLOW);
165 } else if (tech & SKILL_MARKED) {
166 windows->values[i]->setPalette(windows->values[i], PALETTE_GREEN);
167 } else {
168 windows->values[i]->setPalette(windows->values[i], PALETTE_WHITE);
169 }
170 } else {
171 windows->values[i]->setVisible(windows->values[i], 0);
172 }
173 }
174 } else {
175 data = &DIGIMON_DATA[id];
176 GAME.funcs.computeStats(id, &totals);
180 windows->skillLevel->setRightAlign(windows->skillLevel, 1);
181 for (i = 0; i < 6; i++) {
182 value = totals.stats[STSTATUS_panelStats[i]];
183 if (value >= 1000) {
184 value = 999;
185 }
186 windows->list[i]->setNumber(windows->list[i], 0, value);
187 if (i == 0) {
188 if (totals.fields.lowered[0]) {
189 windows->list[0]->setPalette(windows->list[0], PALETTE_PURPLE);
190 }
191 } else if (i == 1) {
192 if (totals.fields.lowered[1]) {
193 windows->list[1]->setPalette(windows->list[1], PALETTE_PURPLE);
194 }
195 } else if (i == 4 && totals.fields.lowered[2]) {
196 windows->list[4]->setPalette(windows->list[4], PALETTE_PURPLE);
197 }
198 }
199 for (i = 0; i < 7; i++) {
200 value = totals.stats[STSTATUS_panelStats[i + 6]];
201 if (value >= 1000) {
202 value = 999;
203 }
204 windows->list[i + 6]->setNumber(windows->list[i + 6], 0, value);
205 }
206 for (i = 0; i < 13; i++) {
207 windows->list[i]->setRightAlign(windows->list[i], 1);
208 }
209 for (i = 0; i < 6; i++) {
210 if (data->skills[i + 1] != 0) {
211 windows->values[i]->setString(windows->values[i], FILE_CACHE.load(TEXT_FILE(TEXT_SKILL_NAMES)), data->skills[i + 1]);
212 windows->values[i]->setPalette(windows->values[i], PALETTE_YELLOW);
213 } else {
214 windows->values[i]->setVisible(windows->values[i], 0);
215 }
216 }
217 }
218 panel->listShown = 1;
219 } else {
220 windows->entryName->setVisible(windows->entryName, 0);
221 windows->skillLabel->setVisible(windows->skillLabel, 0);
222 windows->skillLevel->setVisible(windows->skillLevel, 0);
223 for (i = 0; i < 13; i++) {
224 windows->list[i]->setVisible(windows->list[i], 0);
225 }
226 for (i = 0; i < 6; i++) {
227 windows->values[i]->setVisible(windows->values[i], 0);
228 }
229 panel->listShown = 0;
230 }
231}
232
233/* Moves the list to the panel's scroll position */
235 s32 i;
236
237 /* the match depends on the (s16) casts in the loops: without them, the
238 0x7C and 0x88 go into i * 14's induction variable */
239 windows->entryName->setPos(windows->entryName, 0x4F, panel->scroll.value + 0x68);
240 windows->skillLabel->setPos(windows->skillLabel, 0xEB, panel->scroll.value + 0x68);
241 windows->skillLevel->setPos(windows->skillLevel, 0x12F, panel->scroll.value + 0x68);
242 for (i = 0; i < 6; i++) {
243 windows->list[i]->setPos(windows->list[i], 0x71, i * 14 + (s16)(panel->scroll.value + 0x7C));
244 }
245 for (i = 0; i < 7; i++) {
246 windows->list[i + 6]->setPos(windows->list[i + 6], 0x9B, i * 14 + (s16)(panel->scroll.value + 0x7C));
247 }
248 for (i = 0; i < 6; i++) {
249 windows->values[i]->setPos(windows->values[i], 0xC4, i * 14 + (s16)(panel->scroll.value + 0x88));
250 }
251}
252
253/* Shows the cost of the technique under the list's cursor */
255 PartnerEntry entry;
256 DigimonData *data;
257 s32 id;
258 s32 tech;
259
260 if (show) {
261 id = GAME.funcs.getPartyMember(panel->member);
262 if (panel->fromEntry) {
263 GAME.funcs.getPartnerEntry(id, panel->slots[panel->slot], &entry);
264 tech = entry.skills[panel->tech] & SKILL_ID;
265 if (tech > 0) {
266 windows->help->setString(windows->help, FILE_CACHE.load(TEXT_FILE(TEXT_SKILL_INFO)), tech);
267 windows->mpLabel->setString(windows->mpLabel, FILE_CACHE.load(TEXT_FILE(TEXT_STATUS)), 3);
268 windows->mp->setNumber(windows->mp, 0, TECHS[tech - 1].mp);
269 windows->mp->setRightAlign(windows->mp, 1);
270 return;
271 }
272 } else {
273 data = &DIGIMON_DATA[id];
274 tech = data->skills[panel->tech + 1];
275 if (tech > 0) {
276 windows->help->setString(windows->help, FILE_CACHE.load(TEXT_FILE(TEXT_SKILL_INFO)), tech);
277 windows->mpLabel->setString(windows->mpLabel, FILE_CACHE.load(TEXT_FILE(TEXT_STATUS)), 3);
278 windows->mp->setNumber(windows->mp, 0, TECHS[tech - 1].mp);
279 windows->mp->setRightAlign(windows->mp, 1);
280 return;
281 }
282 }
283 }
284 windows->help->setVisible(windows->help, 0);
285 windows->mpLabel->setVisible(windows->mpLabel, 0);
286 windows->mp->setVisible(windows->mp, 0);
287}
288
289/* Draws the panel's frames, the technique icons and the help arrow */
291 SpriteDrawer sprite;
292 PartnerEntry entry;
293 DigimonData *data;
294 s32 id;
295 s32 tech;
296 s32 i;
297
298 initSpriteDrawer(&sprite);
299 sprite.setLayerId(panel->layer, panel->depth);
300 sprite.setTexture(0x280, 0x100);
301 if (panel->fades[1].level != 0) {
302 if (panel->fades[1].level != ONE) {
303 sprite.setScale(panel->fades[1].level, ONE, ONE);
304 sprite.setPivot(0x140, 0x44);
305 }
306 sprite.draw(FILE_CACHE.getEntry(FILE_STATUS_SPRITES << 16), 0x24, 0xA8, 0x28);
307 }
308 if (panel->fades[2].level != 0) {
309 STRETCH_SPRITE(sprite, panel->fades[2].level, 0x140, 0x41);
310 sprite.draw(FILE_CACHE.getEntry(FILE_STATUS_SPRITES << 16), 0x26, 0xA8, 0x28);
311 }
312 if (panel->fades[3].level != 0) {
313 STRETCH_SPRITE(sprite, panel->fades[3].level, 0x140, 0xA2);
314 sprite.setTexture(0x140, 0);
315 sprite.draw(FILE_CACHE.getEntry(FILE_MENU_SPRITES << 16), 0x14, 0x4F, panel->scroll.value + 0x7C);
316 if (panel->listShown) {
317 id = GAME.funcs.getPartyMember(panel->member);
318 if (panel->fromEntry) {
319 GAME.funcs.getPartnerEntry(id, panel->slots[panel->slot], &entry);
320 for (i = 0; i < 6; i++) {
321 tech = entry.skills[i] & SKILL_ID;
322 if (tech != 0) {
323 sprite.draw(FILE_CACHE.getEntry(FILE_MENU_SPRITES << 16), TECHS[tech - 1].icon + 0x37, 0xB6,
324 panel->scroll.value + 0x88 + i * 14);
325 }
326 }
327 } else {
328 data = &DIGIMON_DATA[id];
329 for (i = 0; i < 6; i++) {
330 tech = data->skills[i + 1];
331 if (tech > 0) {
332 sprite.draw(FILE_CACHE.getEntry(FILE_MENU_SPRITES << 16), TECHS[tech - 1].icon + 0x37, 0xB6,
333 panel->scroll.value + 0x88 + i * 14);
334 }
335 }
336 }
337 }
338 sprite.setTexture(0x280, 0x100);
339 sprite.draw(FILE_CACHE.getEntry(FILE_STATUS_SPRITES << 16), 0x27, 0x48, panel->scroll.value + 0x61);
340 }
341 if (panel->fades[4].level != 0) {
342 if (panel->blink) {
343 if (GFX.funcs.getTime() - panel->time >= 4) {
344 panel->time = GFX.funcs.getTime();
345 panel->blinkFrame++;
346 if (panel->blinkFrame >= 5) {
347 panel->blinkFrame = 0;
348 }
349 }
350 sprite.setTexture(0x140, 0);
351 sprite.setClutRow(panel->blinkFrame);
352 sprite.draw(FILE_CACHE.getEntry(FILE_MENU_SPRITES << 16), 0xA, 0x123, 0xD6);
353 sprite.setClutRow(0);
354 }
355 STRETCH_SPRITE(sprite, panel->fades[4].level, 0, 0xD3);
356 sprite.setTexture(0x280, 0x100);
357 sprite.draw(FILE_CACHE.getEntry(FILE_STATUS_SPRITES << 16), 0x20, 0, 0xC2);
358 }
359 if (panel->fades[0].level != 0) {
360 STRETCH_SPRITE(sprite, panel->fades[0].level, 0x140, 0xD);
361 sprite.setTexture(0x140, 0);
362 sprite.draw(FILE_CACHE.getEntry(FILE_MENU_SPRITES << 16), 0x18, 0x22, 0xD);
363 }
364}
365
366/* Once the title's panel is in, shows the title and starts the slots' panel */
368 if (STSTATUS_data.funcs.updateFade(&panel->fades[0])) {
369 windows->title->setString(windows->title, FILE_CACHE.load(TEXT_FILE(TEXT_STATUS)), 0x37);
370 STSTATUS_data.funcs.startFade(&panel->fades[1], 1);
371 panel->substate++;
372 }
373}
374
375/* Once the slots' panel is in, shows the slots and starts the stats' panel */
377 if (STSTATUS_data.funcs.updateFade(&panel->fades[1])) {
378 STSTATUS_showDigivolveSlots(panel, windows, 1);
379 STSTATUS_data.funcs.startFade(&panel->fades[3], 1);
380 panel->substate++;
381 }
382}
383
384/* Once the stats' panel is in, shows the partner's stats and the cursor on it */
386 if (STSTATUS_data.funcs.updateFade(&panel->fades[3])) {
387 STSTATUS_showDigivolveStats(panel, windows, 1);
388 windows->slotCursor->setPos(windows->slotCursor, 0x50, 0x4D);
389 windows->slotCursor->setVisible(windows->slotCursor, 1);
390 panel->substate++;
391 }
392}
393
394/* Choosing the partner or a slot: right and left move between them, up and
395 down between the slots, cross asks about the slot (or shows the partner's
396 own technique), triangle closes the panel */
398 s32 slot;
399
400 if (panel->fromEntry) {
401 slot = panel->slot;
402 if (PAD_PRESSED(PAD_LEFT)) {
403 panel->fromEntry = 0;
404 STSTATUS_showDigivolveStats(panel, windows, 1);
405 windows->slotCursor->setPos(windows->slotCursor, 0x50, 0x4D);
407 return;
408 }
410 panel->slot--;
411 if (panel->slot < 0) {
412 panel->slot = 0;
413 }
414 } else if (PAD_PRESSED(PAD_DOWN) || PAD_REPEATED(PAD_DOWN)) {
415 panel->slot++;
416 if (panel->slot > panel->slotCount - 1) {
417 panel->slot = panel->slotCount - 1;
418 }
419 }
420 if (slot != panel->slot) {
421 STSTATUS_showDigivolveStats(panel, windows, 1);
422 windows->slotCursor->setPos(windows->slotCursor, 0xB0, panel->slot * 0xE + 0x31);
424 } else if (PAD_PRESSED(PAD_CROSS)) {
426 panel->substate = 10;
427 } else if (PAD_PRESSED(PAD_TRIANGLE)) {
429 panel->substate = 0x32;
430 }
431 } else if (panel->slotCount > 0 && PAD_PRESSED(PAD_RIGHT)) {
432 panel->fromEntry = 1;
433 STSTATUS_showDigivolveStats(panel, windows, 1);
434 windows->slotCursor->setPos(windows->slotCursor, 0xB0, panel->slot * 0xE + 0x31);
436 } else if (PAD_PRESSED(PAD_CROSS)) {
438 panel->substate = 0x3C;
439 } else if (PAD_PRESSED(PAD_TRIANGLE)) {
441 panel->substate = 0x32;
442 }
443}
444
445/* Starts closing the slots' panel for the question about the slot */
447 STSTATUS_data.funcs.startFade(&panel->fades[1], 0);
448 STSTATUS_showDigivolveSlots(panel, windows, 0);
449 windows->slotCursor->setVisible(windows->slotCursor, 0);
450 windows->title->setString(windows->title, FILE_CACHE.load(TEXT_FILE(TEXT_STATUS)), 0x2C);
451 panel->substate++;
452}
453
454/* Once the slots' panel is closed, starts the question's panel */
456 if (STSTATUS_data.funcs.updateFade(&panel->fades[1])) {
457 STSTATUS_data.funcs.startFade(&panel->fades[2], 1);
458 panel->substate++;
459 }
460}
461
462/* Once the question's panel is in, shows the question and its cursor */
464 if (STSTATUS_data.funcs.updateFade(&panel->fades[2])) {
465 STSTATUS_showDigivolveChoices(panel, windows, 1);
466 windows->optionCursor->setVisible(windows->optionCursor, 1);
467 panel->substate++;
468 }
469}
470
471/* The question: up and down move the cursor, cross makes the slot's entry
472 the partner's battle digivolution (or no longer) or shows its techniques,
473 triangle goes back to the slots */
475 Partner *partner;
476 s32 option;
477
478 option = panel->option;
480 panel->option = 0;
481 } else if (PAD_PRESSED(PAD_DOWN) || PAD_REPEATED(PAD_DOWN)) {
482 panel->option = 1;
483 }
484 if (option != panel->option) {
486 windows->optionCursor->setPos(windows->optionCursor, 0xB4, panel->option * 0xE + 0x3A);
487 }
488 if (PAD_PRESSED(PAD_CROSS)) {
490 if (panel->option == 0) {
491 partner = &GAME.partners[GAME.funcs.getPartyMember(panel->member)];
492 if (partner->battleDigivolve == panel->slots[panel->slot]) {
493 partner->battleDigivolve = 0;
494 } else {
495 partner->battleDigivolve = panel->slots[panel->slot];
496 }
497 panel->substate = 0x19;
498 } else {
499 panel->substate = 0x28;
500 }
501 } else if (PAD_PRESSED(PAD_TRIANGLE)) {
503 panel->substate = 0x14;
504 }
505}
506
507/* Starts closing the question's panel, back to the slots */
509 STSTATUS_data.funcs.startFade(&panel->fades[2], 0);
510 STSTATUS_showDigivolveChoices(panel, windows, 0);
511 windows->optionCursor->setVisible(windows->optionCursor, 0);
512 windows->title->setString(windows->title, FILE_CACHE.load(TEXT_FILE(TEXT_STATUS)), 0x37);
513 panel->substate++;
514}
515
516/* Once the question's panel is closed, starts the slots' panel */
518 if (STSTATUS_data.funcs.updateFade(&panel->fades[2])) {
519 STSTATUS_data.funcs.startFade(&panel->fades[1], 1);
520 panel->substate++;
521 }
522}
523
524/* Starts closing the title's and the question's panels for the battle
525 digivolution's message */
527 STSTATUS_data.funcs.startFade(&panel->fades[0], 0);
528 windows->title->setVisible(windows->title, 0);
529 STSTATUS_data.funcs.startFade(&panel->fades[2], 0);
530 STSTATUS_showDigivolveChoices(panel, windows, 0);
531 windows->optionCursor->setVisible(windows->optionCursor, 0);
532 panel->substate++;
533}
534
535/* Once the question's panel is closed, starts scrolling the stats up */
536static inline void STSTATUS_scrollUpForBattle(DigivolvePanel *panel) {
538 if (STSTATUS_data.funcs.updateFade(&panel->fades[2])) {
539 STSTATUS_data.funcs.startLerp(&panel->scroll, 0, -0x22, 4);
540 panel->substate++;
541 }
542}
543
544/* Scrolls the stats; once up, starts the info panel */
546 if (STSTATUS_data.funcs.updateLerp(&panel->scroll)) {
547 STSTATUS_data.funcs.startFade(&panel->fades[4], 1);
548 panel->substate++;
549 }
550 STSTATUS_scrollTechList(panel, windows);
551}
552
553/* Once the info panel is in, says whether the partner now digivolves in
554 battle */
556 Partner *partner;
557
558 if (STSTATUS_data.funcs.updateFade(&panel->fades[4])) {
559 partner = &GAME.partners[GAME.funcs.getPartyMember(panel->member)];
560 if (partner->battleDigivolve != 0) {
561 windows->help->setString(windows->help, FILE_CACHE.load(TEXT_FILE(TEXT_STATUS)), 0x3C);
562 } else {
563 windows->help->setString(windows->help, FILE_CACHE.load(TEXT_FILE(TEXT_STATUS)), 0x3D);
564 }
565 panel->blink = 1;
566 panel->substate++;
567 }
568}
569
570/* Cross takes the message away */
571static inline void STSTATUS_waitBattleMessage(DigivolvePanel *panel) {
572 if (PAD_PRESSED(PAD_CROSS)) {
574 panel->blink = 0;
575 panel->substate++;
576 }
577}
578
579/* Starts closing the info panel and the stats' panel */
581 STSTATUS_data.funcs.startFade(&panel->fades[4], 0);
582 windows->help->setVisible(windows->help, 0);
583 STSTATUS_data.funcs.startFade(&panel->fades[3], 0);
584 STSTATUS_showDigivolveStats(panel, windows, 0);
585 panel->substate++;
586}
587
588/* Once the stats' panel is closed, scrolls the stats back and starts the
589 panel again */
592 if (STSTATUS_data.funcs.updateFade(&panel->fades[3])) {
593 panel->fromEntry = 0;
594 STSTATUS_data.funcs.startLerp(&panel->scroll, 0, -0x22, 4);
595 STSTATUS_scrollTechList(panel, windows);
596 panel->substate = 0;
597 }
598}
599
600/* Starts closing the question's panel for the entry's techniques */
602 STSTATUS_data.funcs.startFade(&panel->fades[2], 0);
603 STSTATUS_showDigivolveChoices(panel, windows, 0);
604 windows->optionCursor->setVisible(windows->optionCursor, 0);
605 windows->title->setString(windows->title, FILE_CACHE.load(TEXT_FILE(TEXT_STATUS)), 0x2A);
606 panel->substate++;
607}
608
609/* Once the question's panel is closed, starts scrolling the stats up */
610static inline void STSTATUS_scrollUpForTechs(DigivolvePanel *panel) {
611 if (STSTATUS_data.funcs.updateFade(&panel->fades[2])) {
612 STSTATUS_data.funcs.startLerp(&panel->scroll, 0, -0x22, 4);
613 panel->substate++;
614 }
615}
616
617/* Scrolls the stats; once up, starts the info panel */
619 if (STSTATUS_data.funcs.updateLerp(&panel->scroll)) {
620 STSTATUS_data.funcs.startFade(&panel->fades[4], 1);
621 panel->substate++;
622 }
623 STSTATUS_scrollTechList(panel, windows);
624}
625
626/* Starts closing the info panel and scrolling the stats back */
628 windows->title->setString(windows->title, FILE_CACHE.load(TEXT_FILE(TEXT_STATUS)), 0x2C);
629 windows->listCursor->setVisible(windows->listCursor, 0);
630 STSTATUS_showTechCost(panel, windows, 0);
631 STSTATUS_data.funcs.startLerp(&panel->scroll, -0x22, 0, 4);
632 STSTATUS_data.funcs.startFade(&panel->fades[4], 0);
633 panel->substate++;
634}
635
636/* Scrolls the stats back; once the info panel is closed, starts the
637 question's panel */
640 if (STSTATUS_data.funcs.updateFade(&panel->fades[4])) {
641 STSTATUS_data.funcs.startFade(&panel->fades[2], 1);
642 panel->substate++;
643 }
644 STSTATUS_scrollTechList(panel, windows);
645}
646
647/* Once the question's panel is in, shows the question and its cursor again */
649 if (STSTATUS_data.funcs.updateFade(&panel->fades[2])) {
650 windows->optionCursor->setVisible(windows->optionCursor, 1);
651 STSTATUS_showDigivolveChoices(panel, windows, 1);
652 panel->substate = 13;
653 }
654}
655
656/* Starts closing the panel: the title, the slots and the stats */
658 STSTATUS_data.funcs.startFade(&panel->fades[0], 0);
659 STSTATUS_data.funcs.startFade(&panel->fades[1], 0);
660 STSTATUS_data.funcs.startFade(&panel->fades[3], 0);
661 STSTATUS_showDigivolveSlots(panel, windows, 0);
662 STSTATUS_showDigivolveStats(panel, windows, 0);
663 windows->slotCursor->setVisible(windows->slotCursor, 0);
664 windows->title->setVisible(windows->title, 0);
665 panel->substate++;
666}
667
668/* Ends the panel once its panels are closed */
669static inline void STSTATUS_endDigivolvePanel(DigivolvePanel *panel) {
672 if (STSTATUS_data.funcs.updateFade(&panel->fades[3])) {
673 panel->state = 3;
674 }
675}
676
677/* Starts closing the slots' panel for the partner's own technique */
679 STSTATUS_data.funcs.startFade(&panel->fades[1], 0);
680 STSTATUS_showDigivolveSlots(panel, windows, 0);
681 windows->slotCursor->setVisible(windows->slotCursor, 0);
682 windows->title->setString(windows->title, FILE_CACHE.load(TEXT_FILE(TEXT_STATUS)), 0x2A);
683 panel->substate++;
684}
685
686/* Once the slots' panel is closed, starts scrolling the stats up */
688 if (STSTATUS_data.funcs.updateFade(&panel->fades[1])) {
689 STSTATUS_data.funcs.startLerp(&panel->scroll, 0, -0x22, 4);
690 panel->substate++;
691 }
692}
693
694/* Scrolls the stats; once up, starts the info panel */
696 if (STSTATUS_data.funcs.updateLerp(&panel->scroll)) {
697 STSTATUS_data.funcs.startFade(&panel->fades[4], 1);
698 panel->substate++;
699 }
700 STSTATUS_scrollTechList(panel, windows);
701}
702
703/* Once the info panel is in, puts the cursor on the partner's own technique
704 (its seventh skill) and shows its description and MP cost */
706 DigimonData *data;
707 s32 tech;
708
709 if (STSTATUS_data.funcs.updateFade(&panel->fades[4])) {
711 tech = data->skills[6];
712 panel->tech = 5;
713 windows->listCursor->setPos(windows->listCursor, 0xA9, panel->scroll.value + 0xCE);
714 windows->listCursor->setVisible(windows->listCursor, 1);
715 windows->help->setString(windows->help, FILE_CACHE.load(TEXT_FILE(TEXT_SKILL_INFO)), tech);
716 windows->mpLabel->setString(windows->mpLabel, FILE_CACHE.load(TEXT_FILE(TEXT_STATUS)), 3);
717 windows->mp->setNumber(windows->mp, 0, TECHS[tech - 1].mp);
718 windows->mp->setRightAlign(windows->mp, 1);
719 panel->substate++;
720 }
721}
722
723/* Cross or triangle go back */
724static inline void STSTATUS_waitPartnerTech(DigivolvePanel *panel) {
725 if (PAD_PRESSED(PAD_CROSS)) {
727 panel->substate++;
728 } else if (PAD_PRESSED(PAD_TRIANGLE)) {
730 panel->substate++;
731 }
732}
733
734/* Starts closing the info panel and scrolling the stats back */
736 windows->title->setString(windows->title, FILE_CACHE.load(TEXT_FILE(TEXT_STATUS)), 0x37);
737 windows->listCursor->setVisible(windows->listCursor, 0);
738 STSTATUS_showTechCost(panel, windows, 0);
739 STSTATUS_data.funcs.startLerp(&panel->scroll, -0x22, 0, 4);
740 STSTATUS_data.funcs.startFade(&panel->fades[4], 0);
741 panel->substate++;
742}
743
744/* Scrolls the stats back; once the info panel is closed, starts the slots'
745 panel */
748 if (STSTATUS_data.funcs.updateFade(&panel->fades[4])) {
749 STSTATUS_data.funcs.startFade(&panel->fades[1], 1);
750 panel->substate++;
751 }
752 STSTATUS_scrollTechList(panel, windows);
753}
754
755/* Once the slots' panel is in, shows the slots and the cursor, back to
756 choosing a slot */
758 if (STSTATUS_data.funcs.updateFade(&panel->fades[1])) {
759 STSTATUS_showDigivolveSlots(panel, windows, 1);
760 windows->slotCursor->setVisible(windows->slotCursor, 1);
761 panel->substate = 4;
762 }
763}
764
765/* The panel's update: picks a slot, then shows its entry's techniques or
766 makes the battle start as it */
768 PartnerEntry entry;
769 s32 old;
770 s32 i;
771
772 switch (panel->substate) {
773 case 0:
774 default:
775 STSTATUS_data.funcs.startFade(&panel->fades[0], 1);
776 panel->substate++;
777 break;
778 case 1:
779 STSTATUS_openDigivolveTitle(panel, windows);
780 break;
781 case 2:
782 STSTATUS_openDigivolveSlots(panel, windows);
783 break;
784 case 3:
785 STSTATUS_openDigivolveStats(panel, windows);
786 break;
787 case 4:
788 STSTATUS_chooseDigivolveSlot(panel, windows);
789 break;
790 case 10:
791 STSTATUS_closeSlotsForQuestion(panel, windows);
792 break;
793 case 11:
795 break;
796 case 12:
797 STSTATUS_enterDigivolveQuestion(panel, windows);
798 break;
799 case 13:
800 STSTATUS_answerDigivolveQuestion(panel, windows);
801 break;
802 case 0x14:
803 STSTATUS_closeDigivolveQuestion(panel, windows);
804 break;
805 case 0x15:
807 break;
808 case 0x19:
809 STSTATUS_closeQuestionForBattle(panel, windows);
810 break;
811 case 0x1A:
813 break;
814 case 0x1B:
815 STSTATUS_openBattleMessage(panel, windows);
816 break;
817 case 0x1C:
818 STSTATUS_showBattleMessage(panel, windows);
819 break;
820 case 0x1D:
822 break;
823 case 0x1E:
824 STSTATUS_closeBattleMessage(panel, windows);
825 break;
826 case 0x1F:
827 STSTATUS_endBattleMessage(panel, windows);
828 break;
829 case 0x28:
830 STSTATUS_closeQuestionForTechs(panel, windows);
831 break;
832 case 0x29:
834 break;
835 case 0x2A:
836 STSTATUS_openEntryTechs(panel, windows);
837 break;
838 case 0x2B:
839 if (STSTATUS_data.funcs.updateFade(&panel->fades[4])) {
840 GAME.funcs.getPartnerEntry(GAME.funcs.getPartyMember(panel->member), panel->slots[panel->slot], &entry);
841 panel->tech = -1;
842 panel->techCount = 0;
843 for (i = 0; i < 6; i++) {
844 if (entry.skills[i] & SKILL_ID) {
845 panel->techCount++;
846 if (panel->tech == -1) {
847 panel->tech = i;
848 }
849 }
850 }
851 if (panel->techCount != 0) {
852 /* the match depends on this order of the terms, here and in case
853 0x2C: the scroll first, or the row last, gives other adds */
854 windows->listCursor->setPos(windows->listCursor, 0xA9, panel->tech * 0xE + 0x88 + panel->scroll.value);
855 windows->listCursor->setVisible(windows->listCursor, 1);
856 STSTATUS_showTechCost(panel, windows, 1);
857 panel->substate++; /* in both branches: the match depends on it */
858 } else {
859 windows->help->setString(windows->help, FILE_CACHE.load(TEXT_FILE(TEXT_STATUS)), 0x3E);
860 panel->substate++;
861 }
862 }
863 break;
864 case 0x2C:
865 if (panel->techCount != 0) {
866 old = panel->tech;
867 GAME.funcs.getPartnerEntry(GAME.funcs.getPartyMember(panel->member), panel->slots[panel->slot], &entry);
869 do {
870 panel->tech--;
871 if (panel->tech < 0) {
872 panel->tech = old;
873 break;
874 }
875 } while ((entry.skills[panel->tech] & SKILL_ID) <= 0);
876 } else if (PAD_PRESSED(PAD_DOWN) || PAD_REPEATED(PAD_DOWN)) {
877 do {
878 panel->tech++;
879 if (panel->tech >= 6) {
880 panel->tech = old;
881 break;
882 }
883 } while ((entry.skills[panel->tech] & SKILL_ID) <= 0);
884 }
885 if (old != panel->tech) {
887 windows->listCursor->setPos(windows->listCursor, 0xA9, panel->tech * 0xE + 0x88 + panel->scroll.value);
888 STSTATUS_showTechCost(panel, windows, 1);
889 }
890 }
891 if (PAD_PRESSED(PAD_CROSS)) {
893 panel->substate++;
894 } else if (PAD_PRESSED(PAD_TRIANGLE)) {
896 panel->substate++;
897 }
898 break;
899 case 0x2D:
900 STSTATUS_closeEntryTechs(panel, windows);
901 break;
902 case 0x2E:
903 STSTATUS_reopenDigivolveQuestion(panel, windows);
904 break;
905 case 0x2F:
906 STSTATUS_enterQuestionAgain(panel, windows);
907 break;
908 case 0x32:
909 STSTATUS_closeDigivolvePanel(panel, windows);
910 break;
911 case 0x33:
913 break;
914 case 0x3C:
915 STSTATUS_closeSlotsForPartnerTech(panel, windows);
916 break;
917 case 0x3D:
919 break;
920 case 0x3E:
921 STSTATUS_openPartnerTech(panel, windows);
922 break;
923 case 0x3F:
924 STSTATUS_showPartnerTech(panel, windows);
925 break;
926 case 0x40:
928 break;
929 case 0x41:
930 STSTATUS_closePartnerTech(panel, windows);
931 break;
932 case 0x42:
933 STSTATUS_reopenSlotsAfterTech(panel, windows);
934 break;
935 case 0x16:
936 case 0x43:
937 STSTATUS_enterSlotsAgain(panel, windows);
938 break;
939 }
940}
941
942/* The digivolution panel's task: creates its windows and counts the partner's
943 filled slots, then runs and draws the panel */
945 s32 i;
946
947 switch (panel->state) {
948 case TASK_INIT:
949 default:
950 panel->nextState(panel);
951 STSTATUS_createDigivolveWindows(panel, windows);
953 for (i = 0; i < 3; i++) {
954 if (panel->slots[i] >= 4) {
955 panel->slotCount++;
956 }
957 }
958 panel->fades[0].duration = 10;
959 panel->fades[1].duration = 10;
960 panel->fades[2].duration = 10;
961 panel->fades[3].duration = 10;
962 panel->fades[4].duration = 10;
963 break;
964 case TASK_RUN:
965 STSTATUS_runDigivolvePanel(panel, windows);
967 break;
968 case TASK_DONE:
969 case TASK_KILL:
970 break;
971 }
972}
973
974/* Creates the fifth screen's digivolution panel (task) for its chosen party
975 member */
978
979 panel->layer = SCREEN_LAYER;
980 panel->depth = 6;
981 panel->screen = screen;
982 panel->member = screen->member;
983 return panel;
984}
985
986/* The stats the fifth screen's panel shows: six battle stats, then the
987 resistances */
signed int s32
Definition common.h:11
signed short s16
Definition common.h:9
DigimonData DIGIMON_DATA[55]
55 entries: the 52 Digimon, then three placeholders (0x1D4-0x1D6)
Definition digimon.c:7
static void STSTATUS_closeDigivolvePanel(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Starts closing the panel: the title, the slots and the stats.
static void STSTATUS_chooseDigivolveSlot(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Choosing the partner or a slot: right and left move between them, up and down between the slots,...
void STSTATUS_updateDigivolvePanel(DigivolvePanel *panel, DigivolvePanelWindows *windows)
The digivolution panel's task: creates its windows and counts the partner's filled slots,...
static void STSTATUS_enterQuestionAgain(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Once the question's panel is in, shows the question and its cursor again.
static void STSTATUS_closeDigivolveQuestion(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Starts closing the question's panel, back to the slots.
static void STSTATUS_openEntryTechs(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Scrolls the stats; once up, starts the info panel.
static void STSTATUS_closeSlotsForQuestion(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Starts closing the slots' panel for the question about the slot.
static void STSTATUS_waitBattleMessage(DigivolvePanel *panel)
Cross takes the message away.
void STSTATUS_scrollTechList(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Moves the list to the panel's scroll position.
void STSTATUS_showTechCost(DigivolvePanel *panel, DigivolvePanelWindows *windows, s32 show)
Shows the cost of the technique under the list's cursor.
static void STSTATUS_openDigivolveTitle(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Once the title's panel is in, shows the title and starts the slots' panel.
void STSTATUS_showDigivolveChoices(DigivolvePanel *panel, DigivolvePanelWindows *windows, s32 show)
Shows or hides the question about the chosen slot: its Digimon's name, then to start battles as it (o...
static void STSTATUS_scrollUpForTechs(DigivolvePanel *panel)
Once the question's panel is closed, starts scrolling the stats up.
void STSTATUS_runDigivolvePanel(DigivolvePanel *panel, DigivolvePanelWindows *windows)
The panel's update: picks a slot, then shows its entry's techniques or makes the battle start as it.
static void STSTATUS_showBattleMessage(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Once the info panel is in, says whether the partner now digivolves in battle.
static void STSTATUS_openBattleMessage(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Scrolls the stats; once up, starts the info panel.
static void STSTATUS_answerDigivolveQuestion(DigivolvePanel *panel, DigivolvePanelWindows *windows)
The question: up and down move the cursor, cross makes the slot's entry the partner's battle digivolu...
static void STSTATUS_closeSlotsForPartnerTech(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Starts closing the slots' panel for the partner's own technique.
void STSTATUS_createDigivolveWindows(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Creates the digivolution panel's windows: the three slots, the question about a slot,...
static void STSTATUS_closeQuestionForTechs(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Starts closing the question's panel for the entry's techniques.
static void STSTATUS_enterSlotsAgain(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Once the slots' panel is in, shows the slots and the cursor, back to choosing a slot.
static void STSTATUS_endBattleMessage(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Once the stats' panel is closed, scrolls the stats back and starts the panel again.
void STSTATUS_drawDigivolvePanel(DigivolvePanel *panel)
Draws the panel's frames, the technique icons and the help arrow.
static void STSTATUS_showPartnerTech(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Once the info panel is in, puts the cursor on the partner's own technique (its seventh skill) and sho...
static void STSTATUS_reopenSlotsAfterTech(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Scrolls the stats back; once the info panel is closed, starts the slots' panel.
static void STSTATUS_closeQuestionForBattle(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Starts closing the title's and the question's panels for the battle digivolution's message.
static void STSTATUS_waitPartnerTech(DigivolvePanel *panel)
Cross or triangle go back.
static void STSTATUS_reopenDigivolveQuestion(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Scrolls the stats back; once the info panel is closed, starts the question's panel.
static void STSTATUS_closeEntryTechs(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Starts closing the info panel and scrolling the stats back.
void STSTATUS_showDigivolveStats(DigivolvePanel *panel, DigivolvePanelWindows *windows, s32 show)
The stats and techniques of the slot's entry (or of the partner itself), or hides them.
static void STSTATUS_closePartnerTech(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Starts closing the info panel and scrolling the stats back.
static void STSTATUS_reopenDigivolveSlots(DigivolvePanel *panel)
Once the question's panel is closed, starts the slots' panel.
static void STSTATUS_endDigivolvePanel(DigivolvePanel *panel)
Ends the panel once its panels are closed.
void STSTATUS_showDigivolveSlots(DigivolvePanel *panel, DigivolvePanelWindows *windows, s32 show)
The Digimon in the partner's three slots, the one it is highlighted, and the partner's own name.
static void STSTATUS_scrollUpForBattle(DigivolvePanel *panel)
Once the question's panel is closed, starts scrolling the stats up.
s32 STSTATUS_panelStats[]
The stats the fifth screen's panel shows: six battle stats, then the resistances.
static void STSTATUS_enterDigivolveQuestion(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Once the question's panel is in, shows the question and its cursor.
static void STSTATUS_openDigivolveStats(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Once the stats' panel is in, shows the partner's stats and the cursor on it.
static void STSTATUS_openDigivolveQuestion(DigivolvePanel *panel)
Once the slots' panel is closed, starts the question's panel.
static void STSTATUS_closeBattleMessage(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Starts closing the info panel and the stats' panel.
static void STSTATUS_openDigivolveSlots(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Once the slots' panel is in, shows the slots and starts the stats' panel.
static void STSTATUS_openPartnerTech(DigivolvePanel *panel, DigivolvePanelWindows *windows)
Scrolls the stats; once up, starts the info panel.
DigivolvePanel * STSTATUS_createDigivolvePanel(StatsScreen *screen)
Creates the fifth screen's digivolution panel (task) for its chosen party member.
static void STSTATUS_scrollUpForPartnerTech(DigivolvePanel *panel)
Once the slots' panel is closed, starts scrolling the stats up.
GfxState GFX
GFX: the graphics state and its methods.
Definition display.c:209
GameState GAME
The save data, the game mode and the methods.
Definition state.c:64
#define TASK_RUN
Definition task.h:35
#define TASK_KILL
Definition task.h:37
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
Definition task.h:34
#define TASK_DONE
Definition task.h:36
Cursor * createCursor(s16 layerId, s32 depth, s16 x, s16 y)
A menu cursor on a layer at (x, y)
Definition cursor.c:92
STSTATUS.PRO: the field menu's screens.
#define FILE_STATUS_SPRITES
The menu's sprite sheet; the next file is its texture archive.
Definition field_menu.h:20
#define TEXT_SKILL_NAMES
SKLNAM.
Definition file.h:223
#define TEXT_FILE(file)
Definition file.h:190
#define TEXT_STATUS
STATUS: the field menu's and STSTATUS's.
Definition file.h:225
#define TEXT_DIGIMON_NAMES
DIGNAM.
Definition file.h:211
#define TEXT_SKILL_INFO
SKLINF.
Definition file.h:222
#define FILE_MENU_SPRITES
Files the engine loads by number.
Definition file.h:188
FileCache FILE_CACHE
The file cache.
Definition file_cache.c:7
#define STAT_STRENGTH
the six battle stats
Definition game_state.h:286
#define SKILL_MARKED
marked in the lab (STGDGLAB_updateSkillPanel)
Definition game_state.h:257
#define STAT_SPIRIT
Definition game_state.h:288
#define STAT_SPEED
Definition game_state.h:290
#define STAT_DEFENSE
Definition game_state.h:287
#define STAT_CHARISMA
Definition game_state.h:291
#define SKILL_LAST
the sixth skill
Definition game_state.h:258
#define STAT_RESISTS
the first of the seven resistances
Definition game_state.h:292
#define STAT_WISDOM
Definition game_state.h:289
#define SKILL_ID
PartnerEntry.skills.
Definition game_state.h:255
DigimonData *(* GET_DIGIMON)(s32 id)
getDigimon for the overlays, in the small data (.sdata) between game/items.c's and file/file_table....
Definition get_digimon.c:10
#define STRETCH_SPRITE(sprite, level, x, y)
Definition gfx.h:273
#define SCREEN_LAYER
The layer over the whole screen that most modes create first and draw their menus on (FIELDSTG and ST...
Definition gfx.h:45
StatusData STSTATUS_data
Definition helpers.c:356
TechData TECHS[443]
The techniques, from 1: technique n is TECHS[n - 1].
Definition items.c:906
#define PAD_CROSS
Definition pad.h:31
#define PAD_DOWN
Definition pad.h:24
#define PAD_RIGHT
Definition pad.h:23
#define PAD_TRIANGLE
Definition pad.h:32
#define PAD_PRESSED(button)
One button of pad 1: newly pressed, auto-repeated while held, or held.
Definition pad.h:140
#define PAD_UP
Definition pad.h:22
#define PAD_LEFT
Definition pad.h:25
#define PAD_REPEATED(button)
Definition pad.h:141
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
Definition sound.c:180
#define SOUND_MENU_CONFIRM
SYSTEM07.
Definition sound.h:44
#define SOUND_SELECT
Sounds the overlays share, with SOUNDTST's names.
Definition sound.h:38
#define SOUND_MENU_CANCEL
SYSTEM01.
Definition sound.h:39
#define SOUND_CURSOR
SYSTEM02: a cursor moves.
Definition sound.h:40
void initSpriteDrawer(SpriteDrawer *obj)
Clears a sprite drawer to neutral (no scale, gray tint, follows the scroll), gives it its methods and...
void(* setPos)()
(cursor, x, y)
Definition text.h:34
void(* setVisible)()
(cursor, visible)
Definition text.h:33
Digimon definition (DIGIMON_DATA, 52 of them; the first 8 are the partners)
Definition game_state.h:86
u8 nameId
string in file 0x4F
Definition game_state.h:105
u16 skills[7]
[1]-[6] are learnt at skillLevels
Definition game_state.h:90
u16 battleStats[6]
Definition game_state.h:88
u16 resistances[7]
Definition game_state.h:89
TextWindow * skillLevel
Definition field_menu.h:188
TextWindow * list[13]
two columns: 6 and 7
Definition field_menu.h:190
TextWindow * skillLabel
Definition field_menu.h:189
TextWindow * entryName
Definition field_menu.h:187
TextWindow * partnerName
Definition field_menu.h:182
TextWindow * choiceTitle
Definition field_menu.h:183
TextWindow * mpLabel
Definition field_menu.h:194
TextWindow * options[2]
Definition field_menu.h:184
TextWindow * values[6]
Definition field_menu.h:191
TextWindow * slots[3]
Definition field_menu.h:180
A panel of the fifth screen (STSTATUS_createDigivolvePanel)
Definition field_menu.h:158
StatsScreen * screen
Definition field_menu.h:160
void(* nextState)(struct DigivolvePanel *task)
Definition field_menu.h:159
s32 slotCount
the slots holding an entry (4 on)
Definition field_menu.h:170
s32 blink
the help arrow
Definition field_menu.h:173
s32 slot
the cursors' rows
Definition field_menu.h:163
s32 tech
the list's row
Definition field_menu.h:165
PanelAnim fades[5]
Definition field_menu.h:176
s32 fromEntry
the list shows the slot's techniques, not the partner's
Definition field_menu.h:167
s32 techCount
the entry's techniques
Definition field_menu.h:166
s16 slots[4]
getPartnerSlots
Definition field_menu.h:169
MenuLerp scroll
its value is added to the list's y
Definition field_menu.h:172
void *(* load)(u32 file)
Definition file.h:92
void *(* getEntry)(u32 fileAndIndex)
Definition file.h:96
s32(* getPartnerEntry)()
-1 if it hasn't the Digimon
Definition game_state.h:36
void(* computeStats)(s32 partner, union PartnerTotals *out)
Definition game_state.h:31
s32(* getPartyMember)(u32 index)
Definition game_state.h:24
s32(* getPartnerSlots)()
(partner, s16 *out): the count
Definition game_state.h:32
Partner partners[PARTNER_COUNT]
Definition game_state.h:517
GameFuncs funcs
Definition game_state.h:582
s32(* getTime)(void)
Definition gfx.h:31
GfxFuncs funcs
Definition gfx.h:77
s32 value
Definition menu.h:30
s32 level
Definition menu.h:21
s32 duration
Definition menu.h:19
One of a partner's Digimon (getPartnerEntry, setPartnerEntry)
Definition game_state.h:247
s8 level
shown in the lab; 1 when added
Definition game_state.h:249
s16 skills[6]
SKILL_ID and the flags below, 0 for none.
Definition game_state.h:251
One of the eight partner Digimon.
Definition game_state.h:345
s32 battleDigivolve
an entry id, compared with the slots': the Digimon the battle starts it as, 0 for its own
Definition game_state.h:348
short(* playSound)(s32 id)
returns the voice of a key-on
Definition sound.h:187
Draws sprites from a sprite sheet (such as file 0x277, the menu graphics): a sheet has a table of fra...
Definition gfx.h:223
void(* setPivot)()
(x, y)
Definition gfx.h:250
void(* setScale)()
(x, y, z), ONE = 1.0
Definition gfx.h:248
void(* setLayerId)()
(id, depth)
Definition gfx.h:244
void(* setClutRow)()
(row)
Definition gfx.h:247
void(* draw)()
(sheet, frame, x, y)
Definition gfx.h:246
void(* setTexture)()
(x, y)
Definition gfx.h:242
The field menu's fifth screen (STSTATUS_createStatusScreen)
Definition field_menu.h:117
s32 member
in the party
Definition field_menu.h:128
WindowPos * layout
where the windows go, and their strings
Definition field_menu.h:438
StatusFuncs funcs
Definition field_menu.h:445
s32(* updateFade)(PanelAnim *fade)
Definition field_menu.h:276
s32(* updateLerp)(MenuLerp *lerp)
Definition field_menu.h:278
void(* startLerp)(MenuLerp *lerp, s32 from, s32 to, s32 frames)
Definition field_menu.h:277
void(* startFade)(PanelAnim *fade, s32 fadeIn)
Definition field_menu.h:275
u16 mp
its cost
Definition game_state.h:111
u8 icon
a frame of the menu sprites, from 0x37
Definition game_state.h:113
void(* setPalette)(struct TextWindow *obj, u8 arg)
Definition text.h:174
void(* setRightAlign)()
no prototype: callers would truncate u8 args
Definition text.h:178
void(* setNumber)()
Definition text.h:166
void(* setPos)(struct TextWindow *obj, s16 x, s16 y)
Definition text.h:173
void(* setString)()
Definition text.h:165
void(* setVisible)(struct TextWindow *obj, u8 arg)
Definition text.h:177
Where a window goes, and the string it shows.
Definition menu.h:102
s16 y
Definition menu.h:106
s16 x
Definition menu.h:104
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
Definition task.c:105
#define PALETTE_BLUE
a light blue: what is highlighted or current
Definition text.h:113
#define PALETTE_GREEN
Definition text.h:116
#define PALETTE_PURPLE
Definition text.h:118
#define PALETTE_WHITE
The text windows' palettes (TextWindow.palette, setPalette): rows of the font's CLUTs,...
Definition text.h:112
#define PALETTE_YELLOW
Definition text.h:115
TextWindow * createTextWindow(s16 layerId, s16 style, s16 x, s16 y)
A text window on a layer, in a font style, at (x, y)
computeStats' result: the stats with the equipment added, by STAT_* or by name.
Definition game_state.h:409
s16 lowered[3]
taken from battle[0], [1] and [4]
Definition game_state.h:421
s16 stats[24]
Definition game_state.h:410
struct PartnerTotals::@10 fields