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

STITSHOP.PRO: the item shop. More...

#include "engine/game.h"
Include dependency graph for item_shop.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ItemShop
 The main task of the shop (STITSHOP_createShop) More...
 
struct  ItemShopWindows
 The children of the shop. More...
 
struct  ShopPartnerInfo
 What the details panel shows of a partner. More...
 
struct  ShopStatRow
 A row of the details panel's stats. More...
 
struct  ShopInfo
 The panel with the selected item's details (STITSHOP_createInfo) More...
 
struct  ShopInfoPartner
 A partner's rows of the details panel's second page. More...
 
struct  ShopInfoWindows
 
struct  ShopDialog
 What ShopBuy and ShopSell start with, and are passed to the item list as: the list shows its selection in it. More...
 
struct  ShopItemList
 The list of the items to buy or sell (STITSHOP_createItemList) More...
 
struct  ShopItemListWindows
 
struct  ShopBuy
 The dialog to buy an item (STITSHOP_createBuy) More...
 
struct  ShopBuyWindows
 
struct  ShopSell
 The dialog to sell an item (STITSHOP_createSell) More...
 
struct  ShopSellWindows
 
struct  ShopList
 A shop: the items it sells. More...
 
struct  ItemShopFuncs
 The shop's helpers (STITSHOP_funcs) More...
 

Macros

#define OVL_NAME(name)   STITSHOP_##name
 The name of this overlay's copy of a function of src/shared/.
 
#define FILE_SHOP_SPRITES   0x402
 The shop's sprite sheet; the next file is its texture archive.
 

Functions

void STITSHOP_updateScene (Task *task, ItemShop **child)
 scene.c
 
void STITSHOP_startFader (ScreenFade *task, s32 fadeIn, s32 duration)
 
void STITSHOP_drawFader (ScreenFade *task)
 
void STITSHOP_updateFader (ScreenFade *task)
 
ScreenFade * STITSHOP_createFader (void)
 
void STITSHOP_createBuyWindows (ShopBuy *buy, ShopBuyWindows *win)
 trade.c
 
void STITSHOP_showQuantity (ShopBuy *buy, ShopBuyWindows *win, s32 show)
 Shows the quantity to buy; or hides it.
 
void STITSHOP_showBuyTotal (ShopBuy *buy, ShopBuyWindows *win, s32 show)
 Shows the total price with yes and no to confirm the purchase; or hides them.
 
void STITSHOP_drawBuy (ShopBuy *buy, ShopBuyWindows *win)
 Draws the buying screen's frames, the quantity's blinking arrows and the marker over a partner.
 
void STITSHOP_runBuy (ShopBuy *buy, ShopBuyWindows *win)
 The buying dialog: pick the item in the list, how many, confirm, then (equipment) whether to equip it and on which partner.
 
void STITSHOP_updateBuy (ShopBuy *buy, ShopBuyWindows *win)
 The buying dialog's task: creates its windows, starting at a quantity of 1, then runs and draws it.
 
void STITSHOP_showBuyItem (ShopBuy *buy, s32 item, s32 quantity)
 Shows the item selected in the list, and the quantity, in the details panel (buy->showItem)
 
ShopBuy * STITSHOP_createBuy (ItemShop *shop)
 Creates the buying dialog (task), when buy is chosen in the shop.
 
void STITSHOP_createSellWindows (ShopSell *sell, ShopSellWindows *win)
 Creates the selling dialog's windows: the cursor, the four kinds of sale, the quantity, the total with its yes and no, and the message.
 
void STITSHOP_drawSell (ShopSell *sell, ShopSellWindows *win)
 Draws the selling screen's frames, and the quantity's blinking arrows.
 
void STITSHOP_runSell (ShopSell *sell, ShopSellWindows *win)
 The selling dialog: pick the kind of item, then the item in the list, how many, and confirm.
 
void STITSHOP_updateSell (ShopSell *sell, ShopSellWindows *win)
 The selling dialog's task: creates its windows, starting at a quantity of 1, then runs and draws it.
 
void STITSHOP_showSellItem (ShopSell *sell, s32 item, s32 quantity)
 Shows the item selected in the list, and the quantity, in the details panel (sell->showItem)
 
ShopSell * STITSHOP_createSell (ItemShop *shop)
 Creates the selling dialog (task), when sell is chosen in the shop.
 
