Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
shop.c File Reference

The card shop's main task, which opens the pack screen or the buy screen; the files it loads; its helpers; and the shops' stock and prices. More...

Include dependency graph for shop.c:

Go to the source code of this file.

Functions

void STCRDSHP_createShopWindows (CardShop *shop, CardShopWindows *win)
 Creates the shop's windows and its cursor.
 
void STCRDSHP_showTitle (CardShop *shop, CardShopWindows *win, s32 show)
 Shows or hides the shop's title and the money.
 
void STCRDSHP_showOptions (CardShop *shop, CardShopWindows *win, s32 show)
 Shows or hides the options (buy cards, open a pack, edit the decks) and the help.
 
void STCRDSHP_drawShop (CardShop *shop)
 Draws the scrolling background and the panels as they open.
 
static void STCRDSHP_chooseOption (CardShop *shop, CardShopWindows *win)
 Up/down choose buy one card, open booster or edit folder; cross starts it, triangle leaves the shop.
 
static void STCRDSHP_startOption (CardShop *shop, CardShopWindows *win)
 Starts what was chosen: the screen to buy cards, the one to open a pack when the bag has one (else a message), or the deck editor once the shop has closed.
 
static void STCRDSHP_closeOptions (CardShop *shop, CardShopWindows *win)
 Hides the options and the cursor and closes their panel; leaving the shop (step unset), also fades the screen out.
 
static void STCRDSHP_endOptions (CardShop *shop, CardShopWindows *win)
 Once the options' panel has closed: waits for the screen chosen, or closes the title's panel to leave.
 
void STCRDSHP_runShop (CardShop *shop, CardShopWindows *win)
 Opens the panels, moves the cursor and starts what was chosen.
 
void STCRDSHP_showMoney (CardShop *shop)
 Shows the money left (after buying)
 
void STCRDSHP_updateShop (CardShop *shop, CardShopWindows *win)
 The shop's update: loads its files, then runs it; leaves to the field or the deck editor.
 
CardShop * STCRDSHP_createShop (void)
 Creates the card shop (task) for the shop of the mode's argument, titled for the field it is opened from; the cursor starts on the deck editor's option when coming back from it.
 
void STCRDSHP_loadFiles (void)
 Loads the shop's textures and requests its strings.
 
s32 STCRDSHP_filesLoading (void)
 Whether the shop's strings are still loading.
 
