Alchemy
Loading...
Searching...
No Matches

sell.c File Reference

Selling: choosing a party member, the item grid and the sale. More...

Go to the source code of this file.

Functions

s32 Shop_PickUnit (void)
 Lets the player choose whose items to sell or repair, with the coins window and the member's item grid, and runs Shop_SelectSell or Shop_SelectRepair for each member chosen until B.
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 description, until B or the inventory is empty.
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.
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, -1 when cancelled), putting the cursor back after.
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, asks with the offer that fits (an old item the player just replaced, a broken one, a stack, a rare one), then discards them, pays the coins and redraws.

Detailed Description

Selling: choosing a party member, the item grid and the sale.

Part of shop.c, the shop object, compiled only through it.

Definition in file sell.c.

Function Documentation

◆ Shop_PickUnit()

s32 Shop_PickUnit ( void )

Lets the player choose whose items to sell or repair, with the coins window and the member's item grid, and runs Shop_SelectSell or Shop_SelectRepair for each member chosen until B.

Called by Shop_Run for Sell and Repair.

Definition at line 11 of file sell.c.

Referenced by Shop_PickUnit(), Shop_Run(), and Shop_SelectUnit().

◆ Shop_SelectSell()

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 description, until B or the inventory is empty.

Returns -1 when cancelled, 0 when the inventory ran out. Called by Shop_PickUnit.

Definition at line 83 of file sell.c.

Referenced by Shop_PickUnit(), and Shop_SelectSell().

◆ Shop_DrawUnitGrid()

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.

Called by the sell, repair and drop screens each time the member changes, and after a sale.

Definition at line 190 of file sell.c.

Referenced by Shop_ConfirmEquip(), Shop_DrawUnitGrid(), Shop_PickUnit(), Shop_PickUnitItem(), Shop_RepairItem(), and Shop_SellItem().

◆ Shop_SelectSellNum()

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, -1 when cancelled), putting the cursor back after.

Called by Shop_SelectSell.

Definition at line 231 of file sell.c.

Referenced by Shop_SelectSell(), and Shop_SelectSellNum().

◆ Shop_SellItem()

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, asks with the offer that fits (an old item the player just replaced, a broken one, a stack, a rare one), then discards them, pays the coins and redraws.

count -1 is the old equipment the equip prompt offers to sell (Shop_SellOld).

Definition at line 269 of file sell.c.

Referenced by Shop_SelectSell(), Shop_SellItem(), and Shop_SellOld().