void STITSHOP_createItemListWindows (ShopItemList *list, ShopItemListWindows *win)
 item_list.c
 
void STITSHOP_showItemPage (ShopItemList *list, ShopItemListWindows *win, s32 show)
 Shows the page of items, the page number and the arrows' labels; or hides them.
 
void STITSHOP_drawItemList (ShopItemList *list)
 Draws the list's frame, the items' icons and the blinking page arrows.
 
void STITSHOP_runItemList (ShopItemList *list, ShopItemListWindows *win)
 The list's states: lists the shop's items or the bag's, fades in, then fades out when closed.
 
void STITSHOP_updateItemList (ShopItemList *list, ShopItemListWindows *win)
 The item list: L1 and R1 turn its pages, the d-pad moves in the page, and the dialog shows the selected item.
 
void STITSHOP_freezeListCursor (ShopItemList *list, s32 frozen)
 Freezes the list's cursor (still, in palette 7) and its input, or lets them go again (list->freezeCursor): while the details panel turns its page.
 
void STITSHOP_showListCursor (ShopItemList *list, s32 visible)
 Shows the list's cursor at the selection and takes the d-pad, or hides it and stops (list->showCursor)
 
void STITSHOP_startItemList (ShopItemList *list)
 Runs the list's states again (list->start), to reopen it after the quantity and the yes/no.
 
void STITSHOP_closeItemList (ShopItemList *list)
 Closes the list (list->close): hides the cursor and fades it out.
 
s32 STITSHOP_getSelectedItem (ShopItemList *list)
 The item at the list's selection, of the shop's or of the bag's sellable ones (list->getSelected)
 
void STITSHOP_refreshItemList (ShopItemList *list)
 Lists the sellable items again, shows the page and the selection in the dialog (list->refresh)
 
void STITSHOP_listSellable (ShopItemList *list)
 Lists the bag's items of the list's type that can be sold, those with a sell price (list->listBag, again after a sale)
 
ShopItemList * STITSHOP_createItemList (ShopDialog *dialog, s32 type, s32 selling)
 Creates the item list (task) of a dialog: the items of the shop type when buying, the bag's of the item type when selling.
 
void STITSHOP_computeStats (s32 partner, StatBlock *out)
 info.c
 
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, 8 to 14 a resistance.
 
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 row compares.
 
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, else 6 when a penalty lowers it (STAT_STRENGTH, STAT_DEFENSE and STAT_SPEED), 0 otherwise.
 
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), noting them in the partner's rows; hides the windows left over.
 
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, then the others it would change.
 
void STITSHOP_createInfoWindows (ShopInfo *info, ShopInfoWindows *win)
 Creates the details panel's windows: the item's rows, then, when buying, each partner's name, stats and stat changes.
 
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.
 
void STITSHOP_showItemDesc (ShopInfo *info, ShopInfoWindows *win, s32 show)
 Shows the item's description and, for a weapon, its kind; or hides them.
 
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.
 
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 the stats the item changes or a cross.
 
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), and fades out when closed (50)
 
void STITSHOP_runSellInfo (ShopInfo *info, ShopInfoWindows *win)
 The details panel's first page: fades in, shows the item, then fades out when closed.
 
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.
 
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 only refreshed while the page is shown.
 
void STITSHOP_closeInfo (ShopInfo *info)
 Closes the details panel (info->close), when it is open and idle.
 
void STITSHOP_setKindVisible (ShopInfo *info, s32 visible)
 Shows or hides the weapon's kind in the details panel (info->setKindVisible)
 
void STITSHOP_turnInfoPage (ShopInfo *info)
 Turns the details panel between the description and the partners' stats (info->turnPage); only for the items of kinds 3 to 5, which have stats.
 
void STITSHOP_refreshPartner (ShopInfo *info, s32 member)
 Refreshes the details panel once the item is equipped on a party member (info->refreshPartner): the item's rows and that partner's.
 
ShopInfo * STITSHOP_createInfo (s32 selling, s32 item)
 Creates the details panel (task) of the item selected, when buying or selling.
 
void STITSHOP_createShopWindows (ItemShop *shop, ItemShopWindows *win)
 shop.c
 
void STITSHOP_drawShop (ItemShop *shop, ItemShopWindows *win)
 Draws the shop's four frames as they open by scaling, and the background, which scrolls one pixel every other frame, wrapping at 96.
 
