58 if (card == 0x45 || card == 0x70 || card == 0x9B || card == 0xC6 || card == 0xF1) {
113 }
else if (kind == 2) {
134 }
else if (card == 0x45 || card == 0x70 || card == 0x9B || card == 0xC6 || card == 0xF1) {
154 if (buy->
pages >= 2) {
194 if (buy->
pages >= 2) {
223 if (old != buy->
page) {
227 for (i = 0; i < 6; i++) {
231 if (buy->
pages >= 2) {
439 switch (buy->
state) {
444 for (i = 0; i < 6; i++) {
448 pages = buy->
count % 6;
450 pages = buy->
count / 6 + extra;
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...
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),...
s32 STCRDSHP_cursorRows[]
The CLUT rows of the cursor's frames.
static void STCRDSHP_confirmBuyCard(CardShopBuy *buy, CardShopBuyWindows *win)
Buy or no to the price: buy adds the card and pays for it; triangle declines.
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.
static void STCRDSHP_closeBuy(CardShopBuy *buy, CardShopBuyWindows *win)
Leaving: hides the cursor, the arrows' labels and the card, and closes its panel.
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...
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...
void STCRDSHP_drawBuy(CardShopBuy *buy)
Draws the screen: the card under the cursor's frames, the cursor, the arrows and the title.
CardShopBuy * STCRDSHP_createBuy(CardShop *shop, s32 shopId)
Creates the screen to buy the cards of a shop.
void STCRDSHP_updateBuy(CardShopBuy *buy, CardShopBuyWindows *win)
The buy screen's update: takes the shop's stock, six cards a page.
void STCRDSHP_createBuyWindows(CardShopBuy *buy, CardShopBuyWindows *win)
Creates the screen's windows and its cursor.
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...
static void STCRDSHP_closeBuyTotal(CardShopBuy *buy, CardShopBuyWindows *win)
Hides the total, its answers and the cursor, and closes the panel.
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.
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,...
CardShopFuncs STCRDSHP_funcs
The shops' helpers.
GfxState GFX
GFX: the graphics state and its methods.
GameState GAME
The save data, the game mode and the methods.
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
Cursor * createCursor(s16 layerId, s32 depth, s16 x, s16 y)
A menu cursor on a layer at (x, y)
#define TEXT_CARD_SHOP
CRDSHP: STCRDSHP's, and STCRDDEK's.
#define TEXT_CARD_NAMES
CARDNM.
#define TEXT_CARD_EFFECTS
CARDST.
FileCache FILE_CACHE
The file cache.
#define SCREEN_LAYER
The layer over the whole screen that most modes create first and draw their menus on (FIELDSTG and ST...
#define PAD_PRESSED(button)
One button of pad 1: newly pressed, auto-repeated while held, or held.
#define PAD_REPEATED(button)
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
#define SOUND_MENU_CONFIRM
SYSTEM07.
#define SOUND_SELECT
Sounds the overlays share, with SOUNDTST's names.
#define SOUND_MENU_CANCEL
SYSTEM01.
#define SOUND_MENU_MOVE
SYSTEM06.
#define SOUND_CURSOR
SYSTEM02: a cursor moves.
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.
u8 points
what it adds to its colour
void(* setCards)(struct CardPackGrid *grid, s32 *cards)
void(* hide)(struct CardPackGrid *grid)
TextWindow * prev
by the arrows
TextWindow * name
the card under the cursor's
TextWindow * text
its effect (TEXT_CARD_EFFECTS)
TextWindow * message
the total, or why the card can't be bought
TextWindow * count
how many the player has
The screen to buy cards (STCRDSHP_createBuy): the shop's cards, six a page.
struct CardShopStock * stock
s32 column
the card under the cursor, on the page
void(* nextState)(struct CardShopBuy *task)
s32 shopId
the shop's game mode argument
struct CardShopStock *(* getStock)(s32 shop)
s16(* getPrice)(s32 card)
s32(* updateFade)(PanelAnim *fade)
void(* startFade)(PanelAnim *fade, s32 fadeIn)
The card shop's main task (STCRDSHP_createShop): buy cards, open packs or edit the decks.
void(* showMoney)(struct CardShop *shop)
void(* setPos)()
(cursor, x, y)
void(* setVisible)()
(cursor, visible)
void *(* getEntry)(u32 fileAndIndex)
void(* addCards)(s32 card, s32 count)
s8 cards[0x13D]
counts, up to CARD_COPIES_MAX
short(* playSound)(s32 id)
returns the voice of a key-on
Draws sprites from a sprite sheet (such as file 0x277, the menu graphics): a sheet has a table of fra...
void(* setScale)()
(x, y, z), ONE = 1.0
void(* setLayerId)()
(id, depth)
void(* setClutRow)()
(row)
void(* draw)()
(sheet, frame, x, y)
void(* setTexture)()
(x, y)
void(* setRightAlign)()
no prototype: callers would truncate u8 args
void(* setVisible)(struct TextWindow *obj, u8 arg)
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
TextWindow * createTextWindow(s16 layerId, s16 style, s16 x, s16 y)
A text window on a layer, in a font style, at (x, y)