27 for (i = 0; i < 6; i++) {
37 for (j = 0; j < 2; j++) {
49 for (j = 0; j < 2; j++) {
92 for (i = 0; i < 6; i++) {
99 }
else if (stat - 1 < 6U) {
105 }
else if (stat - 8 < 7U) {
137 if (row->
stat == 0) {
139 }
else if (row->
stat == 1) {
141 }
else if (row->
stat == 4) {
161 }
else if (v[0] < v[1]) {
177 for (i = 0; i < 13; i++) {
182 p->
rows[n + 2] = i + 1;
195 for (i = n; i < 4; i++) {
376 for (j = 0; j < 2; j++) {
433 if (item->
type >= 2 && item->
type < 14) {
460 for (j = 0; j < 2; j++) {
463 for (j = 0; j < 8; j++) {
471 for (j = 0; j < 2; j++) {
474 for (j = 0; j < 8; j++) {
502 sprite.
setPivot(i * 0x64 + 0x3C, 0xC0);
545 if (info->
page == 0) {
556 if (info->
page == 0) {
576 if (info->
page == 0) {
588 if (info->
page == 0) {
630 if (info->
page == 0) {
645 if (info->
page == 0) {
656 if (info->
page == 0) {
664 if (info->
page == 0) {
756 switch (info->
state) {
760 for (i = 0; i < 3; i++) {
790 sprite.
setPivot(0x140, offset + 0x81);
817 if (info->
shown != 0) {
819 if (info->
page == 0) {
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...
#define TEXT_ITEM_INFO
ITMINF.
#define TEXT_ITEM_SHOP
ITSHOP: STITSHOP's.
#define TEXT_ITEM_NAMES
ITMNAM.
#define FILE_MENU_SPRITES
Files the engine loads by number.
FileCache FILE_CACHE
The file cache.
#define IS_WEAPON_TYPE(type)
ItemInfo.type's ranges: 2-14 weapons, 15-20 armour, 21-24 accessories, each tested as one unsigned by...
#define STAT_STRENGTH
the six battle stats
#define ITEM_KIND_ACCESSORY
#define IS_ARMOR_TYPE(type)
#define IS_ACCESSORY_TYPE(type)
#define STAT_RESISTS
the first of the seven resistances
#define SCREEN_LAYER
The layer over the whole screen that most modes create first and draw their menus on (FIELDSTG and ST...
#define STRETCH_SPRITE_V(sprite, level, x, y)
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...
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.
ShopInfo * STITSHOP_createInfo(s32 selling, s32 item)
Creates the details panel (task) of the item selected, when buying or selling.
void STITSHOP_createInfoWindows(ShopInfo *info, ShopInfoWindows *win)
Creates the details panel's windows: the item's rows, then, when buying, each partner's name,...
void STITSHOP_refreshPartner(ShopInfo *info, s32 member)
Refreshes the details panel once the item is equipped on a party member (info->refreshPartner): the i...
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),...
static s32 STITSHOP_lineY(ShopInfo *info, s32 y)
The y of a line of the details panel, two lower when selling.
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...
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 ...
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...
static void STITSHOP_endBuyInfo(ShopInfo *info, ShopInfoWindows *win)
Ends the details panel once its panels have closed.
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,...
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,...
void STITSHOP_closeInfo(ShopInfo *info)
Closes the details panel (info->close), when it is open and idle.
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_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...
void STITSHOP_setKindVisible(ShopInfo *info, s32 visible)
Shows or hides the weapon's kind in the details panel (info->setKindVisible)
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...
void STITSHOP_turnInfoPage(ShopInfo *info)
Turns the details panel between the description and the partners' stats (info->turnPage); only for th...
void STITSHOP_showItemDesc(ShopInfo *info, ShopInfoWindows *win, s32 show)
Shows the item's description and, for a weapon, its kind; or hides them.
static void STITSHOP_startInfoPageTurn(ShopInfo *info, ShopInfoWindows *win)
Turning the page (info->turnPage): updates the page hint and closes the page that was shown.
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...
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_runBuyInfo(ShopInfo *info, ShopInfoWindows *win)
The details panel's states when buying: fades in its first page, turns between the pages (10-16),...
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,...
STITSHOP.PRO: the item shop.
#define FILE_SHOP_SPRITES
The shop's sprite sheet; the next file is its texture archive.
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
#define SOUND_MENU_MOVE
SYSTEM06.
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.
s32 STITSHOP_kindStrings[]
The strings of the item kinds (the records' kind)
ItemShopFuncs STITSHOP_funcs
The shop's helpers.
Vec2 STITSHOP_changePos[]
Where the stat change arrows go in a partner's column.
void *(* getEntry)(u32 fileAndIndex)
struct PartnerStats *(* getPartnerStats)(s32 partner)
s32(* getPartyMember)(u32 index)
The game state (GAME): the first 0x26BC bytes are what newGame clears (the save data),...
s8 items[0x193]
counts, up to 99
Partner partners[PARTNER_COUNT]
s32(* getCategory)(s32 item)
getItemCategory
s32(* isKind)(s32 item, s32 kind)
ItemInfo.kind == kind.
struct ItemInfo *(* get)(s32 item)
getItem
An item (ITEMS, ITEM_FUNCS)
u8 type
2-14 weapons, 15-20 armour, 21-24 accessories
u16 sellPrice
0: cannot be sold
ItemRecord data
the type's record, or the usable items' effect
void(* equip)(s32 partner, s32 slot, s32 item, s32 fromBag)
s32(* updateFade)(PanelAnim *fade)
void(* startFade)(PanelAnim *fade, s32 fadeIn)
s32(* compareEquip)(s32 partner, s32 item)
s32(* canEquip)(s32 partner, s32 item)
PartnerStats.equip as a whole: STSTATUS and STITSHOP save it with a struct copy before they equip an ...
A partner Digimon from its name on (Partner.info), as getPartnerStats gives it.
TextWindow * equippedLabel
TextWindow * kind
the weapons'
TextWindow * owned
GAME.items.
ShopInfoPartner partners[3]
TextWindow * equipped
GAME.equippedItems.
The panel with the selected item's details (STITSHOP_createInfo)
void(* nextState)(struct ShopInfo *task)
void(* turnPage)(struct ShopInfo *info)
void(* showItem)(struct ShopInfo *info, s32 item, s32 quantity)
void(* close)(struct ShopInfo *info)
void(* setKindVisible)(struct ShopInfo *info, s32 visible)
s32 page
0: the description, 1: the partners' stats
void(* refreshPartner)(struct ShopInfo *info, s32 member)
ShopPartnerInfo partners[3]
What the details panel shows of a partner.
s32 changes
how many of the stats would change
s32 rows[8]
from 2: the stats that change (from 1)
StatBlock withItem
with the item equipped
A row of the details panel's stats.
s32 compare
show the stat with the item equipped
s32 stat
into STITSHOP_stats
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(* draw)()
(sheet, frame, x, y)
void(* setTexture)()
(x, y)
PartnerStats' stats[] and the status[] after them as one block, which computeStats and STITSHOP_compu...
s16 penalties[3]
subtracted from STAT_STRENGTH, STAT_DEFENSE and STAT_SPEED
A text window (createTextWindow): up to six text buffers (0 is shown, 1-5 are "work" buffers that con...
void(* setPalette)(struct TextWindow *obj, u8 arg)
void(* setRightAlign)()
no prototype: callers would truncate u8 args
void(* setLines)()
no prototype: callers would truncate u8 args
void(* setVisible)(struct TextWindow *obj, u8 arg)
u16 amounts[2]
what it adds to stats[]
s16 charisma
what it adds to STAT_CHARISMA (computeStats); armour and accessories too
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
#define PALETTE_BLUE
a light blue: what is highlighted or current
#define PALETTE_WHITE
The text windows' palettes (TextWindow.palette, setPalette): rows of the font's CLUTs,...
#define PALETTE_GREY
what is unavailable
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.