void STITSHOP_runShop (ItemShop *shop, ItemShopWindows *win)
 Opens the shop's panels, then up/down and cross pick buy or sell and run that dialog, reopening after it; triangle closes the panels and fades out.
 
void STITSHOP_updateShop (ItemShop *shop, ItemShopWindows *win)
 The shop's task: loads its files, then runs it; goes back to the field when killed.
 
void STITSHOP_showMoney (ItemShop *shop)
 Shows the money left (shop->showMoney), after buying or selling.
 
ItemShop * STITSHOP_createShop (void)
 Creates the item shop (task) for the shop of the mode's argument.
 
void STITSHOP_loadFiles (void)
 Loads the shop's textures and requests its strings.
 
s32 STITSHOP_filesLoading (void)
 Whether the shop's strings are still loading.
 
void STITSHOP_startFade (PanelAnim *fade, s32 fadeIn)
 
s32 STITSHOP_updateFade (PanelAnim *fade)
 
void STITSHOP_startLerp (MenuLerp *lerp, s32 from, s32 to, s32 frames)
 
s32 STITSHOP_updateLerp (MenuLerp *lerp)
 
s16 * STITSHOP_getShopItems (s32 shop)
 equip.c
 
s32 STITSHOP_canEquip (s32 partner, s32 item)
 1 when a partner can equip an item: the partner's bit in its partners
 
s32 STITSHOP_compareEquip (s32 partner, s32 item)
 Which equipment slot a bought item would go in: 2 or 3 for the weapons (the one with the weaker item when both are taken), 4 or 5 for the accessories (the one with the same group, else the weaker one); -1 when it can't.
 
void STITSHOP_equip (s32 partner, s32 slot, s32 item, s32 fromBag)
 Puts an item in a partner's equipment slot like STSTATUS_equip, moving the counts between GAME.items and GAME.equippedItems only when fromBag is set.
 

Variables

s32 STITSHOP_sellLists []
 STITSHOP's data (data/stitshop.c), in its order.
 
Vec2 STITSHOP_changePos []
 Where the stat change arrows go in a partner's column.
 
s32 STITSHOP_stats []
 the stats the info shows
 
s32 STITSHOP_kindStrings []
 the strings of the item kinds
 
s32 STITSHOP_shopNames []
 The shops' names, by ItemShop.shop.
 
ShopList STITSHOP_shops [31]
 STITSHOP_stock0 to 30, the items of each shop, are only STITSHOP_shops'.
 
ItemShopFuncs STITSHOP_funcs
 The shop's helpers.
 

Detailed Description

STITSHOP.PRO: the item shop.

The game mode's argument picks the shop (STITSHOP_shops, a list of the items it sells); the player buys items for the money, sells them, and equips what was bought on a partner. Its strings are in file 0x72. Its modules are in src/menus/item_shop/, and the functions below are by module, in the order they link.

Definition in file item_shop.h.

Macro Definition Documentation

◆ OVL_NAME

#define OVL_NAME (   name)    STITSHOP_##name

The name of this overlay's copy of a function of src/shared/.

Definition at line 13 of file item_shop.h.

◆ FILE_SHOP_SPRITES

#define FILE_SHOP_SPRITES   0x402

The shop's sprite sheet; the next file is its texture archive.

Definition at line 19 of file item_shop.h.

Function Documentation

◆ STITSHOP_updateScene()

void STITSHOP_updateScene ( Task *  task,
ItemShop **  child 
)

scene.c

◆ STITSHOP_startFader()

void STITSHOP_startFader ( ScreenFade *  task,
s32  fadeIn,
s32  duration 
)

◆ STITSHOP_drawFader()

void STITSHOP_drawFader ( ScreenFade *  task)

◆ STITSHOP_updateFader()

void STITSHOP_updateFader ( ScreenFade *  task)

◆ STITSHOP_createFader()

ScreenFade * STITSHOP_createFader ( void  )

Referenced by STITSHOP_runShop().

Here is the caller graph for this function:

◆ STITSHOP_createBuyWindows()

void STITSHOP_createBuyWindows ( ShopBuy *  buy,
ShopBuyWindows *  win 
)

trade.c

trade.c

Definition at line 8 of file trade.c.

Referenced by STITSHOP_updateBuy().

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

◆ STITSHOP_showQuantity()

