Skip to Content
The Alchemy Project

src/shop/shop_sell.c

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

Included by shop.c.

Functions

NameDescription
Sint32mnShopChooseMember (void)Lets the player choose whose items to sell or repair, until B.
Sint32mnShopSelectSell (Sint32 unitId)Lets the player choose items to sell from the party member's grid, one at a time, with each one's price and description, until B or the inventory is empty.
voidmnShopDrawMemberItems (WINDOW *window, Sint32 unitId)Draws the party member's items as icons in rows of five, or a line saying it has none.
Sint32mnShopSelectSellCount (Sint32 unitId, Sint32 slot)Asks how many to sell of a stack, and returns the count, -1 when cancelled.
voidmnShopSellItem (Sint32 unitId, Sint32 slot, Sint32 count)Sells count of the item in slot, after the shopkeeper's offer that fits it and a Yes; whatever the shops keep a stock of goes back on sale.

Description

Selling: choosing a party member, the item grid and the sale. Part of shop.c.

Functions in detail

mnShopChooseMember

Sint32 mnShopChooseMember(void)

Lets the player choose whose items to sell or repair, until B.

References gmInventoryCountStub(), mnCreatePartyFiguresStub(), mnCursorPlace(), mnReleasePartyFiguresStub(), mnShopDrawMemberItems(), mnShopDrawMoney(), mnShopDrawParty(), mnShopSelectRepair(), mnShopSelectSell(), mnWindowCloseStub(), mnWindowCreateStub(), PerPush, PerRepeat, Sint32, sySoundPlayStub() and sySynch().

Referenced by mnShopRun() and mnShopRunRepairMemberChoice().

Definition at line 6 of file shop_sell.c.

mnShopSelectSell

Sint32 mnShopSelectSell(Sint32 unitId)

Lets the player choose items to sell from the party 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.

References gmInventoryCountStub(), gmUnitGetStub(), mnCursorPlace(), mnShopDrawItemPrice(), mnShopDrawMessage(), mnShopSalePrice(), mnShopSelectSellCount(), mnShopSellItem(), mnShopShowKeeperMessage(), mnWindowCloseStub(), mnWindowCreateStub(), PerPush, PerRepeat, Sint32, sySoundPlayStub() and sySynch().

Referenced by mnShopChooseMember().

Definition at line 88 of file shop_sell.c.

mnShopDrawMemberItems

void mnShopDrawMemberItems(WINDOW *window, Sint32 unitId)

Draws the party member's items as icons in rows of five, or a line saying it has none.

References gmInventoryCountStub(), gmUnitGetStub(), mnTextDrawMessageStub(), mnWindowSpriteCreateLoadedStub(), mnWindowSpritePrepareForRedrawStub() and Sint32.

Referenced by mnItemPickerRun(), mnShopChooseMember(), mnShopConfirmEquip(), mnShopRepairItem() and mnShopSellItem().

Definition at line 209 of file shop_sell.c.

mnShopSelectSellCount

Sint32 mnShopSelectSellCount(Sint32 unitId, Sint32 slot)

Asks how many to sell of a stack, and returns the count, -1 when cancelled.

References gmInventoryGetQuantityStub(), gmItemGetDefinitionStub(), gmUnitGetStub(), mnCursorPlace(), mnIconShowStub(), mnShopSalePrice(), mnShopSelectQuantity(), mnShopShowKeeperMessage(), Sint32 and sySynch().

Referenced by mnShopSelectSell().

Definition at line 260 of file shop_sell.c.

mnShopSellItem

void mnShopSellItem(Sint32 unitId, Sint32 slot, Sint32 count)

Sells count of the item in slot, after the shopkeeper's offer that fits it and a Yes; whatever the shops keep a stock of goes back on sale. A count of -1 sells the one old piece of equipment a purchase replaced.

References gmInventoryDiscardStub(), gmItemGetDefinitionStub(), gmPartyAdjustCoinsStub(), gmUnitGetStub(), mnMessageArgumentPushStub(), mnShopAskYesNo(), mnShopDrawMemberItems(), mnShopDrawMoney(), mnShopSalePrice(), mnShopShowKeeperMessageHidingCursor(), Sint32 and sySoundPlayStub().

Referenced by mnShopSelectSell() and mnShopSellOld().

Definition at line 299 of file shop_sell.c.