CardShopStock * STCRDSHP_getStock (s32 shop)
 The stock of a shop (the first one's if it has none), counting its cards.
 
s16 STCRDSHP_getPrice (s32 card)
 The price of a card.
 

Variables

CardShopTitle STCRDSHP_titles []
 The shop's title for each field it is opened from, up to mode 0.
 
CardShopFuncs STCRDSHP_funcs
 The shops' helpers.
 
s16 STCRDSHP_shopCards [24][8]
 The cards each shop sells (STCRDSHP_stocks), up to 0.
 
CardPrice STCRDSHP_prices []
 The cards the shops sell and their prices.
 
CardShopStock STCRDSHP_stocks []
 Each shop's cards.
 

Detailed Description

The card shop's main task, which opens the pack screen or the buy screen; the files it loads; its helpers; and the shops' stock and prices.

Definition in file shop.c.

Function Documentation

◆ STCRDSHP_createShopWindows()

void STCRDSHP_createShopWindows ( CardShop *  shop,
CardShopWindows *  win 
)

Creates the shop's windows and its cursor.

shop.c

Definition at line 7 of file shop.c.

Referenced by STCRDSHP_updateShop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ STCRDSHP_showTitle()

void STCRDSHP_showTitle ( CardShop *  shop,
CardShopWindows *  win,
s32  show 
)

Shows or hides the shop's title and the money.

< SHPNAM

< CRDSHP: STCRDSHP's, and STCRDDEK's

Definition at line 31 of file shop.c.

Referenced by STCRDSHP_endOptions(), and STCRDSHP_runShop().

Here is the caller graph for this function:

◆ STCRDSHP_showOptions()

void STCRDSHP_showOptions ( CardShop *  shop,
CardShopWindows *  win,
s32  show 
)

Shows or hides the options (buy cards, open a pack, edit the decks) and the help.

< CRDSHP: STCRDSHP's, and STCRDDEK's

< CRDSHP: STCRDSHP's, and STCRDDEK's

Definition at line 45 of file shop.c.

Referenced by STCRDSHP_closeOptions(), and STCRDSHP_runShop().

Here is the caller graph for this function:

◆ STCRDSHP_drawShop()

void STCRDSHP_drawShop ( CardShop *  shop)

Draws the scrolling background and the panels as they open.

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

Definition at line 62 of file shop.c.

Referenced by STCRDSHP_updateShop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ STCRDSHP_chooseOption()

static void STCRDSHP_chooseOption ( CardShop *  shop,
CardShopWindows *  win 
)
inlinestatic

Up/down choose buy one card, open booster or edit folder; cross starts it, triangle leaves the shop.

< SYSTEM02: a cursor moves

< SYSTEM00: a choice is taken

< SYSTEM01

Definition at line 110 of file shop.c.

Referenced by STCRDSHP_runShop().

Here is the caller graph for this function:

◆ STCRDSHP_startOption()

static void STCRDSHP_startOption ( CardShop *  shop,
CardShopWindows *  win 
)
inlinestatic

Starts what was chosen: the screen to buy cards, the one to open a pack when the bag has one (else a message), or the deck editor once the shop has closed.

Definition at line 139 of file shop.c.

Referenced by STCRDSHP_runShop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ STCRDSHP_closeOptions()

static void STCRDSHP_closeOptions ( CardShop *  shop,
CardShopWindows *  win 
)
inlinestatic

Hides the options and the cursor and closes their panel; leaving the shop (step unset), also fades the screen out.

Definition at line 172 of file shop.c.

Referenced by STCRDSHP_runShop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ STCRDSHP_endOptions()

static void STCRDSHP_endOptions ( CardShop *  shop,
CardShopWindows *  win 
)
inlinestatic

Once the options' panel has closed: waits for the screen chosen, or closes the title's panel to leave.

Definition at line 186 of file shop.c.

Referenced by STCRDSHP_runShop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ STCRDSHP_runShop()

void STCRDSHP_runShop ( CardShop *  shop,
CardShopWindows *  win 
)

Opens the panels, moves the cursor and starts what was chosen.

< what is unavailable

< CRDSHP: STCRDSHP's, and STCRDDEK's

< SYSTEM07

Definition at line 199 of file shop.c.

Referenced by STCRDSHP_updateShop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ STCRDSHP_showMoney()

void STCRDSHP_showMoney ( CardShop *  shop)

Shows the money left (after buying)

Definition at line 284 of file shop.c.

Referenced by STCRDSHP_createShop().

Here is the caller graph for this function:

◆ STCRDSHP_updateShop()

void STCRDSHP_updateShop ( CardShop *  shop,
CardShopWindows *  win 
)

The shop's update: loads its files, then runs it; leaves to the field or the deck editor.

< STCRDDEK

Definition at line 293 of file shop.c.

Referenced by STCRDSHP_createShop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ STCRDSHP_createShop()

CardShop * STCRDSHP_createShop ( void  )

Creates the card shop (task) for the shop of the mode's argument, titled for the field it is opened from; the cursor starts on the deck editor's option when coming back from it.

Requests the card data and strings

< STCRDDEK

< CARDNM

< CARDST

Definition at line 333 of file shop.c.

Here is the call graph for this function:

◆ STCRDSHP_loadFiles()

void STCRDSHP_loadFiles ( void  )

Loads the shop's textures and requests its strings.

< CRDSHP: STCRDSHP's, and STCRDDEK's

< CARDNM

< CARDST

< SHPNAM

< ITMNAM

Definition at line 365 of file shop.c.

Here is the call graph for this function:

◆ STCRDSHP_filesLoading()

s32 STCRDSHP_filesLoading ( void  )

Whether the shop's strings are still loading.

< CRDSHP: STCRDSHP's, and STCRDDEK's

< CARDNM

< CARDST

< SHPNAM

< ITMNAM

Definition at line 379 of file shop.c.

◆ STCRDSHP_getStock()

CardShopStock * STCRDSHP_getStock ( s32  shop)

The stock of a shop (the first one's if it has none), counting its cards.

Definition at line 401 of file shop.c.

◆ STCRDSHP_getPrice()

s16 STCRDSHP_getPrice ( s32  card)

The price of a card.

Definition at line 422 of file shop.c.

Variable Documentation

◆ STCRDSHP_titles

CardShopTitle STCRDSHP_titles[]
Initial value:
= {
{ 529, 31 }, { 640, 32 }, { 559, 33 }, { 669, 34 }, { 574, 35 },
{ 683, 36 }, { 606, 37 }, { 711, 38 }, { 623, 39 }, { 726, 40 },
{ 0, 31 },
}

The shop's title for each field it is opened from, up to mode 0.

Definition at line 434 of file shop.c.

Referenced by STCRDSHP_createShop().

◆ STCRDSHP_funcs

CardShopFuncs STCRDSHP_funcs
Initial value:
= {
}
s32 STCRDSHP_updateLerp(MenuLerp *lerp)
s32 STCRDSHP_updateFade(PanelAnim *fade)
void STCRDSHP_startFade(PanelAnim *fade, s32 fadeIn)
void STCRDSHP_startLerp(MenuLerp *lerp, s32 from, s32 to, s32 frames)
CardShopStock * STCRDSHP_getStock(s32 shop)
The stock of a shop (the first one's if it has none), counting its cards.
Definition shop.c:401
s16 STCRDSHP_getPrice(s32 card)
The price of a card.
Definition shop.c:422
s32 STCRDSHP_filesLoading(void)
Whether the shop's strings are still loading.
Definition shop.c:379
void STCRDSHP_loadFiles(void)
Loads the shop's textures and requests its strings.
Definition shop.c:365

The shops' helpers.

Definition at line 440 of file shop.c.

Referenced by STCRDSHP_chooseBuyCard(), STCRDSHP_closeBuy(), STCRDSHP_closeBuyTotal(), STCRDSHP_closeOptions(), STCRDSHP_closePackList(), STCRDSHP_closePackOpen(), STCRDSHP_endOptions(), STCRDSHP_openBuyCard(), STCRDSHP_openBuyTotal(), STCRDSHP_openPack(), STCRDSHP_runBuy(), STCRDSHP_runPackOpen(), STCRDSHP_runShop(), STCRDSHP_showBuyCard(), STCRDSHP_updateBuy(), and STCRDSHP_updateShop().

◆ STCRDSHP_shopCards

s16 STCRDSHP_shopCards[24][8]
Initial value:
= {
{ 65, 235, 277, 194, 204, 59, 0, 0 },
{ 10, 210, 80, 168, 30, 59, 0, 0 },
{ 209, 167, 82, 128, 30, 59, 0, 0 },
{ 75, 202, 164, 121, 27, 59, 0, 0 },
{ 115, 157, 73, 204, 249, 27, 0, 0 },
{ 201, 116, 153, 284, 27, 30, 0, 0 },
{ 96, 226, 140, 185, 265, 259, 0, 0 },
{ 209, 167, 252, 82, 128, 259, 0, 0 },
{ 72, 115, 157, 73, 204, 249, 0, 0 },
{ 72, 115, 157, 73, 204, 285, 0, 0 },
{ 96, 10, 210, 80, 168, 30, 0, 0 },
{ 209, 167, 252, 82, 128, 259, 0, 0 },
{ 209, 72, 201, 116, 204, 249, 0, 0 },
{ 72, 115, 157, 73, 204, 285, 0, 0 },
{ 209, 167, 252, 82, 128, 259, 0, 0 },
{ 72, 115, 157, 73, 204, 249, 0, 0 },
{ 209, 72, 201, 116, 204, 249, 0, 0 },
{ 72, 201, 116, 157, 153, 284, 0, 0 },
{ 65, 106, 150, 194, 277, 235, 0, 0 },
{ 30, 75, 202, 164, 121, 27, 0, 0 },
{ 156, 75, 202, 109, 153, 285, 0, 0 },
{ 115, 157, 73, 204, 249, 30, 0, 0 },
{ 156, 70, 200, 109, 285, 27, 0, 0 },
{ 116, 285, 66, 106, 150, 194, 0, 0 },
}

The cards each shop sells (STCRDSHP_stocks), up to 0.

the cards each shop sells

Definition at line 445 of file shop.c.

◆ STCRDSHP_prices

CardPrice STCRDSHP_prices[]
Initial value:
= {
{ 10, 2200 }, { 27, 11000 }, { 30, 4000 }, { 59, 1000 }, { 65, 10000 }, { 66, 10000 },
{ 70, 7000 }, { 72, 7700 }, { 73, 7700 }, { 75, 6600 }, { 80, 2200 }, { 82, 3000 },
{ 96, 500 }, { 106, 10000 }, { 109, 8000 }, { 115, 7700 }, { 116, 7700 }, { 121, 4000 },
{ 128, 3000 }, { 140, 500 }, { 150, 10000 }, { 153, 8000 }, { 156, 7000 }, { 157, 7700 },
{ 164, 4000 }, { 167, 3300 }, { 168, 2200 }, { 185, 500 }, { 194, 10000 }, { 200, 7000 },
{ 201, 7700 }, { 202, 6600 }, { 204, 5500 }, { 209, 4400 }, { 210, 2200 }, { 226, 500 },
{ 235, 13000 }, { 249, 6600 }, { 252, 4400 }, { 259, 1000 }, { 265, 500 }, { 277, 10000 },
{ 284, 9000 }, { 285, 9000 }, { 0, 1 },
}

The cards the shops sell and their prices.

Definition at line 472 of file shop.c.

Referenced by STCRDSHP_getPrice().

◆ STCRDSHP_stocks

CardShopStock STCRDSHP_stocks[]
Initial value:
= {
{ 49, 0, STCRDSHP_shopCards[0] },
{ 50, 0, STCRDSHP_shopCards[1] },
{ 51, 0, STCRDSHP_shopCards[2] },
{ 52, 0, STCRDSHP_shopCards[3] },
{ 53, 0, STCRDSHP_shopCards[4] },
{ 54, 0, STCRDSHP_shopCards[5] },
{ 55, 0, STCRDSHP_shopCards[6] },
{ 56, 0, STCRDSHP_shopCards[7] },
{ 57, 0, STCRDSHP_shopCards[8] },
{ 58, 0, STCRDSHP_shopCards[9] },
{ 59, 0, STCRDSHP_shopCards[10] },
{ 60, 0, STCRDSHP_shopCards[11] },
{ 61, 0, STCRDSHP_shopCards[12] },
{ 62, 0, STCRDSHP_shopCards[13] },
{ 63, 0, STCRDSHP_shopCards[14] },
{ 64, 0, STCRDSHP_shopCards[15] },
{ 65, 0, STCRDSHP_shopCards[16] },
{ 66, 0, STCRDSHP_shopCards[17] },
{ 67, 0, STCRDSHP_shopCards[18] },
{ 70, 0, STCRDSHP_shopCards[19] },
{ 71, 0, STCRDSHP_shopCards[20] },
{ 72, 0, STCRDSHP_shopCards[21] },
{ 73, 0, STCRDSHP_shopCards[22] },
{ 74, 0, STCRDSHP_shopCards[23] },
{ -1, 0, ((void *)0) },
}
s16 STCRDSHP_shopCards[24][8]
The cards each shop sells (STCRDSHP_stocks), up to 0.
Definition shop.c:445

Each shop's cards.

Definition at line 483 of file shop.c.

Referenced by STCRDSHP_getStock().