void STITSHOP_showQuantity ( ShopBuy *  buy,
ShopBuyWindows *  win,
s32  show 
)

Shows the quantity to buy; or hides it.

< ITSHOP: STITSHOP's

< ITSHOP: STITSHOP's

Definition at line 20 of file trade.c.

Referenced by STITSHOP_chooseBuyQuantity(), and STITSHOP_runBuy().

Here is the caller graph for this function:

◆ STITSHOP_showBuyTotal()

void STITSHOP_showBuyTotal ( ShopBuy *  buy,
ShopBuyWindows *  win,
s32  show 
)

Shows the total price with yes and no to confirm the purchase; or hides them.

< ITSHOP: STITSHOP's

< ITSHOP: STITSHOP's

< ITSHOP: STITSHOP's

Definition at line 34 of file trade.c.

Referenced by STITSHOP_openBuyTotal(), and STITSHOP_runBuy().

Here is the caller graph for this function:

◆ STITSHOP_drawBuy()

void STITSHOP_drawBuy ( ShopBuy *  buy,
ShopBuyWindows *  win 
)

Draws the buying screen's frames, the quantity's blinking arrows and the marker over a partner.

< 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

< 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

< 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 49 of file trade.c.

Referenced by STITSHOP_updateBuy().

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

◆ STITSHOP_runBuy()

void STITSHOP_runBuy ( ShopBuy *  buy,
ShopBuyWindows *  win 
)

The buying dialog: pick the item in the list, how many, confirm, then (equipment) whether to equip it and on which partner.

< ITSHOP: STITSHOP's

< SYSTEM07

< SYSTEM07

Definition at line 439 of file trade.c.

Referenced by STITSHOP_updateBuy().

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

◆ STITSHOP_updateBuy()

void STITSHOP_updateBuy ( ShopBuy *  buy,
ShopBuyWindows *  win 
)

The buying dialog's task: creates its windows, starting at a quantity of 1, then runs and draws it.

Definition at line 652 of file trade.c.

Referenced by STITSHOP_createBuy().

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

◆ STITSHOP_showBuyItem()

void STITSHOP_showBuyItem ( ShopBuy *  buy,
s32  item,
s32  quantity 
)

Shows the item selected in the list, and the quantity, in the details panel (buy->showItem)

Definition at line 676 of file trade.c.

Referenced by STITSHOP_createBuy().

Here is the caller graph for this function:

◆ STITSHOP_createBuy()

ShopBuy * STITSHOP_createBuy ( ItemShop *  shop)

Creates the buying dialog (task), when buy is chosen in the shop.

Definition at line 683 of file trade.c.

Referenced by STITSHOP_runShop().

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

◆ STITSHOP_createSellWindows()

void STITSHOP_createSellWindows ( ShopSell *  sell,
ShopSellWindows *  win 
)

Creates the selling dialog's windows: the cursor, the four kinds of sale, the quantity, the total with its yes and no, and the message.

Definition at line 695 of file trade.c.

Referenced by STITSHOP_updateSell().

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

◆ STITSHOP_drawSell()

void STITSHOP_drawSell ( ShopSell *  sell,
ShopSellWindows *  win 
)

Draws the selling screen's frames, and the quantity's blinking arrows.

< 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

< 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 713 of file trade.c.

Referenced by STITSHOP_updateSell().

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

◆ STITSHOP_runSell()

void STITSHOP_runSell ( ShopSell *  sell,
ShopSellWindows *  win 
)

The selling dialog: pick the kind of item, then the item in the list, how many, and confirm.

< SYSTEM00: a choice is taken

< SYSTEM01

< ITSHOP: STITSHOP's

< ITSHOP: STITSHOP's

< SYSTEM07

Definition at line 1007 of file trade.c.

Referenced by STITSHOP_updateSell().

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

◆ STITSHOP_updateSell()

void STITSHOP_updateSell ( ShopSell *  sell,
ShopSellWindows *  win 
)

The selling dialog's task: creates its windows, starting at a quantity of 1, then runs and draws it.

Definition at line 1174 of file trade.c.

Referenced by STITSHOP_createSell().

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

◆ STITSHOP_showSellItem()

void STITSHOP_showSellItem ( ShopSell *  sell,
s32  item,
s32  quantity 
)

Shows the item selected in the list, and the quantity, in the details panel (sell->showItem)

Definition at line 1199 of file trade.c.

