Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
report.h
Go to the documentation of this file.
1#ifndef STFGTREP_H
2#define STFGTREP_H
3
4/* STFGTREP.PRO: mode 0x1400, the report after a battle. WFIGHTMN requests
5 it when a battle ends; it goes through the party (getPartyMember) and
6 shows the partners that went up a level, with their name and new level,
7 from text file 0x56. Its one object is cut, in its link order, into
8 src/battle/report's scene.c, partner.c, report.c, fade.c and growth.c, with
9 its data in data/stfgtrep.c. */
10
11#include "engine/game.h"
12
13/* The name of this overlay's copy of a function of src/shared/ */
14#define OVL_NAME(name) STFGTREP_##name
15
16/* The sprite archive the overlay loads */
17#if VERSION_US || VERSION_JP
18#define FILE_FGTREP_SPRITES 0x791
19#elif VERSION_EU
20#define FILE_FGTREP_SPRITES 0x7A0
21#endif
22
23/* What a battle gives (STFGTREP_rewards) */
24typedef struct BattleReward {
25 /* 0x0 */ s32 digimonExp; /* shared by the Digimon used */
26 /* 0x4 */ s32 exp; /* shared by the partners who fought */
27 /* 0x8 */ s32 money;
29
30/* A Digimon a partner can learn, once the conditions are met */
31typedef struct Evolution {
32 /* 0x0 */ s32 digimon; /* DIGIMON_DATA index + 1 */
33 /* 0x4 */ struct {
34 s16 digimon; /* 0 for none */
36 } needs[2];
37 /* 0xC */ s16 stat; /* 1-6 battle stats, 7 level, 8-14 resistances */
38 /* 0xE */ s16 value; /* the least the stat must be */
39} Evolution;
40
41struct FightReport;
42
43/* A blinking image of a partner's panel */
44typedef struct ReportBlink {
45 /* 0x0 */ s32 on;
46 /* 0x4 */ s32 frame;
47 /* 0x8 */ s32 time;
49
50/* The panel of a partner of the party (STFGTREP_createPartner) */
51typedef struct ReportPartner {
53 /* 0x050 */ struct FightReport *report;
54 /* 0x054 */ s32 layer;
55 /* 0x058 */ s32 depth;
56 /* 0x05C */ s32 index; /* in the party */
57 /* 0x060 */ s32 exp; /* what the partner gets */
58 /* 0x064 */ s32 boosted; /* the exp accessory was applied */
59 /* 0x068 */ s32 selected;
60 /* 0x06C */ s32 frame; /* of the partner's animation */
61 /* 0x070 */ s32 frameTime;
62 /* 0x074 */ s16 slots[3];
63 /* 0x07A */ s16 entries[44]; /* listPartnerEntries */
64 /* 0x0D4 */ PartnerEntry entry;
65 /* 0x0E8 */ s32 slot; /* whose Digimon gets its exp, -1 for none */
66 /* 0x0EC */ s32 padEC; /* never read or written */
68 /* 0x0FC */ struct {
69 s32 pad; /* never read or written */
72 /* 0x12C */ s32 learned;
73 /* 0x130 */ s32 sound;
74 /* 0x134 */ s16 voice; /* -1 for none */
75 /* 0x138 */ s32 shownExp;
76 /* 0x13C */ s32 targetExp;
77 /* 0x140 */ s32 rollTime;
78 /* 0x144 */ s32 pad144; /* never read or written */
79 /* 0x148 */ PanelAnim fade;
80 /* 0x158 */ s32 cursorFrame;
81 /* 0x15C */ s32 cursorTime;
82 /* 0x160 */ void (*show)(struct ReportPartner *partner);
83 /* 0x164 */ void (*hide)(struct ReportPartner *partner);
84 /* 0x168 */ void (*raise)(struct ReportPartner *partner);
85 /* 0x16C */ s32 (*boostExp)(struct ReportPartner *partner);
86 /* 0x170 */ void (*select)(struct ReportPartner *partner);
88
89/* The children of a partner's panel */
90typedef struct ReportPartnerWindows {
91 /* 0x00 */ TextWindow *name;
92 /* 0x04 */ TextWindow *level;
94 /* 0x0C */ TextWindow *exp;
95 /* 0x10 */ TextWindow *expLabel;
96 /* 0x14 */ struct {
99 } slots[3];
100 /* 0x2C */ TextWindow *message;
102
103/* The main task of the screen (STFGTREP_createScreen) */
104typedef struct FightReport {
106 /* 0x50 */ s32 layer;
107 /* 0x54 */ s32 depth;
108 /* 0x58 */ s32 bgScroll;
109 /* 0x5C */ s32 bgSkip; /* the background moves every other frame */
110 /* 0x60 */ s32 count; /* partners in the party */
111 /* 0x64 */ s32 exp[3]; /* what each one gets */
112 /* 0x70 */ s32 used; /* Digimon used in the battle */
113 /* 0x74 */ s32 arrowOn; /* the message waits for a button */
114 /* 0x78 */ s32 arrowTime;
115 /* 0x7C */ s32 arrowFrame;
116 /* 0x80 */ PanelAnim header;
117 /* 0x90 */ PanelAnim footer;
119
120/* The children of the main task */
121typedef struct FightReportChildren {
122 /* 0x00 */ TextWindow *exp;
123 /* 0x04 */ TextWindow *expLabel;
124 /* 0x08 */ TextWindow *message;
125 /* 0x0C */ ReportPartner *partners[3];
126 /* 0x18 */ ScreenFade *fade;
128
129/* The overlay's helpers (STFGTREP_funcs) */
130typedef struct FightReportFuncs {
131 /* 0x00 */ void (*loadFiles)(void);
132 /* 0x04 */ s32 (*filesLoading)(void);
133 /* 0x08 */ void (*startFade)(PanelAnim *fade, s32 fadeIn);
134 /* 0x0C */ s32 (*updateFade)(PanelAnim *fade);
135 /* 0x10 */ void (*startLerp)(MenuLerp *lerp, s32 from, s32 to, s32 frames);
136 /* 0x14 */ s32 (*updateLerp)(MenuLerp *lerp);
137 /* 0x18 */ s32 (*addExp)(s32 partner, s32 exp);
138 /* 0x1C */ s32 (*learnDigimon)(s32 partner);
139 /* 0x20 */ s32 (*addDigimonExp)(s32 partner, s32 id, s32 exp);
140 /* 0x24 */ s32 (*addSkill)(s32 partner, s32 id);
141 /* 0x28 */ s32 (*learnSkill)(s32 partner, s32 id);
142 /* 0x2C */ s32 (*getDigimonExp)(s32 partner, s32 id, s32 exp, s32 used);
144
145
146/* What a level adds to the exp the next one needs, by tier */
147extern s32 STFGTREP_levelExp[4];
148/* What is taken from the HP and MP growth, by tier, and added at random */
149extern s32 STFGTREP_vitalCuts[4];
150extern s32 STFGTREP_vitalRandom[9];
151/* A battle stat's gain by tier, from its growth plus 0-4 at random */
152extern s32 STFGTREP_statGains[6][9];
153/* A resistance's gain, from its growth plus 0-3 at random */
154extern s32 STFGTREP_resistGains[8];
155
158extern Evolution *STFGTREP_evolutions[PARTNER_COUNT]; /* each partner's (STFGTREP_learnDigimon) */
159
160extern s32 STFGTREP_animations[][7]; /* each partner Digimon's sprite frames, -1 ending them early */
161
162/* scene.c */
163void STFGTREP_updateScene(Task *task, FightReport **children);
164void STFGTREP_startFader(ScreenFade *task, s32 fadeIn, s32 duration);
168
169/* partner.c */
182
183/* report.c */
185void STFGTREP_drawReport(FightReport *report);
186void STFGTREP_runReport(FightReport *report, FightReportChildren *children);
189void STFGTREP_loadFiles(void);
191
192/* fade.c */
193void STFGTREP_startFade(PanelAnim *fade, s32 fadeIn);
195void STFGTREP_startLerp(MenuLerp *lerp, s32 from, s32 to, s32 frames);
197
198/* growth.c */
199void STFGTREP_raiseStats(s32 partner, s32 level);
200s32 STFGTREP_addExp(s32 partner, s32 exp);
202s32 STFGTREP_addDigimonExp(s32 partner, s32 id, s32 exp);
203s32 STFGTREP_addSkill(s32 partner, s32 id);
204s32 STFGTREP_learnSkill(s32 partner, s32 id);
205s32 STFGTREP_getDigimonExp(s32 partner, s32 id, s32 exp, s32 used);
206
207#endif /* STFGTREP_H */
signed int s32
Definition common.h:11
signed short s16
Definition common.h:9
#define TASK_HEADER(Type)
Definition task.h:39
@ PARTNER_COUNT
Definition game_state.h:472
s32 STFGTREP_addDigimonExp(s32 partner, s32 id, s32 exp)
Adds exp to one of a partner's Digimon and raises its level as far as the exp reaches,...
Definition growth.c:196
s32 STFGTREP_resistGains[8]
A resistance's gain, from its growth plus 0-3 at random.
Definition stfgtrep.c:1094
s32 STFGTREP_boostExp(ReportPartner *partner)
Adds a fifth to the exp once, if the partner wears item 0x141.
Definition partner.c:492
void STFGTREP_runPartner(ReportPartner *partner, ReportPartnerWindows *windows)
A panel's steps: it fades in and out, gives each slot's Digimon its exp, with the levels and skills t...
Definition partner.c:324
void STFGTREP_showPartner(ReportPartner *partner)
ReportPartner.show: fades the panel in (substate 1)
Definition partner.c:476
void STFGTREP_startFade(PanelAnim *fade, s32 fadeIn)
fade.c
BattleReward STFGTREP_rewards[]
Definition stfgtrep.c:345
void STFGTREP_drawPartner(ReportPartner *partner)
Draws a partner's panel: the level and slot blinks, the cursor, the partner's animation and its frame...
Definition partner.c:71
s32 STFGTREP_vitalRandom[9]
Definition stfgtrep.c:1081
void STFGTREP_startLerp(MenuLerp *lerp, s32 from, s32 to, s32 frames)
s32 STFGTREP_updateLerp(MenuLerp *lerp)
Evolution * STFGTREP_evolutions[PARTNER_COUNT]
each partner's (STFGTREP_learnDigimon)
Definition stfgtrep.c:1054
void STFGTREP_selectPartner(ReportPartner *partner)
ReportPartner.select: shows the cursor on the panel until its exp is given.
Definition partner.c:506
void STFGTREP_hidePartner(ReportPartner *partner)
ReportPartner.hide: fades the panel out (substate 11)
Definition partner.c:481
void STFGTREP_runReport(FightReport *report, FightReportChildren *children)
The report while it runs: shows the panels, then for each partner that got exp its message and the ra...
Definition report.c:166
FightReport * STFGTREP_createScreen(void)
Creates the report (STFGTREP_updateReport) on the screen layer.
Definition report.c:363
ScreenFade * STFGTREP_createFader(void)
s32 STFGTREP_rollExp(ReportPartner *partner)
Rolls the shown exp towards the target, digit by digit; 0 once it is there.
Definition partner.c:165
void STFGTREP_raiseStats(s32 partner, s32 level)
growth.c
Definition growth.c:8
void STFGTREP_fillPartnerWindows(ReportPartner *partner, ReportPartnerWindows *windows, s32 show)
Fills a partner's panel with its name, level, exp and Digimon, or hides it.
Definition partner.c:28
void STFGTREP_createPartnerWindows(ReportPartner *partner, ReportPartnerWindows *windows)
partner.c
Definition partner.c:7
void STFGTREP_drawFader(ScreenFade *task)
void STFGTREP_raisePartner(ReportPartner *partner)
ReportPartner.raise: gives the exp to the partner's Digimon, with its new levels and skills (substate...
Definition partner.c:487
s32 STFGTREP_learnSkill(s32 partner, s32 id)
Marks known (SKILL_KNOWN) the first skill of one of a partner's Digimon whose level it has reached (D...
Definition growth.c:258
s32 STFGTREP_vitalCuts[4]
What is taken from the HP and MP growth, by tier, and added at random.
Definition stfgtrep.c:1078
s32 STFGTREP_statGains[6][9]
A battle stat's gain by tier, from its growth plus 0-4 at random.
Definition stfgtrep.c:1086
s32 STFGTREP_addSkill(s32 partner, s32 id)
Gives one of a partner's Digimon the first skill whose level it has reached and that it hasn't yet (D...
Definition growth.c:234
FightReportFuncs STFGTREP_funcs
Definition stfgtrep.c:1070
void STFGTREP_drawReport(FightReport *report)
Draws the report's message arrow, background, header and footer.
Definition report.c:19
void STFGTREP_startFader(ScreenFade *task, s32 fadeIn, s32 duration)
s32 STFGTREP_getDigimonExp(s32 partner, s32 id, s32 exp, s32 used)
The exp one of a partner's Digimon gets of a battle's: less as the partner goes up in level,...
Definition growth.c:278
void STFGTREP_updateReport(FightReport *report, FightReportChildren *children)
The report's main task: loads the files, shares the battle's exp among the partners who fought and cr...
Definition report.c:288
s32 STFGTREP_filesLoading(void)
Whether STFGTREP_loadFiles's texts are still loading.
Definition report.c:385
s32 STFGTREP_learnDigimon(s32 partner)
Gives a partner the first Digimon of its evolution list (STFGTREP_evolutions) it hasn't yet and whose...
Definition growth.c:131
void STFGTREP_loadFiles(void)
Loads the report's sprites and requests its texts, the Digimon names and the item names.
Definition report.c:373
void STFGTREP_updatePartner(ReportPartner *partner, ReportPartnerWindows *windows)
A partner's panel task.
Definition partner.c:443
s32 STFGTREP_levelExp[4]
What a level adds to the exp the next one needs, by tier.
Definition stfgtrep.c:1075
void STFGTREP_updateFader(ScreenFade *task)
ReportPartner * STFGTREP_createPartner(FightReport *report, s32 index, s32 exp)
Creates the panel of party member index, who gets exp.
Definition partner.c:511
s32 STFGTREP_addExp(s32 partner, s32 exp)
Adds exp to a partner and raises its level, and its stats with it, as far as the exp reaches; whether...
Definition growth.c:77
void STFGTREP_updateScene(Task *task, FightReport **children)
scene.c
Definition scene.c:8
void STFGTREP_createWindows(FightReport *report, FightReportChildren *children)
report.c
Definition report.c:8
s32 STFGTREP_updateFade(PanelAnim *fade)
s32 STFGTREP_animations[][7]
each partner Digimon's sprite frames, -1 ending them early
Definition stfgtrep.c:1060
What a battle gives (STFGTREP_rewards)
Definition report.h:24
s32 exp
shared by the partners who fought
Definition report.h:26
s32 money
Definition report.h:27
s32 digimonExp
shared by the Digimon used
Definition report.h:25
A Digimon a partner can learn, once the conditions are met.
Definition report.h:31
struct Evolution::@5 needs[2]
s16 digimon
0 for none
Definition report.h:34
s16 value
the least the stat must be
Definition report.h:38
s16 stat
1-6 battle stats, 7 level, 8-14 resistances
Definition report.h:37
s32 digimon
DIGIMON_DATA index + 1.
Definition report.h:32
s16 level
Definition report.h:35
The children of the main task.
Definition report.h:121
TextWindow * exp
Definition report.h:122
TextWindow * expLabel
Definition report.h:123
ScreenFade * fade
Definition report.h:126
ReportPartner * partners[3]
Definition report.h:125
TextWindow * message
Definition report.h:124
The overlay's helpers (STFGTREP_funcs)
Definition report.h:130
s32(* filesLoading)(void)
Definition report.h:132
s32(* addSkill)(s32 partner, s32 id)
Definition report.h:140
s32(* learnDigimon)(s32 partner)
Definition report.h:138
s32(* addExp)(s32 partner, s32 exp)
Definition report.h:137
void(* startFade)(PanelAnim *fade, s32 fadeIn)
Definition report.h:133
s32(* learnSkill)(s32 partner, s32 id)
Definition report.h:141
void(* loadFiles)(void)
Definition report.h:131
s32(* addDigimonExp)(s32 partner, s32 id, s32 exp)
Definition report.h:139
s32(* updateFade)(PanelAnim *fade)
Definition report.h:134
s32(* getDigimonExp)(s32 partner, s32 id, s32 exp, s32 used)
Definition report.h:142
s32(* updateLerp)(MenuLerp *lerp)
Definition report.h:136
void(* startLerp)(MenuLerp *lerp, s32 from, s32 to, s32 frames)
Definition report.h:135
The main task of the screen (STFGTREP_createScreen)
Definition report.h:104
PanelAnim footer
Definition report.h:117
s32 arrowOn
the message waits for a button
Definition report.h:113
s32 depth
Definition report.h:107
s32 count
partners in the party
Definition report.h:110
s32 exp[3]
what each one gets
Definition report.h:111
s32 used
Digimon used in the battle.
Definition report.h:112
s32 bgSkip
the background moves every other frame
Definition report.h:109
s32 arrowTime
Definition report.h:114
s32 bgScroll
Definition report.h:108
s32 layer
Definition report.h:106
s32 arrowFrame
Definition report.h:115
PanelAnim header
Definition report.h:116
Moves a value towards a target in fixed point, as the menu overlays' startLerp and updateLerp do.
Definition menu.h:27
Opens or closes a menu panel: level goes 0 -> ONE in duration frames (or back at twice the speed),...
Definition menu.h:18
One of a partner's Digimon (getPartnerEntry, setPartnerEntry)
Definition game_state.h:247
The children of a partner's panel.
Definition report.h:90
TextWindow * name
Definition report.h:91
struct ReportPartnerWindows::@7 slots[3]
TextWindow * expLabel
Definition report.h:95
TextWindow * levelLabel
Definition report.h:93
TextWindow * level
Definition report.h:92
TextWindow * exp
Definition report.h:94
TextWindow * message
Definition report.h:100
The panel of a partner of the party (STFGTREP_createPartner)
Definition report.h:51
s32 selected
Definition report.h:59
s16 voice
-1 for none
Definition report.h:74
s32 learned
Definition report.h:72
PartnerEntry entry
Definition report.h:64
s32 targetExp
Definition report.h:76
struct FightReport * report
Definition report.h:53
struct ReportPartner::@6 slotBlinks[3]
void(* show)(struct ReportPartner *partner)
Definition report.h:82
s32 exp
what the partner gets
Definition report.h:57
s32 padEC
never read or written
Definition report.h:66
s32 frame
of the partner's animation
Definition report.h:60
ReportBlink blink
Definition report.h:70
s32 rollTime
Definition report.h:77
s32 cursorFrame
Definition report.h:80
s16 entries[44]
listPartnerEntries
Definition report.h:63
s32 pad144
never read or written
Definition report.h:78
s32 frameTime
Definition report.h:61
void(* raise)(struct ReportPartner *partner)
Definition report.h:84
s16 slots[3]
Definition report.h:62
void(* select)(struct ReportPartner *partner)
Definition report.h:86
s32 boosted
the exp accessory was applied
Definition report.h:58
s32(* boostExp)(struct ReportPartner *partner)
Definition report.h:85
ReportBlink levelBlink
Definition report.h:67
s32 shownExp
Definition report.h:75
s32 pad
never read or written
Definition report.h:69
void(* hide)(struct ReportPartner *partner)
Definition report.h:83
s32 index
in the party
Definition report.h:56
s32 slot
whose Digimon gets its exp, -1 for none
Definition report.h:65
PanelAnim fade
Definition report.h:79
s32 cursorTime
Definition report.h:81
Fades the whole screen to black and back with a subtractive rectangle.
Definition gfx.h:361
Any task, seen through its header.
Definition task.h:62
A text window (createTextWindow): up to six text buffers (0 is shown, 1-5 are "work" buffers that con...
Definition text.h:131