Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
info.c
Go to the documentation of this file.
1/* The details panel of the item under the cursor: its description, and what
2 equipping it would change in each partner's stats */
3
4#include "menus/item_shop.h"
5
6/* A partner's stats with its equipment, as main's computeStats gives them: the
7 weapons' attack (STAT_STRENGTH), the armor's defense (STAT_DEFENSE) and the
8 items' bonuses added, up to 999, less the penalties on STAT_STRENGTH,
9 STAT_DEFENSE and STAT_SPEED */
10void STITSHOP_computeStats(s32 partner, StatBlock *out) {
11 s16 *equip;
12 s32 i;
13 s32 j;
14 ItemInfo *info;
15 ItemData *data;
16 u8 type;
17 u8 stat;
18 s32 amount;
19
20 GameState *save = &GAME;
21 PartnerStats *d;
22
23 /* PartnerStats' stats[] and status[] (the penalties), as one block */
24 *out = *(StatBlock *)save->partners[partner].info.stats;
25 d = &GAME.partners[partner].info;
26 equip = d->equip;
27 for (i = 0; i < 6; i++) {
28 if (equip[i] > 0) {
29 info = ITEM_FUNCS.get(equip[i]);
30 type = info->type;
31 data = info->data.record;
32 if (IS_WEAPON_TYPE(type)) {
33 out->stats[STAT_STRENGTH] += data->weapon.atk;
34 if (out->stats[STAT_STRENGTH] >= 1000) {
35 out->stats[STAT_STRENGTH] = 999;
36 }
37 for (j = 0; j < 2; j++) {
38 stat = *(j + data->weapon.stats);
39 amount = data->weapon.amounts[j];
40 if (stat != 0) {
41 STITSHOP_addStat(out->stats, stat, (s16)amount);
42 }
43 }
44 } else if (IS_ARMOR_TYPE(type)) {
45 out->stats[STAT_DEFENSE] += data->armor.def;
46 if (out->stats[STAT_DEFENSE] >= 1000) {
47 out->stats[STAT_DEFENSE] = 999;
48 }
49 for (j = 0; j < 2; j++) {
50 stat = *(j + data->armor.stats);
51 amount = data->armor.amounts[j];
52 if (stat != 0) {
53 STITSHOP_addStat(out->stats, stat, (s16)amount);
54 }
55 }
56 } else if (IS_ACCESSORY_TYPE(type)) {
57 stat = data->acc.stat;
58 amount = data->acc.amount;
59 if (stat != 0) {
60 STITSHOP_addStat(out->stats, stat, (s16)amount);
61 }
62 } else {
63 continue;
64 }
65 out->stats[STAT_CHARISMA] += data->weapon.charisma;
66 if (out->stats[STAT_CHARISMA] >= 1000) {
67 out->stats[STAT_CHARISMA] = 999;
68 }
69 }
70 }
71 out->stats[STAT_STRENGTH] -= out->penalties[0];
72 if (out->stats[STAT_STRENGTH] < 0) {
73 out->stats[STAT_STRENGTH] = 0;
74 }
75 out->stats[STAT_DEFENSE] -= out->penalties[1];
76 if (out->stats[STAT_DEFENSE] < 0) {
77 out->stats[STAT_DEFENSE] = 0;
78 }
79 out->stats[STAT_SPEED] -= out->penalties[2];
80 if (out->stats[STAT_SPEED] < 0) {
81 out->stats[STAT_SPEED] = 0;
82 }
83}
84
85/* Adds an item's bonus to a stat, up to 999: 1 to 6 one of the six battle stats,
86 7 all of them, 8 to 14 a resistance */
87void STITSHOP_addStat(s16 *p, s32 stat, s32 delta) {
88 s32 i;
89 s16 value;
90
91 if (stat == 7) {
92 for (i = 0; i < 6; i++) {
93 value = p[STAT_STRENGTH + i] + delta;
94 p[STAT_STRENGTH + i] = value;
95 if (value >= 1000) {
96 p[STAT_STRENGTH + i] = 999;
97 }
98 }
99 } else if (stat - 1 < 6U) {
100 value = p[STAT_STRENGTH - 1 + stat] + delta;
101 p[STAT_STRENGTH - 1 + stat] = value;
102 if (value >= 1000) {
103 p[STAT_STRENGTH - 1 + stat] = 999;
104 }
105 } else if (stat - 8 < 7U) {
106 value = p[STAT_RESISTS - 8 + stat] + delta;
107 p[STAT_RESISTS - 8 + stat] = value;
108 if (value >= 1000) {
109 p[STAT_RESISTS - 8 + stat] = 999;
110 }
111 }
112}
113
114/* Shows a row's stat of a partner in the details panel: as it is, or with the
115 item equipped when the row compares */
117 ShopPartnerInfo *p = &info->partners[row->partner];
118 s16 value;
119
120 if (row->compare == 0) {
121 value = *(STITSHOP_stats[row->stat] + p->current.stats);
122 } else {
123 value = *(STITSHOP_stats[row->stat] + p->withItem.stats);
124 }
125 win->setNumber(win, 0, value);
126 win->setRightAlign(win, 1);
127}
128
129/* Colors a row's stat: palette 1 when the item would raise it, 5 when it would
130 lower it, else 6 when a penalty lowers it (STAT_STRENGTH, STAT_DEFENSE and
131 STAT_SPEED), 0 otherwise */
133 ShopPartnerInfo *p = &info->partners[row->partner];
134 s32 penalty;
135 s16 v[2];
136
137 if (row->stat == 0) {
138 penalty = 0;
139 } else if (row->stat == 1) {
140 penalty = 1;
141 } else if (row->stat == 4) {
142 penalty = 2;
143 } else {
144 penalty = -1;
145 }
146 v[0] = *(STITSHOP_stats[row->stat] + p->current.stats);
147 if (row->compare == 0) {
148 if (penalty >= 0 && p->current.penalties[penalty] != 0) {
149 win->setPalette(win, PALETTE_PURPLE);
150 } else {
151 win->setPalette(win, PALETTE_WHITE);
152 }
153 } else {
154 v[1] = *(STITSHOP_stats[row->stat] + p->withItem.stats);
155 if (v[0] == v[1]) {
156 if (penalty >= 0 && p->current.penalties[penalty] != 0) {
157 win->setPalette(win, PALETTE_PURPLE);
158 } else {
159 win->setPalette(win, PALETTE_WHITE);
160 }
161 } else if (v[0] < v[1]) {
162 win->setPalette(win, PALETTE_BLUE);
163 } else {
164 win->setPalette(win, PALETTE_RED);
165 }
166 }
167}
168
169/* Shows the new values of the other stats the item would change (palette 1 up,
170 5 down), noting them in the partner's rows; hides the windows left over */
172 ShopPartnerInfo *p = &info->partners[row->partner];
173 s32 i;
174 s32 n = 0;
175 s16 v[2];
176
177 for (i = 0; i < 13; i++) {
178 if (i != row->skip && (row->skip2 < 0 || i != row->skip2)) {
179 v[0] = *(STITSHOP_stats[i] + p->current.stats);
180 v[1] = *(STITSHOP_stats[i] + p->withItem.stats);
181 if (v[0] != v[1]) {
182 p->rows[n + 2] = i + 1;
183 win[n]->setNumber(win[n], 0, v[1]);
184 win[n]->setRightAlign(win[n], 1);
185 if (v[0] < v[1]) {
186 win[n]->setPalette(win[n], PALETTE_BLUE);
187 } else {
188 win[n]->setPalette(win[n], PALETTE_RED);
189 }
190 n++;
191 }
192 }
193 }
194 p->changes += n;
195 for (i = n; i < 4; i++) {
196 win[i]->setVisible(win[i], 0);
197 }
198}
199
200/* Fills a partner's rows of the details panel's second page: the stats of
201 the slot the item goes in, then the others it would change. The item is
202 equipped to compute them and the partner's equipment put back */
204 PartnerEquip equip;
205 ShopStatRow row;
206 s32 partner = GAME.funcs.getPartyMember(member);
207 PartnerStats *stats = GAME.funcs.getPartnerStats(partner);
208 ShopPartnerInfo *p = &info->partners[member];
209 ItemData *data;
210
211 /* the partner's equipment, kept as one block while the item is tried on */
212 equip = *(PartnerEquip *)stats->equip;
213 STITSHOP_computeStats(partner, &p->current);
214 p->slot = STITSHOP_funcs.compareEquip(partner, info->item);
215 STITSHOP_funcs.equip(partner, p->slot, info->item, 0);
216 STITSHOP_computeStats(partner, &p->withItem);
217 *(PartnerEquip *)stats->equip = equip;
218 p->changes = 2;
219 switch (p->slot) {
220 case 0:
221 case 2:
222 case 3:
223 default:
224 if (IS_WEAPON_TYPE(ITEM_FUNCS.get(info->item)->type)) {
225 p->rows[0] = 1;
226 row.partner = member;
227 row.stat = 0;
228 row.compare = 0;
229 STITSHOP_showStat(info, win->partners[member].changes[0], &row);
230 STITSHOP_colorStat(info, win->partners[member].changes[0], &row);
231 row.compare = 1;
232 STITSHOP_showStat(info, win->partners[member].changes[2], &row);
233 STITSHOP_colorStat(info, win->partners[member].changes[2], &row);
234 p->rows[1] = 6;
235 row.partner = member;
236 row.stat = 5;
237 row.compare = 0;
238 STITSHOP_showStat(info, win->partners[member].changes[1], &row);
239 STITSHOP_colorStat(info, win->partners[member].changes[1], &row);
240 row.compare = 1;
241 STITSHOP_showStat(info, win->partners[member].changes[3], &row);
242 STITSHOP_colorStat(info, win->partners[member].changes[3], &row);
243 row.skip = 0;
244 row.skip2 = 5;
245 STITSHOP_showOtherChanges(info, &win->partners[member].changes[4], &row);
246 } else {
247 p->rows[0] = 2;
248 row.partner = member;
249 row.stat = 1;
250 row.compare = 0;
251 STITSHOP_showStat(info, win->partners[member].changes[0], &row);
252 STITSHOP_colorStat(info, win->partners[member].changes[0], &row);
253 row.compare = 1;
254 STITSHOP_showStat(info, win->partners[member].changes[2], &row);
255 STITSHOP_colorStat(info, win->partners[member].changes[2], &row);
256 p->rows[1] = 6;
257 row.partner = member;
258 row.stat = 5;
259 row.compare = 0;
260 STITSHOP_showStat(info, win->partners[member].changes[1], &row);
261 STITSHOP_colorStat(info, win->partners[member].changes[1], &row);
262 row.compare = 1;
263 STITSHOP_showStat(info, win->partners[member].changes[3], &row);
264 STITSHOP_colorStat(info, win->partners[member].changes[3], &row);
265 row.skip = 1;
266 row.skip2 = 5;
267 STITSHOP_showOtherChanges(info, &win->partners[member].changes[4], &row);
268 }
269 win->partners[member].stats[0]->setString(win->partners[member].stats[0], FILE_CACHE.load(TEXT_FILE(TEXT_ITEM_SHOP)), 0xC);
270 win->partners[member].stats[1]->setString(win->partners[member].stats[1], FILE_CACHE.load(TEXT_FILE(TEXT_ITEM_SHOP)), 0xC);
271 break;
272 case 1:
273 p->rows[0] = 2;
274 row.partner = member;
275 row.stat = 1;
276 row.compare = 0;
277 STITSHOP_showStat(info, win->partners[member].changes[0], &row);
278 STITSHOP_colorStat(info, win->partners[member].changes[0], &row);
279 row.compare = 1;
280 STITSHOP_showStat(info, win->partners[member].changes[2], &row);
281 STITSHOP_colorStat(info, win->partners[member].changes[2], &row);
282 p->rows[1] = 6;
283 row.partner = member;
284 row.stat = 5;
285 row.compare = 0;
286 STITSHOP_showStat(info, win->partners[member].changes[1], &row);
287 STITSHOP_colorStat(info, win->partners[member].changes[1], &row);
288 row.compare = 1;
289 STITSHOP_showStat(info, win->partners[member].changes[3], &row);
290 STITSHOP_colorStat(info, win->partners[member].changes[3], &row);
291 row.skip = 1;
292 row.skip2 = 5;
293 STITSHOP_showOtherChanges(info, &win->partners[member].changes[4], &row);
294 win->partners[member].stats[0]->setString(win->partners[member].stats[0], FILE_CACHE.load(TEXT_FILE(TEXT_ITEM_SHOP)), 0xC);
295 win->partners[member].stats[1]->setString(win->partners[member].stats[1], FILE_CACHE.load(TEXT_FILE(TEXT_ITEM_SHOP)), 0xC);
296 break;
297 case 4:
298 case 5:
299 p->rows[0] = 6;
300 row.partner = member;
301 row.stat = 5;
302 row.compare = 0;
303 STITSHOP_showStat(info, win->partners[member].changes[0], &row);
304 STITSHOP_colorStat(info, win->partners[member].changes[0], &row);
305 row.compare = 1;
306 STITSHOP_showStat(info, win->partners[member].changes[2], &row);
307 STITSHOP_colorStat(info, win->partners[member].changes[2], &row);
308 row.skip = 5;
309 data = ITEM_FUNCS.get(info->item)->data.record;
310 /* the row of the stat the accessory raises (7 raises them all and has
311 none). The match depends on the range tests being written out: the
312 inner one isn't merged with the outer one before cse */
313 if ((data->acc.stat >= 1 && data->acc.stat <= 5) || (data->acc.stat >= 8 && data->acc.stat <= 14)) {
314 if (data->acc.stat >= 1 && data->acc.stat <= 5) {
315 p->rows[1] = data->acc.stat;
316 } else {
317 p->rows[1] = data->acc.stat - 1;
318 }
319 row.partner = member;
320 row.stat = p->rows[1] - 1;
321 row.compare = 0;
322 STITSHOP_showStat(info, win->partners[member].changes[1], &row);
323 STITSHOP_colorStat(info, win->partners[member].changes[1], &row);
324 row.compare = 1;
325 STITSHOP_showStat(info, win->partners[member].changes[3], &row);
326 STITSHOP_colorStat(info, win->partners[member].changes[3], &row);
327 win->partners[member].stats[0]->setString(win->partners[member].stats[0], FILE_CACHE.load(TEXT_FILE(TEXT_ITEM_SHOP)), 0xC);
328 win->partners[member].stats[1]->setString(win->partners[member].stats[1], FILE_CACHE.load(TEXT_FILE(TEXT_ITEM_SHOP)), 0xC);
329 row.skip2 = row.stat;
330 } else {
331 win->partners[member].changes[1]->setVisible(win->partners[member].changes[1], 0);
332 win->partners[member].changes[3]->setVisible(win->partners[member].changes[3], 0);
333 row.skip2 = -1;
334 p->rows[1] = 0;
335 win->partners[member].stats[0]->setString(win->partners[member].stats[0], FILE_CACHE.load(TEXT_FILE(TEXT_ITEM_SHOP)), 0xC);
336 win->partners[member].stats[1]->setVisible(win->partners[member].stats[1], 0);
337 }
338 STITSHOP_showOtherChanges(info, &win->partners[member].changes[4], &row);
339 break;
340 }
341}
342
343/* The y of a line of the details panel, two lower when selling. The match
344 depends on this being a function: its sum isn't folded into the offset */
345static inline s32 STITSHOP_lineY(ShopInfo *info, s32 y) {
346 return info->selling * 2 + y;
347}
348
349/* Creates the details panel's windows: the item's rows, then, when buying,
350 each partner's name, stats and stat changes */
352 s32 offset = info->selling * 0x28;
353 s16 left;
354 s16 right;
355 s32 x;
356 s32 i;
357 s32 j;
358 s32 column;
359
360 win->name = createTextWindow(info->layer, 1, 0x25, offset + STITSHOP_lineY(info, 0x73));
361 win->equippedLabel = createTextWindow(info->layer, 1, 0xA1, offset + STITSHOP_lineY(info, 0x75));
362 win->equipped = createTextWindow(info->layer, 1, 0xE1, offset + STITSHOP_lineY(info, 0x75));
363 win->ownedLabel = createTextWindow(info->layer, 1, 0xEA, offset + STITSHOP_lineY(info, 0x75));
364 win->owned = createTextWindow(info->layer, 1, 0x12A, offset + STITSHOP_lineY(info, 0x75));
365 win->priceLabel = createTextWindow(info->layer, 3, 0x11A, offset + STITSHOP_lineY(info, 0x8B));
366 win->price = createTextWindow(info->layer, 3, 0x117, offset + STITSHOP_lineY(info, 0x8B));
367 win->desc = createTextWindow(info->layer, 1, 0x14, offset + 0xA1);
368 win->desc->setLines(win->desc, 2);
369 win->kind = createTextWindow(info->layer, 1, 0x14, offset + 0xAF);
370 if (info->selling == 0) {
371 /* the match depends on the column counter of its own, apart from i, and
372 on x set from it in the stats loop */
373 column = 0;
374 for (i = 0; i < info->partyCount; i++) {
375 win->partners[i].name = createTextWindow(info->layer, 1, i * 0x63 + 0x17, 0x9E);
376 for (j = 0; j < 2; j++) {
377 x = column * 0x63;
378 win->partners[i].stats[j] = createTextWindow(info->layer, 1, i * 0x63 + 0x3C, j * 0xE + 0xAC);
379 }
380 left = x + 0x39;
381 win->partners[i].changes[0] = createTextWindow(info->layer, 1, left, 0xAC);
382 win->partners[i].changes[1] = createTextWindow(info->layer, 1, left, 0xBA);
383 right = x + 0x5A;
384 win->partners[i].changes[2] = createTextWindow(info->layer, 1, right, 0xAC);
385 win->partners[i].changes[3] = createTextWindow(info->layer, 1, right, 0xBA);
386 win->partners[i].changes[4] = createTextWindow(info->layer, 1, left, 0xC8);
387 win->partners[i].changes[5] = createTextWindow(info->layer, 1, x + 0x63, 0xC8);
388 win->partners[i].changes[6] = createTextWindow(info->layer, 1, left, 0xD6);
389 win->partners[i].changes[7] = createTextWindow(info->layer, 1, x + 0x63, 0xD6);
390 column++;
391 }
392 win->pageHint = createTextWindow(info->layer, 1, 0x13, 0x87);
393 }
394}
395
396/* Shows the item's name, how many are equipped and in the bag, and its
397 price; or hides them */
399 if (show) {
402 win->equipped->setNumber(win->equipped, 0, GAME.equippedItems[info->item]);
403 win->equipped->setRightAlign(win->equipped, 1);
405 win->owned->setNumber(win->owned, 0, GAME.items[info->item]);
406 win->owned->setRightAlign(win->owned, 1);
408 if (info->selling == 0) {
409 win->price->setNumber(win->price, 0, ITEM_FUNCS.get(info->item)->price * info->quantity);
410 } else {
411 win->price->setNumber(win->price, 0, ITEM_FUNCS.get(info->item)->sellPrice * info->quantity);
412 }
413 win->price->setRightAlign(win->price, 1);
414 } else {
415 win->name->setVisible(win->name, 0);
417 win->equipped->setVisible(win->equipped, 0);
418 win->ownedLabel->setVisible(win->ownedLabel, 0);
419 win->owned->setVisible(win->owned, 0);
420 win->priceLabel->setVisible(win->priceLabel, 0);
421 win->price->setVisible(win->price, 0);
422 }
423}
424
425/* Shows the item's description and, for a weapon, its kind; or hides them */
427 ItemInfo *item;
428 ItemData *data;
429
430 if (show) {
432 item = ITEM_FUNCS.get(info->item);
433 if (item->type >= 2 && item->type < 14) {
434 data = item->data.record;
436 return;
437 }
438 } else {
439 win->desc->setVisible(win->desc, 0);
440 }
441 win->kind->setVisible(win->kind, 0);
442}
443
444/* Shows the party's names and, for those who can equip the item, the stats
445 it changes; or hides them */
447 s32 partner;
448 s32 i;
449 s32 j;
450
451 if (show) {
452 for (i = 0; i < info->partyCount; i++) {
453 partner = GAME.funcs.getPartyMember(i);
454 win->partners[i].name->setString(win->partners[i].name, GAME.funcs.getPartnerStats(partner)->name, -1);
455 if (STITSHOP_funcs.canEquip(partner, info->item)) {
456 STITSHOP_fillPartnerRows(info, win, i);
458 } else {
460 for (j = 0; j < 2; j++) {
461 win->partners[i].stats[j]->setVisible(win->partners[i].stats[j], 0);
462 }
463 for (j = 0; j < 8; j++) {
464 win->partners[i].changes[j]->setVisible(win->partners[i].changes[j], 0);
465 }
466 }
467 }
468 } else {
469 for (i = 0; i < info->partyCount; i++) {
470 win->partners[i].name->setVisible(win->partners[i].name, 0);
471 for (j = 0; j < 2; j++) {
472 win->partners[i].stats[j]->setVisible(win->partners[i].stats[j], 0);
473 }
474 for (j = 0; j < 8; j++) {
475 win->partners[i].changes[j]->setVisible(win->partners[i].changes[j], 0);
476 }
477 }
478 }
479}
480
481/* Draws the second page's frames: the panel, then for each partner its frame
482 and either the icons of the stats the item changes or a cross */
484 SpriteDrawer sprite;
485 s32 i;
486 s32 j;
487
488 initSpriteDrawer(&sprite);
489 sprite.setLayerId(info->layer, info->depth);
490 sprite.setTexture(0x280, 0x100);
491 if (info->panels[1].level != 0) {
492 if (info->panels[1].level != ONE) {
493 sprite.setScale(info->panels[1].level, ONE, ONE);
494 sprite.setPivot(0, 0x8C);
495 }
496 sprite.draw(FILE_CACHE.getEntry(FILE_SHOP_SPRITES << 16), 9, 0, 0x81);
497 }
498 if (info->panels[3].level != 0) {
499 sprite.setScale(ONE, info->panels[3].level, ONE);
500 for (i = 0; i < info->partyCount; i++) {
501 if (info->panels[3].level != ONE) {
502 sprite.setPivot(i * 0x64 + 0x3C, 0xC0);
503 } else if (STITSHOP_funcs.canEquip(GAME.funcs.getPartyMember(i), info->item)) {
504 sprite.setTexture(0x140, 0);
505 for (j = 0; j < info->partners[i].changes; j++) {
506 if (info->partners[i].rows[j] > 0) {
507 sprite.draw(FILE_CACHE.getEntry(FILE_MENU_SPRITES << 16), info->partners[i].rows[j] + 0x24,
508 STITSHOP_changePos[j].x + i * 0x63, STITSHOP_changePos[j].y);
509 }
510 }
511 } else {
512 sprite.setTexture(0x280, 0x100);
513 sprite.draw(FILE_CACHE.getEntry(FILE_SHOP_SPRITES << 16), 0x16, i * 0x63 + 0x19, 0xAD);
514 }
515 sprite.setTexture(0x280, 0x100);
516 sprite.draw(FILE_CACHE.getEntry(FILE_SHOP_SPRITES << 16), 8, i * 0x63 + 0xB, 0x9C);
517 }
518 }
519}
520
521/* Once the item's panel (and the page hint's, for equipment) has opened: shows
522 the item's rows and the hint to turn the page, and opens the description's
523 panel */
524static inline void STITSHOP_openBuyInfo(ShopInfo *info, ShopInfoWindows *win) {
525 if (info->hasStats) {
527 }
528 if (STITSHOP_funcs.updateFade(&info->panels[0])) {
529 STITSHOP_showItemRows(info, win, 1);
530 if (info->hasStats) {
532 }
533 STITSHOP_funcs.startFade(&info->panels[2], 1);
534 info->substate++;
535 }
536}
537
538/* While the buying dialog asks to equip the item (info->nextSubstate): hides
539 the page hint and closes its panel, and the description when it is the page
540 shown */
541static inline void STITSHOP_hideBuyInfoPage(ShopInfo *info, ShopInfoWindows *win) {
542 info->shown = 0;
543 win->pageHint->setVisible(win->pageHint, 0);
544 STITSHOP_funcs.startFade(&info->panels[1], 0);
545 if (info->page == 0) {
546 STITSHOP_funcs.startFade(&info->panels[2], 0);
547 STITSHOP_showItemDesc(info, win, 0);
548 }
549 info->substate++;
550}
551
552/* Turning the page (info->turnPage): updates the page hint and closes the page
553 that was shown */
554static inline void STITSHOP_startInfoPageTurn(ShopInfo *info, ShopInfoWindows *win) {
556 if (info->page == 0) {
557 STITSHOP_funcs.startFade(&info->panels[3], 0);
558 STITSHOP_showPartnerStats(info, win, 0);
559 info->substate = 15;
560 } else {
561 STITSHOP_funcs.startFade(&info->panels[2], 0);
562 STITSHOP_showItemDesc(info, win, 0);
563 info->substate = 11;
564 }
565}
566
567/* Closing (info->close): hides the item's rows, the page hint and the page
568 shown, and closes their panels */
569static inline void STITSHOP_closeBuyInfo(ShopInfo *info, ShopInfoWindows *win) {
570 STITSHOP_showItemRows(info, win, 0);
571 win->pageHint->setVisible(win->pageHint, 0);
572 STITSHOP_funcs.startFade(&info->panels[0], 0);
573 if (info->hasStats) {
574 STITSHOP_funcs.startFade(&info->panels[1], 0);
575 }
576 if (info->page == 0) {
577 STITSHOP_showItemDesc(info, win, 0);
578 STITSHOP_funcs.startFade(&info->panels[2], 0);
579 } else {
580 STITSHOP_showPartnerStats(info, win, 0);
581 STITSHOP_funcs.startFade(&info->panels[3], 0);
582 }
583 info->substate++;
584}
585
586/* Ends the details panel once its panels have closed */
587static inline void STITSHOP_endBuyInfo(ShopInfo *info, ShopInfoWindows *win) {
588 if (info->page == 0) {
590 } else {
592 }
593 if (info->hasStats) {
595 }
596 if (STITSHOP_funcs.updateFade(&info->panels[0])) {
597 info->state = TASK_KILL;
598 }
599}
600
601/* The details panel's states when buying: fades in its first page, turns
602 between the pages (10-16), and fades out when closed (50) */
604 switch (info->substate) {
605 case 0:
606 default:
607 STITSHOP_funcs.startFade(&info->panels[0], 1);
608 if (info->hasStats) {
609 STITSHOP_funcs.startFade(&info->panels[1], 1);
610 }
611 info->substate++;
612 break;
613 case 1:
614 STITSHOP_openBuyInfo(info, win);
615 break;
616 case 2:
617 if (STITSHOP_funcs.updateFade(&info->panels[2])) {
618 STITSHOP_showItemDesc(info, win, 1);
619 info->substate++;
620 }
621 break;
622 case 3:
623 break;
624 case 4:
625 STITSHOP_hideBuyInfoPage(info, win);
626 break;
627 case 5:
629 if (STITSHOP_funcs.updateFade(&info->panels[1])) {
630 if (info->page == 0) {
631 STITSHOP_funcs.startFade(&info->panels[3], 1);
632 }
633 info->substate++;
634 }
635 break;
636 case 6:
637 if (STITSHOP_funcs.updateFade(&info->panels[3])) {
638 STITSHOP_showPartnerStats(info, win, 1);
639 info->substate++;
640 }
641 break;
642 case 7:
643 break;
644 case 8:
645 if (info->page == 0) {
646 STITSHOP_showPartnerStats(info, win, 0);
647 STITSHOP_funcs.startFade(&info->panels[3], 0);
648 }
649 STITSHOP_funcs.startFade(&info->panels[1], 1);
650 info->substate++;
651 break;
652 case 9:
654 if (STITSHOP_funcs.updateFade(&info->panels[1])) {
655 win->pageHint->setVisible(win->pageHint, 1);
656 if (info->page == 0) {
657 STITSHOP_funcs.startFade(&info->panels[2], 1);
658 }
659 info->substate = 1000;
660 }
661 break;
662 case 1000:
663 if (STITSHOP_funcs.updateFade(&info->panels[2])) {
664 if (info->page == 0) {
665 STITSHOP_showItemDesc(info, win, 1);
666 }
667 info->substate = 3;
668 info->shown = 1;
669 }
670 break;
671 case 10:
673 break;
674 case 11:
675 if (STITSHOP_funcs.updateFade(&info->panels[2])) {
676 STITSHOP_funcs.startFade(&info->panels[3], 1);
677 info->substate++;
678 }
679 break;
680 case 12:
681 if (STITSHOP_funcs.updateFade(&info->panels[3])) {
682 STITSHOP_showPartnerStats(info, win, 1);
683 info->substate = 3;
684 info->shown = 1;
685 }
686 break;
687 case 15:
688 if (STITSHOP_funcs.updateFade(&info->panels[3])) {
689 STITSHOP_funcs.startFade(&info->panels[2], 1);
690 info->substate++;
691 }
692 break;
693 case 16:
694 if (STITSHOP_funcs.updateFade(&info->panels[2])) {
695 STITSHOP_showItemDesc(info, win, 1);
696 info->substate = 3;
697 info->shown = 1;
698 }
699 break;
700 case 50:
701 STITSHOP_closeBuyInfo(info, win);
702 break;
703 case 51:
704 STITSHOP_endBuyInfo(info, win);
705 break;
706 }
707}
708
709/* The details panel's first page: fades in, shows the item, then fades out
710 when closed */
712 switch (info->substate) {
713 case 0:
714 default:
715 STITSHOP_funcs.startFade(&info->panels[0], 1);
716 info->substate++;
717 break;
718 case 1:
719 if (STITSHOP_funcs.updateFade(&info->panels[0])) {
720 STITSHOP_showItemRows(info, win, 1);
721 STITSHOP_funcs.startFade(&info->panels[2], 1);
722 info->substate++;
723 }
724 break;
725 case 2:
726 if (STITSHOP_funcs.updateFade(&info->panels[2])) {
727 STITSHOP_showItemDesc(info, win, 1);
728 info->substate++;
729 }
730 break;
731 case 3:
732 break;
733 case 50:
734 STITSHOP_showItemRows(info, win, 0);
735 STITSHOP_showItemDesc(info, win, 0);
736 STITSHOP_funcs.startFade(&info->panels[0], 0);
737 STITSHOP_funcs.startFade(&info->panels[2], 0);
738 info->substate++;
739 break;
740 case 51:
742 if (STITSHOP_funcs.updateFade(&info->panels[2])) {
743 info->state = TASK_KILL;
744 }
745 break;
746 }
747}
748
749/* The details panel: counts the party, then runs the pages and draws the
750 item's icon and frames */
752 SpriteDrawer sprite;
753 s32 offset;
754 s32 i;
755
756 switch (info->state) {
757 case TASK_INIT:
758 default:
759 info->nextState(info);
760 for (i = 0; i < 3; i++) {
761 if (GAME.funcs.getPartyMember(i) >= 0) {
762 info->partyCount++;
763 }
764 }
766 info->panels[0].duration = 10;
767 info->panels[1].duration = 10;
768 info->panels[2].duration = 10;
769 info->panels[3].duration = 10;
770 if (info->selling == 0 &&
773 info->hasStats = 1;
774 }
775 break;
776 case TASK_RUN:
777 if (info->selling == 0) {
778 STITSHOP_runBuyInfo(info, win);
779 STITSHOP_drawStatsPage(info, win);
780 } else {
781 STITSHOP_runSellInfo(info, win);
782 }
783 offset = info->selling * 0x28;
784 initSpriteDrawer(&sprite);
785 sprite.setLayerId(info->layer, info->depth - 1);
786 sprite.setTexture(0x280, 0x100);
787 if (info->panels[0].level != 0) {
788 if (info->panels[0].level != ONE) {
789 sprite.setScale(info->panels[0].level, ONE, ONE);
790 sprite.setPivot(0x140, offset + 0x81);
791 } else {
792 sprite.setTexture(0x140, 0);
794 offset + STITSHOP_lineY(info, 0x73));
795 }
796 sprite.setTexture(0x280, 0x100);
797 sprite.draw(FILE_CACHE.getEntry(FILE_SHOP_SPRITES << 16), 0xE, 0xF, offset + STITSHOP_lineY(info, 0x6C));
798 }
799 if (info->panels[2].level != 0) {
800 STRETCH_SPRITE_V(sprite, info->panels[2].level, 0xA0, offset + 0xAE);
801 sprite.draw(FILE_CACHE.getEntry(FILE_SHOP_SPRITES << 16), 3, 0, offset + 0x9C);
802 }
803 break;
804 case TASK_DONE:
805 case TASK_KILL:
806 break;
807 }
808}
809
810/* Shows an item and the quantity (for the price) in the details panel
811 (info->showItem); the windows are only refreshed while the page is shown */
812void STITSHOP_setInfoItem(ShopInfo *info, s32 item, s32 quantity) {
813 ShopInfoWindows *win = info->children;
814
815 info->item = item;
816 info->quantity = quantity;
817 if (info->shown != 0) {
818 STITSHOP_showItemRows(info, win, 1);
819 if (info->page == 0) {
820 STITSHOP_showItemDesc(info, win, 1);
821 } else {
822 STITSHOP_showItemDesc(info, win, 0);
823 STITSHOP_showPartnerStats(info, win, 1);
824 }
825 }
826}
827
828/* Closes the details panel (info->close), when it is open and idle */
830 if (info->substate == 3) {
831 info->substate = 50;
832 }
833}
834
835/* Shows or hides the weapon's kind in the details panel (info->setKindVisible) */
837 ShopInfoWindows *win = info->children;
838
839 win->kind->setVisible(win->kind, visible);
840}
841
842/* Turns the details panel between the description and the partners' stats
843 (info->turnPage); only for the items of kinds 3 to 5, which have stats */
845 if (ITEM_FUNCS.isKind(info->item, ITEM_KIND_WEAPON) != 0 || ITEM_FUNCS.isKind(info->item, ITEM_KIND_ARMOR) != 0 ||
848 info->substate = 10;
849 info->shown = 0;
850 info->page = 1 - info->page;
851 }
852}
853
854/* Refreshes the details panel once the item is equipped on a party member
855 (info->refreshPartner): the item's rows and that partner's */
857 ShopInfoWindows *win = info->children;
858
859 STITSHOP_showItemRows(info, win, 1);
860 STITSHOP_fillPartnerRows(info, win, member);
861}
862
863/* Creates the details panel (task) of the item selected, when buying or
864 selling */
866 ShopInfo *info = createTask(STITSHOP_updateInfo, sizeof(ShopInfo), 0xAC);
867
873 info->layer = SCREEN_LAYER;
874 info->depth = 6;
875 info->selling = selling;
876 info->item = item;
877 info->quantity = 1;
878 info->shown = 1;
879 return info;
880}
signed int s32
Definition common.h:11
signed short s16
Definition common.h:9
unsigned char u8
Definition common.h:8
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
#define TEXT_ITEM_INFO
ITMINF.
Definition file.h:214
#define TEXT_ITEM_SHOP
ITSHOP: STITSHOP's.
Definition file.h:216
#define TEXT_FILE(file)
Definition file.h:190
#define TEXT_ITEM_NAMES
ITMNAM.
Definition file.h:215
#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 IS_WEAPON_TYPE(type)
ItemInfo.type's ranges: 2-14 weapons, 15-20 armour, 21-24 accessories, each tested as one unsigned by...
Definition game_state.h:235
#define STAT_STRENGTH
the six battle stats
Definition game_state.h:286
#define ITEM_KIND_ACCESSORY
Definition game_state.h:222
#define IS_ARMOR_TYPE(type)
Definition game_state.h:236
#define IS_ACCESSORY_TYPE(type)
Definition game_state.h:237
#define STAT_SPEED
Definition game_state.h:290
#define ITEM_KIND_WEAPON
Definition game_state.h:220
#define STAT_DEFENSE
Definition game_state.h:287
#define STAT_CHARISMA
Definition game_state.h:291
#define STAT_RESISTS
the first of the seven resistances
Definition game_state.h:292
#define ITEM_KIND_ARMOR
Definition game_state.h:221
#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
#define STRETCH_SPRITE_V(sprite, level, x, y)
Definition gfx.h:274
void STITSHOP_computeStats(s32 partner, StatBlock *out)
A partner's stats with its equipment, as main's computeStats gives them: the weapons' attack (STAT_ST...
Definition info.c:10
void STITSHOP_showItemRows(ShopInfo *info, ShopInfoWindows *win, s32 show)
Shows the item's name, how many are equipped and in the bag, and its price; or hides them.
Definition info.c:398
ShopInfo * STITSHOP_createInfo(s32 selling, s32 item)
Creates the details panel (task) of the item selected, when buying or selling.
Definition info.c:865
void STITSHOP_createInfoWindows(ShopInfo *info, ShopInfoWindows *win)
Creates the details panel's windows: the item's rows, then, when buying, each partner's name,...
Definition info.c:351
void STITSHOP_refreshPartner(ShopInfo *info, s32 member)
Refreshes the details panel once the item is equipped on a party member (info->refreshPartner): the i...
Definition info.c:856
void STITSHOP_showOtherChanges(ShopInfo *info, TextWindow **win, ShopStatRow *row)
Shows the new values of the other stats the item would change (palette 1 up, 5 down),...
Definition info.c:171
static s32 STITSHOP_lineY(ShopInfo *info, s32 y)
The y of a line of the details panel, two lower when selling.
Definition info.c:345
void STITSHOP_drawStatsPage(ShopInfo *info, ShopInfoWindows *win)
Draws the second page's frames: the panel, then for each partner its frame and either the icons of th...
Definition info.c:483
static void STITSHOP_openBuyInfo(ShopInfo *info, ShopInfoWindows *win)
Once the item's panel (and the page hint's, for equipment) has opened: shows the item's rows and the ...
Definition info.c:524
static void STITSHOP_closeBuyInfo(ShopInfo *info, ShopInfoWindows *win)
Closing (info->close): hides the item's rows, the page hint and the page shown, and closes their pane...
Definition info.c:569
static void STITSHOP_endBuyInfo(ShopInfo *info, ShopInfoWindows *win)
Ends the details panel once its panels have closed.
Definition info.c:587
void STITSHOP_fillPartnerRows(ShopInfo *info, ShopInfoWindows *win, s32 member)
Fills a partner's rows of the details panel's second page: the stats of the slot the item goes in,...
Definition info.c:203
void STITSHOP_addStat(s16 *p, s32 stat, s32 delta)
Adds an item's bonus to a stat, up to 999: 1 to 6 one of the six battle stats, 7 all of them,...
Definition info.c:87
void STITSHOP_closeInfo(ShopInfo *info)
Closes the details panel (info->close), when it is open and idle.
Definition info.c:829
void STITSHOP_runSellInfo(ShopInfo *info, ShopInfoWindows *win)
The details panel's first page: fades in, shows the item, then fades out when closed.
Definition info.c:711
void STITSHOP_updateInfo(ShopInfo *info, ShopInfoWindows *win)
The details panel: counts the party, then runs the pages and draws the item's icon and frames.
Definition info.c:751
void STITSHOP_showStat(ShopInfo *info, TextWindow *win, ShopStatRow *row)
Shows a row's stat of a partner in the details panel: as it is, or with the item equipped when the ro...
Definition info.c:116
void STITSHOP_setKindVisible(ShopInfo *info, s32 visible)
Shows or hides the weapon's kind in the details panel (info->setKindVisible)
Definition info.c:836
static void STITSHOP_hideBuyInfoPage(ShopInfo *info, ShopInfoWindows *win)
While the buying dialog asks to equip the item (info->nextSubstate): hides the page hint and closes i...
Definition info.c:541
void STITSHOP_turnInfoPage(ShopInfo *info)
Turns the details panel between the description and the partners' stats (info->turnPage); only for th...
Definition info.c:844
void STITSHOP_showItemDesc(ShopInfo *info, ShopInfoWindows *win, s32 show)
Shows the item's description and, for a weapon, its kind; or hides them.
Definition info.c:426
static void STITSHOP_startInfoPageTurn(ShopInfo *info, ShopInfoWindows *win)
Turning the page (info->turnPage): updates the page hint and closes the page that was shown.
Definition info.c:554
void STITSHOP_setInfoItem(ShopInfo *info, s32 item, s32 quantity)
Shows an item and the quantity (for the price) in the details panel (info->showItem); the windows are...
Definition info.c:812
void STITSHOP_showPartnerStats(ShopInfo *info, ShopInfoWindows *win, s32 show)
Shows the party's names and, for those who can equip the item, the stats it changes; or hides them.
Definition info.c:446
void STITSHOP_runBuyInfo(ShopInfo *info, ShopInfoWindows *win)
The details panel's states when buying: fades in its first page, turns between the pages (10-16),...
Definition info.c:603
void STITSHOP_colorStat(ShopInfo *info, TextWindow *win, ShopStatRow *row)
Colors a row's stat: palette 1 when the item would raise it, 5 when it would lower it,...
Definition info.c:132
STITSHOP.PRO: the item shop.
#define FILE_SHOP_SPRITES
The shop's sprite sheet; the next file is its texture archive.
Definition item_shop.h:19
ItemFuncs ITEM_FUNCS
Definition items.c:890
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_MOVE
SYSTEM06.
Definition sound.h:43
void initSpriteDrawer(SpriteDrawer *obj)
Clears a sprite drawer to neutral (no scale, gray tint, follows the scroll), gives it its methods and...
s32 STITSHOP_stats[]
The stats the info shows, in PartnerTotals.stats: six battle stats, then the resistances.
Definition stitshop.c:15
s32 STITSHOP_kindStrings[]
The strings of the item kinds (the records' kind)
Definition stitshop.c:21
ItemShopFuncs STITSHOP_funcs
The shop's helpers.
Definition stitshop.c:228
Vec2 STITSHOP_changePos[]
Where the stat change arrows go in a partner's column.
Definition stitshop.c:10
u16 amounts[2]
Definition game_state.h:167
u8 stats[2]
Definition game_state.h:168
void *(* load)(u32 file)
Definition file.h:92
void *(* getEntry)(u32 fileAndIndex)
Definition file.h:96
struct PartnerStats *(* getPartnerStats)(s32 partner)
Definition game_state.h:38
s32(* getPartyMember)(u32 index)
Definition game_state.h:24
The game state (GAME): the first 0x26BC bytes are what newGame clears (the save data),...
Definition game_state.h:491
s8 items[0x193]
counts, up to 99
Definition game_state.h:512
Partner partners[PARTNER_COUNT]
Definition game_state.h:517
s8 equippedItems[0x193]
Definition game_state.h:513
GameFuncs funcs
Definition game_state.h:582
s32(* getCategory)(s32 item)
getItemCategory
Definition game_state.h:671
s32(* isKind)(s32 item, s32 kind)
ItemInfo.kind == kind.
Definition game_state.h:672
struct ItemInfo *(* get)(s32 item)
getItem
Definition game_state.h:670
An item (ITEMS, ITEM_FUNCS)
Definition game_state.h:225
u8 type
2-14 weapons, 15-20 armour, 21-24 accessories
Definition game_state.h:230
u16 sellPrice
0: cannot be sold
Definition game_state.h:228
ItemRecord data
the type's record, or the usable items' effect
Definition game_state.h:226
void(* equip)(s32 partner, s32 slot, s32 item, s32 fromBag)
Definition item_shop.h:235
s32(* updateFade)(PanelAnim *fade)
Definition item_shop.h:229
void(* startFade)(PanelAnim *fade, s32 fadeIn)
Definition item_shop.h:228
s32(* compareEquip)(s32 partner, s32 item)
Definition item_shop.h:234
s32(* canEquip)(s32 partner, s32 item)
Definition item_shop.h:233
s32 level
Definition menu.h:21
s32 duration
Definition menu.h:19
PartnerStats.equip as a whole: STSTATUS and STITSHOP save it with a struct copy before they equip an ...
Definition game_state.h:318
A partner Digimon from its name on (Partner.info), as getPartnerStats gives it.
Definition game_state.h:303
s16 stats[19]
Definition game_state.h:306
char name[0x18]
Definition game_state.h:304
PartnerStats info
Definition game_state.h:349
TextWindow * changes[8]
Definition item_shop.h:91
TextWindow * name
Definition item_shop.h:89
TextWindow * stats[2]
Definition item_shop.h:90
TextWindow * pageHint
Definition item_shop.h:105
TextWindow * equippedLabel
Definition item_shop.h:96
TextWindow * price
Definition item_shop.h:101
TextWindow * kind
the weapons'
Definition item_shop.h:103
TextWindow * owned
GAME.items.
Definition item_shop.h:99
TextWindow * priceLabel
Definition item_shop.h:100
TextWindow * name
Definition item_shop.h:95
TextWindow * desc
Definition item_shop.h:102
ShopInfoPartner partners[3]
Definition item_shop.h:104
TextWindow * ownedLabel
Definition item_shop.h:98
TextWindow * equipped
GAME.equippedItems.
Definition item_shop.h:97
The panel with the selected item's details (STITSHOP_createInfo)
Definition item_shop.h:67
s32 hasStats
Definition item_shop.h:77
void(* nextState)(struct ShopInfo *task)
Definition item_shop.h:68
void(* turnPage)(struct ShopInfo *info)
Definition item_shop.h:83
s32 state
Definition item_shop.h:68
void(* showItem)(struct ShopInfo *info, s32 item, s32 quantity)
Definition item_shop.h:80
void(* close)(struct ShopInfo *info)
Definition item_shop.h:81
s32 partyCount
Definition item_shop.h:73
s32 selling
Definition item_shop.h:71
s32 substate
Definition item_shop.h:68
s32 quantity
Definition item_shop.h:76
void * children
Definition item_shop.h:68
void(* setKindVisible)(struct ShopInfo *info, s32 visible)
Definition item_shop.h:82
s32 page
0: the description, 1: the partners' stats
Definition item_shop.h:72
s32 item
Definition item_shop.h:75
s32 depth
Definition item_shop.h:70
PanelAnim panels[4]
Definition item_shop.h:79
s32 shown
Definition item_shop.h:78
s32 layer
Definition item_shop.h:69
void(* refreshPartner)(struct ShopInfo *info, s32 member)
Definition item_shop.h:84
ShopPartnerInfo partners[3]
Definition item_shop.h:74
What the details panel shows of a partner.
Definition item_shop.h:49
s32 changes
how many of the stats would change
Definition item_shop.h:53
StatBlock current
Definition item_shop.h:50
s32 rows[8]
from 2: the stats that change (from 1)
Definition item_shop.h:54
StatBlock withItem
with the item equipped
Definition item_shop.h:51
A row of the details panel's stats.
Definition item_shop.h:58
s32 skip2
-1: none
Definition item_shop.h:63
s32 compare
show the stat with the item equipped
Definition item_shop.h:61
s32 stat
into STITSHOP_stats
Definition item_shop.h:60
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(* draw)()
(sheet, frame, x, y)
Definition gfx.h:246
void(* setTexture)()
(x, y)
Definition gfx.h:242
PartnerStats' stats[] and the status[] after them as one block, which computeStats and STITSHOP_compu...
Definition game_state.h:324
s16 stats[19]
Definition game_state.h:325
s16 penalties[3]
subtracted from STAT_STRENGTH, STAT_DEFENSE and STAT_SPEED
Definition game_state.h:326
A text window (createTextWindow): up to six text buffers (0 is shown, 1-5 are "work" buffers that con...
Definition text.h:131
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(* setLines)()
no prototype: callers would truncate u8 args
Definition text.h:184
void(* setNumber)()
Definition text.h:166
void(* setString)()
Definition text.h:165
void(* setVisible)(struct TextWindow *obj, u8 arg)
Definition text.h:177
s32 y
Definition gfx.h:354
s32 x
Definition gfx.h:353
u16 amounts[2]
what it adds to stats[]
Definition game_state.h:149
u8 kind
EQUIP_KIND_*.
Definition game_state.h:146
u8 stats[2]
Definition game_state.h:151
s16 charisma
what it adds to STAT_CHARISMA (computeStats); armour and accessories too
Definition game_state.h:145
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_PURPLE
Definition text.h:118
#define PALETTE_RED
Definition text.h:117
#define PALETTE_WHITE
The text windows' palettes (TextWindow.palette, setPalette): rows of the font's CLUTs,...
Definition text.h:112
#define PALETTE_GREY
what is unavailable
Definition text.h:119
TextWindow * createTextWindow(s16 layerId, s16 style, s16 x, s16 y)
A text window on a layer, in a font style, at (x, y)
ItemInfo.data's record, by ItemInfo.type.
Definition game_state.h:188
ArmorData armor
Definition game_state.h:190
AccessoryData acc
Definition game_state.h:191
WeaponData weapon
Definition game_state.h:189
ItemData * record
Definition game_state.h:210