Referenced by STITSHOP_createSell().

Here is the caller graph for this function:

◆ STITSHOP_createSell()

ShopSell * STITSHOP_createSell ( ItemShop *  shop)

Creates the selling dialog (task), when sell is chosen in the shop.

Definition at line 1206 of file trade.c.

Referenced by STITSHOP_runShop().

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

◆ STITSHOP_createItemListWindows()

void STITSHOP_createItemListWindows ( ShopItemList *  list,
ShopItemListWindows *  win 
)

item_list.c

item_list.c

Definition at line 7 of file item_list.c.

Referenced by STITSHOP_updateItemList().

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

◆ STITSHOP_showItemPage()

void STITSHOP_showItemPage ( ShopItemList *  list,
ShopItemListWindows *  win,
s32  show 
)

Shows the page of items, the page number and the arrows' labels; or hides them.

< ITMNAM

< ITSHOP: STITSHOP's

< ITSHOP: STITSHOP's

< ITSHOP: STITSHOP's

Definition at line 26 of file item_list.c.

Referenced by STITSHOP_refreshItemList(), STITSHOP_runItemList(), and STITSHOP_updateItemList().

Here is the caller graph for this function:

◆ STITSHOP_drawItemList()

void STITSHOP_drawItemList ( ShopItemList *  list)

Draws the list's frame, the items' icons and the blinking page arrows.

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

Definition at line 75 of file item_list.c.

Referenced by STITSHOP_updateItemList().

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

◆ STITSHOP_runItemList()

void STITSHOP_runItemList ( ShopItemList *  list,
ShopItemListWindows *  win 
)

The list's states: lists the shop's items or the bag's, fades in, then fades out when closed.

Definition at line 133 of file item_list.c.

Referenced by STITSHOP_updateItemList().

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

◆ STITSHOP_updateItemList()

void STITSHOP_updateItemList ( ShopItemList *  list,
ShopItemListWindows *  win 
)

The item list: L1 and R1 turn its pages, the d-pad moves in the page, and the dialog shows the selected item.

< SYSTEM02: a cursor moves

< SYSTEM02: a cursor moves

Definition at line 176 of file item_list.c.

Referenced by STITSHOP_createItemList().

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

◆ STITSHOP_freezeListCursor()

void STITSHOP_freezeListCursor ( ShopItemList *  list,
s32  frozen 
)

Freezes the list's cursor (still, in palette 7) and its input, or lets them go again (list->freezeCursor): while the details panel turns its page.

< what is unavailable

Definition at line 271 of file item_list.c.

Referenced by STITSHOP_createItemList().

Here is the caller graph for this function:

◆ STITSHOP_showListCursor()

void STITSHOP_showListCursor ( ShopItemList *  list,
s32  visible 
)

Shows the list's cursor at the selection and takes the d-pad, or hides it and stops (list->showCursor)

Definition at line 287 of file item_list.c.

Referenced by STITSHOP_closeItemList(), and STITSHOP_createItemList().

Here is the caller graph for this function:

◆ STITSHOP_startItemList()

void STITSHOP_startItemList ( ShopItemList *  list)

Runs the list's states again (list->start), to reopen it after the quantity and the yes/no.

Definition at line 299 of file item_list.c.

Referenced by STITSHOP_createItemList().

Here is the caller graph for this function:

◆ STITSHOP_closeItemList()

void STITSHOP_closeItemList ( ShopItemList *  list)

Closes the list (list->close): hides the cursor and fades it out.

Definition at line 304 of file item_list.c.

Referenced by STITSHOP_createItemList().

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

◆ STITSHOP_getSelectedItem()

s32 STITSHOP_getSelectedItem ( ShopItemList *  list)

The item at the list's selection, of the shop's or of the bag's sellable ones (list->getSelected)

Definition at line 312 of file item_list.c.

Referenced by STITSHOP_createItemList().

Here is the caller graph for this function:

◆ STITSHOP_refreshItemList()

void STITSHOP_refreshItemList ( ShopItemList *  list)

Lists the sellable items again, shows the page and the selection in the dialog (list->refresh)

Definition at line 321 of file item_list.c.

Referenced by STITSHOP_createItemList().

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

◆ STITSHOP_listSellable()

void STITSHOP_listSellable ( ShopItemList *  list)

Lists the bag's items of the list's type that can be sold, those with a sell price (list->listBag, again after a sale)

