61 if (slot > inventoryCount - 1)
62 slot = inventoryCount - 1;
71 Shop_DrawMsg(descriptionWindow, itemId + MsgItemPlainName);
86 slot = (slot + inventoryCount) % inventoryCount;
92 slot = (slot + inventoryCount) % inventoryCount;
99 while (slot >= inventoryCount)
106 if (slot >= inventoryCount)
170 messageBase = MsgShopRepairConfirm;
#define ITEM_USE_MAY_BREAK
breaks one time in eight
s32 Shop_ConfirmEquip(s32 unitId, s32 slot)
Offers to equip the item just bought, unless it is equipped already, the member cannot equip it,...
s32 Shop_SellOld(s32 unitId, s32 slot)
Offers to sell the item the new one replaced, unless there is none or it is a Psynergy item or indisp...
void Shop_DrawMoney(void)
Draws the party's coins in the coins window, in the edition's layout.
void Shop_DrawMsg(struct UiWindow *window, s32 message)
Shows message, an item's description, in the help window; a NULL window is ignored.
void Shop_DrawItemPrice(struct UiWindow *window, s32 itemId, s32 price, s32 priceKind)
Draws the item's name and below it its price.
void Shop_PlaceCursor(struct UiWindow *window, s32 x, s32 y)
Starts the hand cursor's glide to (x, y) pixels inside window (the screen when it is NULL),...
struct BattleUnit * UnitGetFar(u32 owner)
struct ItemDefinition * Item_GetDirectFar(s32 item)
s32 Inventory_CountFar(s32 owner)
s32 Inventory_FindEquippedFar(s32 owner, s32 type)
s32 Inventory_RepairFar(s32 owner, s32 slot)
s32 Party_AdjustCoinsFar(s32 amount)
void AudioCommand_PlayFar(s32 id)
struct UiWindow * UiWindow_CreateFar(s32 x, s32 y, s32 width, s32 height, s32 attrs)
void UiWork_FinalizeFar(struct UiWindow *work, s32 release)
void UiWork_PushValueSlotFar(u32 value, u32 kind)
void UiWork_FinalizePendingCoreFar(void)
void WaitFrames(s32 frames)
The game's frame loop: runs frames frames and returns.
struct GameState gGameState
volatile u32 gKeysPressed
Keys that went down this frame.
volatile u32 gKeysRepeat
Pressed keys, repeating while held: after 19 frames, then every 6.
s32 Shop_SelectRepair(s32 unitId)
Lets the player choose items to repair from the member's grid, one at a time, with each one's repair ...
s32 Shop_RepairPrice(s32 inventoryEntry)
Returns what a repair costs: a quarter of the price for a broken item, nothing for one that is not br...
s32 Shop_SelectUnit(void)
Runs the repair counter's member choice; always returns 0.
void Shop_RepairItem(s32 unitId, s32 slot)
Repairs the item in slot: refuses one that cannot break, is not broken or is equipped and cursed on,...
void UiMessage_ShowAndRestoreState(s32 messageId)
Shows a shopkeeper's line as UiMessage_ShowAndWait does, hiding the hand cursor while it shows and pu...
s32 UiMessage_ShowChoice(s32 choice)
Runs the Yes or No choice beside the shopkeeper's line and returns it, keeping the hand cursor's moti...
void UiMessage_ShowAndWait(s32 messageId)
Shows a shopkeeper's line and waits for its window to finish, one more frame included.
s32 Shop_PickUnit(void)
Lets the player choose whose items to sell or repair, with the coins window and the member's item gri...
void Shop_DrawUnitGrid(struct UiWindow *window, s32 unitId)
Draws the member's items as icons in rows of five, or a line saying it has none.
What every part of the shop object shares: its includes, the shop actions and sanctum services,...
#define SE_MENU_CURSOR_MOVE
A unit in battle: a party member's or an enemy's stats, Psynergy, items, Djinn and ailments.
u16 inventory[15]
Items held, one entry each: bits 15..11 quantity | 10 broken | 9 equipped | 8..0 item id (INVENTORY_*...
An item's definition: its price, type, who can equip it, its bonuses and unleash, its effects and the...
u8 useType
what using it costs (ITEM_USE_), or 0 for nothing
u8 type
enum ItemType; 0 for an item that is not equipment
s8 active
its UI_SPRITE_ motion; 0 while free
struct RenderOutput * anchor
the cursor's sprite, moved with its OAM
A shop's work: its windows, the party members' icons, the stock, the cursor and its icons,...
struct UiWindow * itemWindow
struct ShopCursor cursor
the hand cursor
u8 mode
passed on as the hand cursor's kind; set to 12 at first
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...