1#ifndef ALCHEMY_UNIT_SHOP_SHOP_H
2#define ALCHEMY_UNIT_SHOP_SHOP_H
s32 EventTable_CopyRowHeader(s32 stockRow, s16 *output)
Copies the shop's ordinary stock, up to 24 items, to output with a 0 after, and returns how many.
s32 EventTable_GetRowType(s32 stockRow)
Returns the shop's type from the last column of its stock row: 0 items, 1 weapons,...
s32 EventTable_GetRowLimit(void)
Returns how many stock rows there are; Shop_Run refuses a row past them.
void Shop_BuySpecialItem(struct UiWindow *window, struct UiWindow *itemWindow)
Gives a Game Ticket once the party's shop credit (what it has spent in shops) reaches the next ticket...
void EventTable_ApplyRowAbilities(s32 stockRow)
Adds a shop's artifacts to the shared stock counters once, on its first visit, and sets the shop's fl...
void Shop_DrawParty(struct UiWindow *window, s32 selected, s32 itemId)
Shows the chosen member walking and the others standing, and draws at four fifths of their size the m...
void Shop_DrawUnitItem(struct UiWindow *window, s32 unitId, s32 itemId)
Shows the quantity already carried and the member's inventory icons.
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_SalePrice(s32 inventoryEntry)
Returns what the shops pay for an inventory entry: nothing for an indispensable item,...
void Shop_DrawEquipComparison(struct UiWindow *window, s32 unitId, s32 itemId)
Shows how Attack, Defense and Agility would change if the member wore the item: equips it in place of...
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_BuyDone(s32 unitId, s32 itemId, s32 quantity)
Adds each item bought to the member, charging its price and adding it to the shop credit one at a tim...
void Shop_DrawMoney(void)
Draws the party's coins in the coins window, in the edition's layout.
s32 Shop_SelectBuy(void)
Runs the Buy and Artifacts counters: the player browses the stock seven items a page,...
void Shop_DrawMsg(struct UiWindow *window, s32 message)
Shows message, an item's description, in the help window; a NULL window is ignored.
s32 Shop_SelectQuantity(s32 minimum, s32 maximum, s32 price)
Chooses how many items to buy or sell, returning the quantity above minimum or -1 when cancelled.
s32 Shop_SelectBuyNum(s32 unitId, s32 itemId)
Asks how many to buy when the item stacks, limited by what the coins buy, the artifact's stock and a ...
void Shop_DrawItemPrice(struct UiWindow *window, s32 itemId, s32 price, s32 priceKind)
Draws the item's name and below it its price.
void Shop_DrawStock(struct UiWindow *window, s32 selected)
Draws a page of seven stock items with their prices, the page arrows, and the chosen item lifted and ...
void Shop_SetCursor(struct ShopCursor *cursor, s32 targetX, s32 targetY, s32 kind)
Starts a glide of the cursor from where it is to (targetX, targetY) over kind frames,...
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),...
void ShopCursor_Advance(struct ShopCursor *cursor)
Moves the cursor from its saved position toward its target, in a straight line over kind frames,...
void Shop_CopyGlyphs(s32 digit, u8 *tileBuffer, u32 digitPosition)
Copies decimal glyph digit into its price-tile position, stopping at zero source bytes.
void Shop_RestoreFieldPalette(void)
Fades back to the colours Shop_SaveAndTintFieldPalette saved, over 16 frames.
struct RenderOutput * Shop_CreatePriceSprite(s32 value, struct UiWindow *window, s32 x, s32 y)
Builds a price of up to five digits in scratch tiles (heap slot 14), loads them into a free VRAM cach...
void Shop_SaveAndTintFieldPalette(s32 layer)
Saves the field colours in event work and fades to layer over 16 frames.
void ShopCursor_SetPositionImmediate(struct ShopCursor *cursor, s32 x, s32 y)
Places the cursor and its sprite at (x, y) at once, with a one-frame glide that has already arrived.
void ShopCursor_MoveTowardTarget(struct ShopCursor *cursor)
Moves each cursor axis one quarter of the remaining distance, with a minimum one-pixel step.
void Shop_FillSelector(s32 itemCount, s32 paletteSelector, u8 *tileBuffer)
Colours the first itemCount segments of the quantity bar with palette paletteSelector,...
void Inn_PlaySleep(s32 roomPrice)
Charges roomPrice, restores the HP and PP of each member still standing, and plays the night: a fade ...
s32 Inn_CheckIn(s32 innId, s32 objectId)
Runs an inn's counter: the innkeeper names the price, and on Yes, with the coins, the party sleeps (I...
s32 Inn_RoomPrice(s32 innId)
Returns the night's price: the inn's price per guest times the party members still standing.
s32 Shop_PickUnitItem(s32 *selectedUnit, s32 *selectedSlot)
Lets the player choose a party member, then one of its items that may be dropped.
s32 Shop_SelectUse(s32 unitId)
Lets the player choose one of the member's items to drop, refusing an indispensable or cursed equippe...
void Shop_DrawUseItem(struct UiWindow *window, s32 unitId, s32 slot)
Draws the slot's item name and, below it, why it cannot be dropped or what the whole stack would sell...
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,...
UNUSED struct NodeChainNode * NodeChain_GetNodeAtIndex(struct NodeChainState *state)
Unused original list walker: follows the requested number of next links.
void Shop_ReleaseCursorWork(void)
Stops the cursor task, frees the six cursor icons and the work block.
void UiMessage_ShowAndRestoreState(s32 messageId)
Shows a shopkeeper's line as UiMessage_ShowAndWait does, hiding the hand cursor while it shows and pu...
s32 Shop_ListAvailableArtifacts(void)
Lists the current shop's artifacts: every item of the shop's type whose shared stock counter is above...
s32 UiMessage_ShowChoiceVariant(s32 choice)
Runs the Yes or No choice at the sanctum's place on the screen and returns it, keeping the hand curso...
void Shop_StepCursor(void)
Advances the hand cursor one frame.
s32 Battle_ApplyPresetItemsAndFlags(s32 unused)
Opens the debug shop with 200000 coins, the ticket counter at its cap, broken equipment for repairs a...
s32 Shop_Run(s32 stockRow, s32 keeperId)
Runs a shop: the shopkeeper's welcome, then buy, sell, artifacts and repair until the player leaves.
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 AudioCommand_WaitForStateByteClear(void)
Waits one frame at a time until the sound driver has finished the last command.
void Shop_InitializeCursorWork(void)
Allocates and clears the work block in the menu's heap slot, lists the party, loads the six cursor ic...
void UiMessage_ShowAndWait(s32 messageId)
Shows a shopkeeper's line and waits for its window to finish, one more frame included.
s32 Shop_SelectSellNum(s32 unitId, s32 slot)
Asks how many to sell when the item is a stack of more than one, and returns the count (1 otherwise,...
s32 Shop_SelectSell(s32 unitId)
Lets the player choose items to sell from the member's grid, one at a time, with each one's price and...
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_SellItem(s32 unitId, s32 slot, s32 count)
Sells count of the item in slot: refuses an item the shop does not buy or one equipped and cursed on,...
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.
void Shop_RunPartyMemberIconBurst(s32 member)
Animates the selected member and service particles, then restores the menu and cursor.
void BattleUnit_ResetStateByMode(s32 unitId, s32 serviceKind)
Revives, cures poison, removes a haunting or unequips cursed items for a sanctum service.
s32 Shop_CountUnits(void)
Counts party members who need the currently selected sanctum service.
void UiMessage_ShowResolvedAndRestoreState(s32 messageId)
Resolves service dialogue, waits for it and restores the cursor's saved mode.
s32 Shop_CanServe(s32 unitId, s32 serviceKind)
Checks whether a member needs the selected sanctum service.
void UiMessage_ShowResolvedAndWait(s32 messageId)
Resolves service dialogue and waits for completion, including the final frame.
s32 Sanctum_RunPartyService(void)
Selects an eligible member, confirms the donation and applies the chosen service.
void Shop_ResetEffects(void)
Updates all 24 service particles, then randomizes the active member's pose.
void BattleFx_UpdateRadialMotion(struct EffectSlot *effect)
Picks random particle positions, moves toward the target and releases finished particles.
s32 Shop_ConfirmAct(s32 unitId)
Runs the sanctum service menu using the shared shop cursor and window resources.
void Shop_HiliteUnit(struct UiWindow *window, s32 selected)
Highlights the selected party icon and dims members who do not need the sanctum service.
s32 Shop_ServicePrice(s32 unitId, s32 serviceKind)
Calculates the existing fee for reviving, curing poison, exorcising or removing a curse.
s32 Shop_MsgByMode(s32 messageId)
Selects the matching poison, exorcism or curse-service message from a revive message base.
void Shop_DrawSelectMsg(struct UiWindow *target, s32 unitId)
Shows the selected member's service price or the message that no treatment is needed.
A particle a Psynergy effect moves and draws: its sprite, its position and target,...
A render output: a sprite in a window's output list (a character, an icon or a portrait),...
s8 kind
0 for a glyph; otherwise it owns VRAM cache slot index, freed with it, and 2 (a portrait) also its pa...
Cursor that approaches its target, shared by shop, name entry and settings.
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...
The integer types, TRUE, UNUSED and the fixed-address macros.