Definition at line 331 of file item_list.c.

Referenced by STITSHOP_createItemList(), STITSHOP_refreshItemList(), and STITSHOP_runItemList().

Here is the caller graph for this function:

◆ STITSHOP_createItemList()

ShopItemList * STITSHOP_createItemList ( ShopDialog *  dialog,
s32  type,
s32  selling 
)

Creates the item list (task) of a dialog: the items of the shop type when buying, the bag's of the item type when selling.

Definition at line 346 of file item_list.c.

Referenced by STITSHOP_reopenSellList(), STITSHOP_runBuy(), and STITSHOP_runSell().

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

◆ STITSHOP_computeStats()

void STITSHOP_computeStats ( s32  partner,
StatBlock *  out 
)

info.c

info.c

Definition at line 10 of file info.c.

Referenced by STITSHOP_fillPartnerRows().

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

◆ STITSHOP_addStat()

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, 8 to 14 a resistance.

< the first of the seven resistances

< the first of the seven resistances

< the first of the seven resistances

Definition at line 87 of file info.c.

Referenced by STITSHOP_computeStats().

Here is the caller graph for this function:

◆ STITSHOP_showStat()

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 row compares.

Definition at line 116 of file info.c.

Referenced by STITSHOP_fillPartnerRows().

Here is the caller graph for this function:

◆ STITSHOP_colorStat()

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, else 6 when a penalty lowers it (STAT_STRENGTH, STAT_DEFENSE and STAT_SPEED), 0 otherwise.

< a light blue: what is highlighted or current

Definition at line 132 of file info.c.

Referenced by STITSHOP_fillPartnerRows().

Here is the caller graph for this function:

◆ STITSHOP_showOtherChanges()

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), noting them in the partner's rows; hides the windows left over.

< a light blue: what is highlighted or current

Definition at line 171 of file info.c.

Referenced by STITSHOP_fillPartnerRows().

Here is the caller graph for this function:

◆ STITSHOP_fillPartnerRows()

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, then the others it would change.

The item is equipped to compute them and the partner's equipment put back

< ITSHOP: STITSHOP's

< ITSHOP: STITSHOP's

< ITSHOP: STITSHOP's

< ITSHOP: STITSHOP's

< ITSHOP: STITSHOP's

< ITSHOP: STITSHOP's

< ITSHOP: STITSHOP's

Definition at line 203 of file info.c.

Referenced by STITSHOP_refreshPartner(), and STITSHOP_showPartnerStats().

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

◆ STITSHOP_createInfoWindows()

void STITSHOP_createInfoWindows ( ShopInfo *  info,
ShopInfoWindows *  win 
)

Creates the details panel's windows: the item's rows, then, when buying, each partner's name, stats and stat changes.

Definition at line 351 of file info.c.

Referenced by STITSHOP_updateInfo().

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

◆ STITSHOP_showItemRows()

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.

< ITMNAM

< ITSHOP: STITSHOP's

< ITSHOP: STITSHOP's

< ITSHOP: STITSHOP's

Definition at line 398 of file info.c.

Referenced by STITSHOP_closeBuyInfo(), STITSHOP_openBuyInfo(), STITSHOP_refreshPartner(), STITSHOP_runSellInfo(), and STITSHOP_setInfoItem().

Here is the caller graph for this function:

◆ STITSHOP_showItemDesc()

void STITSHOP_showItemDesc ( ShopInfo *  info,
ShopInfoWindows *  win,
s32  show 
)

Shows the item's description and, for a weapon, its kind; or hides them.

< ITMINF

< ITSHOP: STITSHOP's

Definition at line 426 of file info.c.

Referenced by STITSHOP_closeBuyInfo(), STITSHOP_hideBuyInfoPage(), STITSHOP_runBuyInfo(), STITSHOP_runSellInfo(), STITSHOP_setInfoItem(), and STITSHOP_startInfoPageTurn().

Here is the caller graph for this function:

◆ STITSHOP_showPartnerStats()

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.

< what is unavailable

Definition at line 446 of file info.c.

Referenced by STITSHOP_closeBuyInfo(), STITSHOP_runBuyInfo(), STITSHOP_setInfoItem(), and STITSHOP_startInfoPageTurn().

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

◆ STITSHOP_drawStatsPage()

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 the stats the item changes or a cross.

< 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 483 of file info.c.

