Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
buy.c
Go to the documentation of this file.
1/* The screen that buys cards from a shop's stock */
2
4
5/* Creates the screen's windows and its cursor */
7 win->name = createTextWindow(buy->layer, 1, 0x88, 0x80);
8 win->pointsLabel = createTextWindow(buy->layer, 1, 0x115, 0x80);
9 win->points = createTextWindow(buy->layer, 1, 0x126, 0x80);
10 win->countLabel = createTextWindow(buy->layer, 1, 0x115, 0xA6);
11 win->count = createTextWindow(buy->layer, 1, 0x12C, 0xA6);
12 win->text = createTextWindow(buy->layer, 1, 0x50, 0x97);
13 win->apLabel = createTextWindow(buy->layer, 1, 0xCE, 0x97);
14 win->ap = createTextWindow(buy->layer, 1, 0xF0, 0x97);
15 win->hpLabel = createTextWindow(buy->layer, 1, 0xCE, 0xA4);
16 win->hp = createTextWindow(buy->layer, 1, 0xF0, 0xA4);
17 win->price = createTextWindow(buy->layer, 3, 0x117, 0xC7);
18 win->priceLabel = createTextWindow(buy->layer, 3, 0x11A, 0xC7);
19 win->prev = createTextWindow(buy->layer, 1, 0x12, 0x67);
20 win->next = createTextWindow(buy->layer, 1, 0x121, 0x67);
21 win->next->setDepth(win->next, buy->depth);
22 win->message = createTextWindow(buy->layer, 1, 0x9A, 0x39);
23 win->yes = createTextWindow(buy->layer, 1, 0xC5, 0x56);
24 win->no = createTextWindow(buy->layer, 1, 0xC5, 0x66);
25 win->cursor = createCursor(buy->layer, buy->depth - 3, 0xB8, 0x56);
26 win->cursor->setVisible(win->cursor, 0);
27}
28
29/* Shows (or hides) the card under the cursor's name, price, how many the
30 player has and its text or numbers */
32 CardDrawer drawer;
33 s32 card;
34
35 card = buy->stock->cards[buy->page * 6 + buy->column];
36 if (show) {
37 initCardDrawer(&drawer);
38 drawer.setCard(card);
41 win->price->setNumber(win->price, 0, STCRDSHP_funcs.getPrice(card));
42 win->price->setRightAlign(win->price, 1);
44 win->count->setNumber(win->count, 0, GAME.cards[card]);
45 win->count->setRightAlign(win->count, 1);
46 if (drawer.getKind() != 0) {
47 win->pointsLabel->setVisible(win->pointsLabel, 0);
48 win->points->setVisible(win->points, 0);
50 win->apLabel->setVisible(win->apLabel, 0);
51 win->ap->setVisible(win->ap, 0);
52 win->hpLabel->setVisible(win->hpLabel, 0);
53 win->hp->setVisible(win->hp, 0);
54 } else {
56 win->points->setNumber(win->points, 0, drawer.card->points);
57 win->points->setRightAlign(win->points, 1);
58 if (card == 0x45 || card == 0x70 || card == 0x9B || card == 0xC6 || card == 0xF1) {
60 win->apLabel->setVisible(win->apLabel, 0);
61 win->ap->setVisible(win->ap, 0);
62 win->hpLabel->setVisible(win->hpLabel, 0);
63 win->hp->setVisible(win->hp, 0);
64 } else {
65 win->text->setVisible(win->text, 0);
67 win->ap->setNumber(win->ap, 0, drawer.card->ap);
68 win->ap->setRightAlign(win->ap, 1);
70 win->hp->setNumber(win->hp, 0, drawer.card->hp);
71 win->hp->setRightAlign(win->hp, 1);
72 }
73 }
74 } else {
75 win->name->setVisible(win->name, 0);
76 win->priceLabel->setVisible(win->priceLabel, 0);
77 win->price->setVisible(win->price, 0);
78 win->countLabel->setVisible(win->countLabel, 0);
79 win->count->setVisible(win->count, 0);
80 win->pointsLabel->setVisible(win->pointsLabel, 0);
81 win->points->setVisible(win->points, 0);
82 win->text->setVisible(win->text, 0);
83 win->apLabel->setVisible(win->apLabel, 0);
84 win->ap->setVisible(win->ap, 0);
85 win->hpLabel->setVisible(win->hpLabel, 0);
86 win->hp->setVisible(win->hp, 0);
87 }
88}
89
90/* Draws the screen: the card under the cursor's frames, the cursor, the
91 arrows and the title */
93 SpriteDrawer sprite;
94 CardDrawer drawer;
95 s32 card;
96 s32 kind;
97 s32 frame;
98
99 initSpriteDrawer(&sprite);
100 sprite.setTexture(0x280, 0);
101 sprite.setLayerId(buy->layer, buy->depth);
102 card = buy->stock->cards[buy->page * 6 + buy->column];
103 if (buy->fades[0].level != 0) {
104 initCardDrawer(&drawer);
105 drawer.setCard(card);
106 if (buy->fades[0].level != ONE) {
107 sprite.setScale(buy->fades[0].level, ONE, ONE);
108 sprite.setPivot(0x140, 0x87);
109 }
110 kind = drawer.getKind();
111 if (kind == 1) {
112 frame = 0x12;
113 } else if (kind == 2) {
114 frame = 0x13;
115 } else {
116 frame = drawer.card->color + 0x13;
117 }
118 sprite.draw(FILE_CACHE.getEntry(FILE_CARDSHOP_SPRITES << 16), frame, 0x103, 0x7E);
119 sprite.draw(FILE_CACHE.getEntry(FILE_CARDSHOP_SPRITES << 16), 0xD, 0xFC, 0x7C);
120 if (buy->fades[0].level != ONE) {
121 sprite.setPivot(0x140, 0x87);
122 }
123 sprite.draw(FILE_CACHE.getEntry(FILE_CARDSHOP_SPRITES << 16), 0xA, 0x82, 0x7C);
124 if (buy->fades[0].level != ONE) {
125 sprite.setPivot(0x140, 0xAF);
126 }
127 sprite.draw(FILE_CACHE.getEntry(FILE_CARDSHOP_SPRITES << 16), 0x10, 0x103, 0xA4);
128 sprite.draw(FILE_CACHE.getEntry(FILE_CARDSHOP_SPRITES << 16), 0xD, 0xFC, 0xA2);
129 if (buy->fades[0].level != ONE) {
130 sprite.setPivot(0x140, 0xA5);
131 }
132 if (kind != 0) {
133 sprite.draw(FILE_CACHE.getEntry(FILE_CARDSHOP_SPRITES << 16), 0xB, 0x4A, 0x92);
134 } else if (card == 0x45 || card == 0x70 || card == 0x9B || card == 0xC6 || card == 0xF1) {
135 sprite.draw(FILE_CACHE.getEntry(FILE_CARDSHOP_SPRITES << 16), 0xB, 0x4A, 0x92);
136 } else {
137 sprite.draw(FILE_CACHE.getEntry(FILE_CARDSHOP_SPRITES << 16), 0xC, 0xC7, 0x92);
138 }
139 if (buy->fades[1].level != ONE) {
140 sprite.setPivot(0x140, 0xC8);
141 }
142 sprite.draw(FILE_CACHE.getEntry(FILE_CARDSHOP_SPRITES << 16), 0x29, 0xD6, 0xBF);
143 }
144 if (buy->cursorShown != 0) {
145 if (GFX.funcs.getTime() - buy->cursorTime >= 4) {
146 buy->cursorTime = GFX.funcs.getTime();
147 if (++buy->cursorFrame >= 6) {
148 buy->cursorFrame = 0;
149 }
150 }
152 sprite.draw(FILE_CACHE.getEntry(FILE_CARDSHOP_SPRITES << 16), 7, buy->column * 0x2A + 0x24, 0x44);
153 sprite.setClutRow(0);
154 if (buy->pages >= 2) {
155 if (GFX.funcs.getTime() - buy->arrowsTime >= 0x11) {
156 buy->arrowsTime = GFX.funcs.getTime();
157 buy->arrowsShown = 1 - buy->arrowsShown;
158 }
159 if (buy->fades[0].level == ONE && buy->arrowsShown != 0) {
160 if (buy->page > 0) {
161 sprite.draw(FILE_CACHE.getEntry(FILE_CARDSHOP_SPRITES << 16), 0x1A, 0xE, 0x55);
162 }
163 if (buy->page < buy->pages - 1) {
164 sprite.draw(FILE_CACHE.getEntry(FILE_CARDSHOP_SPRITES << 16), 0x1B, 0x121, 0x55);
165 }
166 }
167 }
168 }
169 if (buy->fades[1].level != 0) {
170 initSpriteDrawer(&sprite);
171 sprite.setTexture(0x280, 0);
172 sprite.setLayerId(buy->layer, buy->depth - 2);
173 if (buy->fades[1].level != ONE) {
174 sprite.setScale(buy->fades[1].level, ONE, ONE);
175 sprite.setPivot(0x140, 0x3F);
176 }
177 sprite.draw(FILE_CACHE.getEntry(FILE_CARDSHOP_SPRITES << 16), 0x2C, 0x7B, 0x33);
178 if (buy->fades[2].level != 0) {
179 if (buy->fades[2].level != ONE) {
180 sprite.setScale(buy->fades[2].level, ONE, ONE);
181 sprite.setPivot(0x140, 0x64);
182 }
183 sprite.draw(FILE_CACHE.getEntry(FILE_CARDSHOP_SPRITES << 16), 0x2D, 0xAF, 0x50);
184 }
185 }
186}
187
188/* Once the card's panel has opened: shows the cursor, the card under it and
189 the R1 arrow's label when there is a next page */
191 if (STCRDSHP_funcs.updateFade(&buy->fades[0])) {
192 buy->cursorShown = 1;
193 STCRDSHP_showBuyCard(buy, win, 1);
194 if (buy->pages >= 2) {
195 if (buy->page < buy->pages - 1) {
197 } else {
198 win->next->setVisible(win->next, 0);
199 }
200 }
201 buy->substate++;
202 }
203}
204
205/* L1/R1 turn the page: the cursor goes back to its first card, the grid
206 lays out the page's cards and the arrows' labels show where there are more */
208 s32 old;
209 s32 i;
210
211 old = buy->page;
212 if (!PAD_HELD(PAD_R1) && PAD_PRESSED(PAD_L1)) {
213 buy->page--;
214 if (buy->page < 0) {
215 buy->page = 0;
216 }
217 } else if (!PAD_HELD(PAD_L1) && PAD_PRESSED(PAD_R1)) {
218 buy->page++;
219 if (buy->page > buy->pages - 1) {
220 buy->page = buy->pages - 1;
221 }
222 }
223 if (old != buy->page) {
225 buy->cursorShown = 0;
226 buy->column = 0;
227 for (i = 0; i < 6; i++) {
228 buy->cards[i] = buy->stock->cards[buy->page * 6 + i];
229 }
230 win->grid->setCards(win->grid, buy->cards);
231 if (buy->pages >= 2) {
232 if (buy->page > 0) {
234 } else {
235 win->prev->setVisible(win->prev, 0);
236 }
237 if (buy->page < buy->pages - 1) {
239 } else {
240 win->next->setVisible(win->next, 0);
241 }
242 }
243 buy->substate = 1;
244 }
245}
246
247/* The cursor on the page's cards: left/right move it (only onto a card), L1/R1
248 turn the page and lay out its cards; cross asks to buy the card, unless the
249 money is short or the player has 9 of it (a message), triangle leaves */
251 CardDrawer drawer;
252 s32 old;
253
254 old = buy->column;
256 buy->column--;
257 if (buy->column < 0) {
258 buy->column = 0;
259 }
261 buy->column++;
262 if (buy->column >= 6) {
263 buy->column = 5;
264 }
265 }
266 if (old != buy->column) {
267 if (buy->stock->cards[buy->page * 6 + buy->column] != 0) {
269 STCRDSHP_showBuyCard(buy, win, 1);
270 } else {
271 buy->column = old;
272 }
273 }
274 STCRDSHP_turnBuyPage(buy, win);
275 if (PAD_PRESSED(PAD_CROSS)) {
276 initCardDrawer(&drawer);
277 buy->chosen = buy->stock->cards[buy->page * 6 + buy->column];
278 drawer.setCard(buy->chosen);
279 buy->price = STCRDSHP_funcs.getPrice(buy->chosen);
281 if (GAME.money < buy->price) {
282 buy->substate = 10;
283 buy->step = 0x13;
284 } else if (GAME.cards[buy->chosen] == 9) {
285 buy->substate = 10;
286 buy->step = 0x14;
287 } else {
288 buy->substate = 5;
289 }
290 } else if (PAD_PRESSED(PAD_TRIANGLE)) {
292 buy->substate = 50;
293 }
294}
295
296/* Once the total's panels have opened: shows the price with buy and no, and
297 the cursor */
300 if (STCRDSHP_funcs.updateFade(&buy->fades[1])) {
302 win->message->setNumber(win->message, 1, buy->price);
305 win->cursor->setPos(win->cursor, 0xB8, buy->choice * 0x10 + 0x56);
306 win->cursor->setVisible(win->cursor, 1);
307 buy->substate++;
308 }
309}
310
311/* Buy or no to the price: buy adds the card and pays for it; triangle declines */
313 s32 old;
314
315 old = buy->choice;
316 if (PAD_PRESSED(PAD_UP)) {
317 buy->choice = 0;
318 } else if (PAD_PRESSED(PAD_DOWN)) {
319 buy->choice = 1;
320 }
321 if (old != buy->choice) {
323 win->cursor->setPos(win->cursor, 0xB8, buy->choice * 0x10 + 0x56);
324 }
325 if (PAD_PRESSED(PAD_CROSS)) {
327 if (buy->choice == 0) {
328 GAME.funcs.addCards(buy->chosen, 1);
329 GAME.money -= buy->price;
330 buy->shop->showMoney(buy->shop);
331 }
332 buy->substate++;
333 } else if (PAD_PRESSED(PAD_TRIANGLE)) {
335 buy->substate++;
336 }
337}
338
339/* Hides the total, its answers and the cursor, and closes the panel */
341 win->message->setVisible(win->message, 0);
342 win->yes->setVisible(win->yes, 0);
343 win->no->setVisible(win->no, 0);
344 win->cursor->setVisible(win->cursor, 0);
345 buy->choice = 0;
346 STCRDSHP_funcs.startFade(&buy->fades[1], 0);
347 buy->substate++;
348}
349
350/* Leaving: hides the cursor, the arrows' labels and the card, and closes its
351 panel */
352static inline void STCRDSHP_closeBuy(CardShopBuy *buy, CardShopBuyWindows *win) {
353 buy->cursorShown = 0;
354 win->prev->setVisible(win->prev, 0);
355 win->next->setVisible(win->next, 0);
356 STCRDSHP_showBuyCard(buy, win, 0);
357 STCRDSHP_funcs.startFade(&buy->fades[0], 0);
358 buy->substate++;
359}
360
361/* The states of the screen to buy cards: picking a card (left/right, L1/R1
362 for the pages), the yes/no to buy it and the messages when the player
363 can't */
365 if (win->grid->state != TASK_RUN) {
366 return;
367 }
368 switch (buy->substate) {
369 case 0:
370 default:
371 STCRDSHP_funcs.startFade(&buy->fades[0], 1);
372 buy->substate++;
373 break;
374 case 1:
375 STCRDSHP_openBuyCard(buy, win);
376 break;
377 case 2:
378 STCRDSHP_chooseBuyCard(buy, win);
379 break;
380 case 5:
381 STCRDSHP_funcs.startFade(&buy->fades[1], 1);
382 STCRDSHP_funcs.startFade(&buy->fades[2], 1);
383 buy->substate++;
384 break;
385 case 6:
386 STCRDSHP_openBuyTotal(buy, win);
387 break;
388 case 7:
389 STCRDSHP_confirmBuyCard(buy, win);
390 break;
391 case 8:
392 STCRDSHP_closeBuyTotal(buy, win);
393 break;
394 case 10:
395 STCRDSHP_funcs.startFade(&buy->fades[1], 1);
396 buy->fades[2].level = 0;
397 buy->substate++;
398 break;
399 case 11:
400 if (STCRDSHP_funcs.updateFade(&buy->fades[1])) {
402 buy->substate++;
403 }
404 break;
405 case 12:
408 win->message->setVisible(win->message, 0);
409 STCRDSHP_funcs.startFade(&buy->fades[1], 0);
410 buy->substate++;
411 }
412 break;
413 case 9:
414 case 13:
415 if (STCRDSHP_funcs.updateFade(&buy->fades[1])) {
416 buy->substate = 1;
417 }
418 break;
419 case 50:
420 STCRDSHP_closeBuy(buy, win);
421 break;
422 case 51:
423 if (STCRDSHP_funcs.updateFade(&buy->fades[0])) {
424 win->grid->hide(win->grid);
425 buy->state = TASK_DONE;
426 }
427 break;
428 }
429}
430
431/* The buy screen's update: takes the shop's stock, six cards a page. The
432 match depends on pages holding the remainder first and the partial page
433 being a variable of its own. */
435 s32 i;
436 s32 extra;
437 s32 pages;
438
439 switch (buy->state) {
440 case TASK_INIT:
441 default:
442 buy->nextState(buy);
443 buy->stock = STCRDSHP_funcs.getStock(buy->shopId);
444 for (i = 0; i < 6; i++) {
445 buy->cards[i] = buy->stock->cards[i];
446 }
447 buy->count = buy->stock->count;
448 pages = buy->count % 6;
449 extra = pages != 0;
450 pages = buy->count / 6 + extra;
451 buy->pages = pages;
452 win->grid = STCRDSHP_createGrid(buy->shop, buy->cards);
454 buy->fades[0].duration = 10;
455 buy->fades[1].duration = 10;
456 buy->fades[2].duration = 10;
457 break;
458 case TASK_RUN:
459 STCRDSHP_runBuy(buy, win);
460 STCRDSHP_drawBuy(buy);
461 break;
462 case TASK_DONE:
463 if (win->grid == NULL) {
464 buy->state = TASK_KILL;
465 }
466 break;
467 case TASK_KILL:
468 break;
469 }
470}
471
472/* Creates the screen to buy the cards of a shop */
475
476 buy->layer = SCREEN_LAYER;
477 buy->depth = 6;
478 buy->shop = shop;
479 buy->shopId = shopId;
480 return buy;
481}
482
483/* The CLUT rows of the cursor's frames */
485 0, 1, 2, 3,
486 2, 1,
487};
void STCRDSHP_showBuyCard(CardShopBuy *buy, CardShopBuyWindows *win, s32 show)
Shows (or hides) the card under the cursor's name, price, how many the player has and its text or num...
Definition buy.c:31
void STCRDSHP_runBuy(CardShopBuy *buy, CardShopBuyWindows *win)
The states of the screen to buy cards: picking a card (left/right, L1/R1 for the pages),...
Definition buy.c:364
s32 STCRDSHP_cursorRows[]
The CLUT rows of the cursor's frames.
Definition buy.c:484
static void STCRDSHP_confirmBuyCard(CardShopBuy *buy, CardShopBuyWindows *win)
Buy or no to the price: buy adds the card and pays for it; triangle declines.
Definition buy.c:312
static void STCRDSHP_openBuyTotal(CardShopBuy *buy, CardShopBuyWindows *win)
Once the total's panels have opened: shows the price with buy and no, and the cursor.
Definition buy.c:298
static void STCRDSHP_closeBuy(CardShopBuy *buy, CardShopBuyWindows *win)
Leaving: hides the cursor, the arrows' labels and the card, and closes its panel.
Definition buy.c:352
static void STCRDSHP_chooseBuyCard(CardShopBuy *buy, CardShopBuyWindows *win)
The cursor on the page's cards: left/right move it (only onto a card), L1/R1 turn the page and lay ou...
Definition buy.c:250
static void STCRDSHP_openBuyCard(CardShopBuy *buy, CardShopBuyWindows *win)
Once the card's panel has opened: shows the cursor, the card under it and the R1 arrow's label when t...
Definition buy.c:190
void STCRDSHP_drawBuy(CardShopBuy *buy)
Draws the screen: the card under the cursor's frames, the cursor, the arrows and the title.
Definition buy.c:92
CardShopBuy * STCRDSHP_createBuy(CardShop *shop, s32 shopId)
Creates the screen to buy the cards of a shop.
Definition buy.c:473
void STCRDSHP_updateBuy(CardShopBuy *buy, CardShopBuyWindows *win)
The buy screen's update: takes the shop's stock, six cards a page.
Definition buy.c:434
void STCRDSHP_createBuyWindows(CardShopBuy *buy, CardShopBuyWindows *win)
Creates the screen's windows and its cursor.
Definition buy.c:6
static void STCRDSHP_turnBuyPage(CardShopBuy *buy, CardShopBuyWindows *win)
L1/R1 turn the page: the cursor goes back to its first card, the grid lays out the page's cards and t...
Definition buy.c:207
static void STCRDSHP_closeBuyTotal(CardShopBuy *buy, CardShopBuyWindows *win)
Hides the total, its answers and the cursor, and closes the panel.
Definition buy.c:340
void initCardDrawer(CardDrawer *obj)
Clears a card drawer, gives it its methods and binds it.
CardPackGrid * STCRDSHP_createGrid(CardShop *owner, s32 *cards)
Creates the grid of six cards, copying the cards given.
Definition card_grid.c:208
STCRDSHP.PRO: the card packs (mode 0x1300).
#define FILE_CARDSHOP_SPRITES
The sprite sheet of the screen, the shop's textures and the card data (five files,...
Definition card_packs.h:34
CardShopFuncs STCRDSHP_funcs
The shops' helpers.
Definition shop.c:440
#define NULL
Definition common.h:17
signed int s32
Definition common.h:11
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
#define TEXT_CARD_SHOP
CRDSHP: STCRDSHP's, and STCRDDEK's.
Definition file.h:207
#define TEXT_CARD_NAMES
CARDNM.
Definition file.h:203
#define TEXT_CARD_EFFECTS
CARDST.
Definition file.h:204
#define TEXT_FILE(file)
Definition file.h:190
FileCache FILE_CACHE
The file cache.
Definition file_cache.c:7
#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 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_L1
Definition pad.h:28
#define PAD_LEFT
Definition pad.h:25
#define PAD_HELD(button)
Definition pad.h:142
#define PAD_R1
Definition pad.h:29
#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_MENU_MOVE
SYSTEM06.
Definition sound.h:43
#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...
Draws the cards' images (CardImage), from files 0x7E7-0x7EB.
Definition gfx.h:193
void(* setCard)()
(id)
Definition gfx.h:205
s32(* getKind)(void)
Definition gfx.h:214
CardImage * card
Definition gfx.h:194
u8 hp
Definition gfx.h:175
u8 color
from 1
Definition gfx.h:173
u8 ap
Definition gfx.h:174
u8 points
what it adds to its colour
Definition gfx.h:179
void(* setCards)(struct CardPackGrid *grid, s32 *cards)
Definition card_packs.h:56
void(* hide)(struct CardPackGrid *grid)
Definition card_packs.h:57
TextWindow * yes
Definition card_packs.h:199
TextWindow * prev
by the arrows
Definition card_packs.h:196
TextWindow * priceLabel
Definition card_packs.h:194
CardPackGrid * grid
Definition card_packs.h:202
TextWindow * ap
Definition card_packs.h:191
TextWindow * name
the card under the cursor's
Definition card_packs.h:184
TextWindow * price
Definition card_packs.h:195
TextWindow * no
Definition card_packs.h:200
TextWindow * points
Definition card_packs.h:186
TextWindow * text
its effect (TEXT_CARD_EFFECTS)
Definition card_packs.h:189
TextWindow * countLabel
Definition card_packs.h:187
TextWindow * pointsLabel
Definition card_packs.h:185
TextWindow * next
Definition card_packs.h:197
TextWindow * message
the total, or why the card can't be bought
Definition card_packs.h:198
TextWindow * apLabel
Definition card_packs.h:190
TextWindow * hp
Definition card_packs.h:193
TextWindow * count
how many the player has
Definition card_packs.h:188
TextWindow * hpLabel
Definition card_packs.h:192
The screen to buy cards (STCRDSHP_createBuy): the shop's cards, six a page.
Definition card_packs.h:160
struct CardShopStock * stock
Definition card_packs.h:179
s32 cards[6]
the page's
Definition card_packs.h:171
struct CardShop * shop
Definition card_packs.h:162
s32 column
the card under the cursor, on the page
Definition card_packs.h:165
PanelAnim fades[3]
Definition card_packs.h:180
void(* nextState)(struct CardShopBuy *task)
Definition card_packs.h:161
s32 shopId
the shop's game mode argument
Definition card_packs.h:177
struct CardShopStock *(* getStock)(s32 shop)
Definition card_packs.h:213
s16(* getPrice)(s32 card)
Definition card_packs.h:214
s32(* updateFade)(PanelAnim *fade)
Definition card_packs.h:210
void(* startFade)(PanelAnim *fade, s32 fadeIn)
Definition card_packs.h:209
s16 * cards
0-terminated
Definition card_packs.h:64
The card shop's main task (STCRDSHP_createShop): buy cards, open packs or edit the decks.
Definition card_packs.h:81
void(* showMoney)(struct CardShop *shop)
Definition card_packs.h:93
void(* setPos)()
(cursor, x, y)
Definition text.h:34
void(* setVisible)()
(cursor, visible)
Definition text.h:33
void *(* load)(u32 file)
Definition file.h:92
void *(* getEntry)(u32 fileAndIndex)
Definition file.h:96
void(* addCards)(s32 card, s32 count)
Definition game_state.h:26
s8 cards[0x13D]
counts, up to CARD_COPIES_MAX
Definition game_state.h:514
GameFuncs funcs
Definition game_state.h:582
s32(* getTime)(void)
Definition gfx.h:31
GfxFuncs funcs
Definition gfx.h:77
s32 level
Definition menu.h:21
s32 duration
Definition menu.h:19
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
void(* setDepth)()
Definition text.h:183
void(* setRightAlign)()
no prototype: callers would truncate u8 args
Definition text.h:178
void(* setNumber)()
Definition text.h:166
void(* setString)()
Definition text.h:165
void(* setVisible)(struct TextWindow *obj, u8 arg)
Definition text.h:177
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
Definition task.c:105
TextWindow * createTextWindow(s16 layerId, s16 style, s16 x, s16 y)
A text window on a layer, in a font style, at (x, y)