Alchemy

shop

games/tbs/src/shop on GitHub

The Shops guide explains this folder.

Folders

shop.c

games/tbs/src/shop/shop.c

The shop object: every counter the party trades at. Shops that buy, sell and repair, the artifact and Game Ticket counters, the sanctum's healing services, the inn, and the item picker scenes use.

Everything lives in one work block, struct ShopRuntime, reached as gMenuWork while a counter is open. shop_internal.h holds what every part shares (includes, the shop actions and the values that differ by edition); the code is in the files under shop/, included here in the order it has in the ROM. Camelot's own files are not recoverable: the ROM shows one object, and these parts are ours, cut where one family ends and the next begins. README.md in this folder gives the words and prefixes. Where to start:

  Shops           run.c: Shop_Run; buy.c: Shop_SelectBuy; sell.c:
                  Shop_SelectSell; repair.c: Shop_SelectRepair
  Stock           artifacts.c: EventTable_ApplyRowAbilities,
                  Shop_BuySpecialItem
  Sanctum         sanctum.c: Sanctum_RunPartyService
  Inn             inn.c: Inn_CheckIn
  Item picker     item_picker.c: Shop_PickUnitItem

shop_internal.h

games/tbs/src/shop/shop_internal.h

Enumerations

ShopAction

enum ShopAction

English menu entries 48..51 establish the four shop actions.

Value=
SHOP_ACTION_BUY
SHOP_ACTION_SELL
SHOP_ACTION_ARTIFACTS
SHOP_ACTION_REPAIR

Line 56

SanctumService

enum SanctumService

These service kinds select the existing condition, fee and cure branches.

Value=
SANCTUM_SERVICE_REVIVE
SANCTUM_SERVICE_CURE_POISON
SANCTUM_SERVICE_EXORCISE
SANCTUM_SERVICE_REMOVE_CURSE

Line 64

Macros, without a comment: SHOP_CANNOT_REMOVE_STATUS, SHOP_CANNOT_REMOVE_STATUS, SHOP_CONFIRM_MENU_X, SHOP_CONFIRM_MENU_X, SHOP_PRICE_NUMBER_X, SHOP_PRICE_LABEL_X, SHOP_PRICE_NUMBER_X, SHOP_PRICE_LABEL_X, SHOP_PRICE_NUMBER_X, SHOP_PRICE_LABEL_X, SHOP_EMPTY_GRID_X, SHOP_EMPTY_GRID_Y, SHOP_EMPTY_GRID_X, SHOP_EMPTY_GRID_Y, SHOP_MONEY_WINDOW_WIDTH, SHOP_DRAW_MESSAGE, SHOP_MONEY_WINDOW_WIDTH, SHOP_DRAW_MESSAGE, SANCTUM_PRICE_WINDOW_X, SANCTUM_PRICE_WINDOW_WIDTH, SANCTUM_PRICE_WINDOW_X, SANCTUM_PRICE_WINDOW_WIDTH, SANCTUM_PRICE_WINDOW_X, SANCTUM_PRICE_WINDOW_WIDTH, SHOP_USE_WINDOW_X, SHOP_USE_WINDOW_WIDTH, SHOP_USE_WINDOW_X, SHOP_USE_WINDOW_WIDTH, SHOP_ITEM_NOTE_X, SHOP_ITEM_NOTE_X, SHOP_QUANTITY_CURSOR_X, SHOP_QUANTITY_CURSOR_X.

On this page