Referenced by STITSHOP_updateInfo().

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

◆ STITSHOP_runBuyInfo()

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), and fades out when closed (50)

Definition at line 603 of file info.c.

Referenced by STITSHOP_updateInfo().

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

◆ STITSHOP_runSellInfo()

void STITSHOP_runSellInfo ( ShopInfo *  info,
ShopInfoWindows *  win 
)

The details panel's first page: fades in, shows the item, then fades out when closed.

Definition at line 711 of file info.c.

Referenced by STITSHOP_updateInfo().

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

◆ STITSHOP_updateInfo()

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.

< 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 751 of file info.c.

Referenced by STITSHOP_createInfo().

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

◆ STITSHOP_setInfoItem()

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 only refreshed while the page is shown.

Definition at line 812 of file info.c.

Referenced by STITSHOP_createInfo().

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

◆ STITSHOP_closeInfo()

void STITSHOP_closeInfo ( ShopInfo *  info)

Closes the details panel (info->close), when it is open and idle.

Definition at line 829 of file info.c.

Referenced by STITSHOP_createInfo().

Here is the caller graph for this function:

◆ STITSHOP_setKindVisible()

void STITSHOP_setKindVisible ( ShopInfo *  info,
s32  visible 
)

Shows or hides the weapon's kind in the details panel (info->setKindVisible)

Definition at line 836 of file info.c.

Referenced by STITSHOP_createInfo().

Here is the caller graph for this function:

◆ STITSHOP_turnInfoPage()

void STITSHOP_turnInfoPage ( ShopInfo *  info)

Turns the details panel between the description and the partners' stats (info->turnPage); only for the items of kinds 3 to 5, which have stats.

< SYSTEM06

Definition at line 844 of file info.c.

Referenced by STITSHOP_createInfo().

Here is the caller graph for this function:

◆ STITSHOP_refreshPartner()

void STITSHOP_refreshPartner ( ShopInfo *  info,
s32  member 
)

Refreshes the details panel once the item is equipped on a party member (info->refreshPartner): the item's rows and that partner's.

Definition at line 856 of file info.c.

Referenced by STITSHOP_createInfo().

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

◆ STITSHOP_createInfo()

ShopInfo * STITSHOP_createInfo ( s32  selling,
s32  item 
)

Creates the details panel (task) of the item selected, when buying or selling.

Definition at line 865 of file info.c.

Referenced by STITSHOP_runBuy(), and STITSHOP_runSell().

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

◆ STITSHOP_createShopWindows()

void STITSHOP_createShopWindows ( ItemShop *  shop,
ItemShopWindows *  win 
)

shop.c

shop.c

Definition at line 8 of file shop.c.

Referenced by STITSHOP_updateShop().

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

◆ STITSHOP_drawShop()

void STITSHOP_drawShop ( ItemShop *  shop,
ItemShopWindows *  win 
)

Draws the shop's four frames as they open by scaling, and the background, which scrolls one pixel every other frame, wrapping at 96.

< 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

< 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

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

Definition at line 21 of file shop.c.

Referenced by STITSHOP_updateShop().

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

◆ STITSHOP_runShop()

void STITSHOP_runShop ( ItemShop *  shop,
ItemShopWindows *  win 
)

Opens the shop's panels, then up/down and cross pick buy or sell and run that dialog, reopening after it; triangle closes the panels and fades out.

< SHPNAM

< ITSHOP: STITSHOP's

< ITSHOP: STITSHOP's

< ITSHOP: STITSHOP's

< ITSHOP: STITSHOP's

< SYSTEM02: a cursor moves

< SYSTEM00: a choice is taken

< SYSTEM01

Definition at line 60 of file shop.c.

Referenced by STITSHOP_updateShop().

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

◆ STITSHOP_updateShop()

void STITSHOP_updateShop ( ItemShop *  shop,
ItemShopWindows *  win 
)

The shop's task: loads its files, then runs it; goes back to the field when killed.

Definition at line 171 of file shop.c.

Referenced by STITSHOP_createShop().

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

◆ STITSHOP_showMoney()

void STITSHOP_showMoney ( ItemShop *  shop)

Shows the money left (shop->showMoney), after buying or selling.

Definition at line 206 of file shop.c.

Referenced by STITSHOP_createShop().

Here is the caller graph for this function:

◆ STITSHOP_createShop()

ItemShop * STITSHOP_createShop ( void  )

Creates the item shop (task) for the shop of the mode's argument.

Definition at line 214 of file shop.c.

Here is the call graph for this function:

◆ STITSHOP_loadFiles()

void STITSHOP_loadFiles ( void  )

Loads the shop's textures and requests its strings.

< ITSHOP: STITSHOP's

< ITMNAM

< ITMINF

< SHPNAM

Definition at line 224 of file shop.c.

Here is the call graph for this function:

◆ STITSHOP_filesLoading()

s32 STITSHOP_filesLoading ( void  )

Whether the shop's strings are still loading.

< ITSHOP: STITSHOP's

< ITMNAM

< ITMINF

< SHPNAM

Definition at line 237 of file shop.c.

◆ STITSHOP_startFade()

void STITSHOP_startFade ( PanelAnim *  fade,
s32  fadeIn 
)

◆ STITSHOP_updateFade()

s32 STITSHOP_updateFade ( PanelAnim *  fade)

◆ STITSHOP_startLerp()

void STITSHOP_startLerp ( MenuLerp *  lerp,
s32  from,
s32  to,
s32  frames 
)

◆ STITSHOP_updateLerp()

s32 STITSHOP_updateLerp ( MenuLerp *  lerp)

◆ STITSHOP_getShopItems()

s16 * STITSHOP_getShopItems ( s32  shop)

equip.c

equip.c

Definition at line 7 of file equip.c.

◆ STITSHOP_canEquip()

s32 STITSHOP_canEquip ( s32  partner,
s32  item 
)

1 when a partner can equip an item: the partner's bit in its partners

Definition at line 16 of file equip.c.

◆ STITSHOP_compareEquip()

s32 STITSHOP_compareEquip ( s32  partner,
s32  item 
)

Which equipment slot a bought item would go in: 2 or 3 for the weapons (the one with the weaker item when both are taken), 4 or 5 for the accessories (the one with the same group, else the weaker one); -1 when it can't.

< takes slots 2 and 3

< takes slots 2 and 3

< one of its group at a time

< one of its group at a time

< one of its group at a time

Definition at line 23 of file equip.c.

◆ STITSHOP_equip()

void STITSHOP_equip ( s32  partner,
s32  slot,
s32  item,
s32  fromBag 
)

Puts an item in a partner's equipment slot like STSTATUS_equip, moving the counts between GAME.items and GAME.equippedItems only when fromBag is set.

< takes slots 2 and 3

< takes slots 2 and 3

< one of its group at a time

< takes slots 2 and 3

Definition at line 115 of file equip.c.

Variable Documentation

◆ STITSHOP_sellLists

s32 STITSHOP_sellLists[]
extern

STITSHOP's data (data/stitshop.c), in its order.

the item list each kind of sale shows

STITSHOP's data (data/stitshop.c), in its order.

Definition at line 6 of file stitshop.c.

Referenced by STITSHOP_reopenSellList(), and STITSHOP_runSell().

◆ STITSHOP_changePos

Vec2 STITSHOP_changePos[]
extern

Where the stat change arrows go in a partner's column.

Definition at line 10 of file stitshop.c.

Referenced by STITSHOP_drawStatsPage().

◆ STITSHOP_stats

s32 STITSHOP_stats[]
extern

the stats the info shows

the stats the info shows

Definition at line 15 of file stitshop.c.

Referenced by STITSHOP_colorStat(), STITSHOP_showOtherChanges(), and STITSHOP_showStat().

◆ STITSHOP_kindStrings

s32 STITSHOP_kindStrings[]
extern

the strings of the item kinds

the strings of the item kinds

Definition at line 21 of file stitshop.c.

Referenced by STITSHOP_showItemDesc().

◆ STITSHOP_shopNames

s32 STITSHOP_shopNames[]
extern

The shops' names, by ItemShop.shop.

Definition at line 27 of file stitshop.c.

Referenced by STITSHOP_runShop().

◆ STITSHOP_shops

ShopList STITSHOP_shops[31]
extern

STITSHOP_stock0 to 30, the items of each shop, are only STITSHOP_shops'.

STITSHOP_stock0 to 30, the items of each shop, are only STITSHOP_shops'.

Definition at line 194 of file stitshop.c.

Referenced by STITSHOP_getShopItems().

◆ STITSHOP_funcs