src/shop/shop_internal.h
What every part of the shop object shares: its includes, the shop actions and sanctum services, and the values that differ by edition. More…
#include "debug/debug.h"#include "flags.h"#include "item_ids.h"#include "battle/battle.h"#include "field/engine_stubs.h"#include "field/scene_tables.h"#include "field/stubs.h"#include "game/stubs.h"#include "graphics/graphics.h"#include "menu/stubs.h"#include "shop/shop.h"#include "sound/stubs.h"#include "game/main_routine_state.h"#include "window/select.h"#include "window/stubs.h"#include "text/msg_ids.h"
Included by shop.c, shop_buy.c, shop_cursor.c, shop_inn.c, shop_item_picker.c, shop_repair.c, shop_run.c, shop_sanctum.c, shop_sell.c, shop_stock.c and shop_tables.c.
Macros
| Name | Description | |
|---|---|---|
#define | INN_ID_XIAN 5 | The inn the inn's own code names (mnInnCheckIn's innId, a row of InnPricesPerGuest); each town's script names its own inn where it opens it. |
#define | SHOP_CANNOT_REMOVE_STATUS (discardStatus, selectionResult) | |
#define | SHOP_CONFIRM_MENU_X GERMAN_OR(6, 7) | The shop's Yes/No menu (shop_run.c): one column further left in German. |
#define | SHOP_PRICE_NUMBER_X FRENCH_OR(24, 32) | An item's price and the word after it in the price window that the buy, sell and repair lists share (mnShopDrawItemPrice, shop_buy.c), in pixels: French moves both 8 left, Spanish the word 8 right. |
#define | SHOP_PRICE_LABEL_X BY_LANGUAGE(72, 72, 72, 80, 64, 72) | |
#define | SHOP_EMPTY_GRID_X ITALIAN_OR(20, 8) | Where the item grid (mnShopDrawMemberItems, shop_sell.c), shared by the sell, repair and drop screens and the equip prompt, writes MsgNoItems for a party member with no items, in pixels. |
#define | SHOP_EMPTY_GRID_Y ITALIAN_OR(12, 20) | |
#define | SHOP_MONEY_WINDOW_WIDTH JAPANESE_OR(11, 12) | Outside Japan the coins window (SHOP_STATE.moneyWindow) is a tile wider, and every counter's item description (mnShopDrawMessage, shop_buy.c) is drawn as tiles (mnTextDrawMessageAsTilesStub) rather than into a text canvas. |
#define | SHOP_DRAW_MESSAGE | |
#define | SANCTUM_PRICE_WINDOW_X GERMAN_OR(0, 1) | The sanctum's fee window (shop_sanctum.c), wider for the German and French text. |
#define | SANCTUM_PRICE_WINDOW_WIDTH BY_LANGUAGE(23, 23, 30, 23, 25, 23) | |
#define | ITEM_PICKER_WINDOW_X JAPANESE_OR(16, 14) | The item picker's small window (shop_item_picker.c): two tiles wider, and two further left, outside Japan. |
#define | ITEM_PICKER_WINDOW_WIDTH JAPANESE_OR(14, 16) | |
#define | SHOP_ITEM_NOTE_X JAPANESE_OR(8, 0) | The x of the note below an item's name, in pixels: shop_buy.c and shop_item_picker.c both draw it. |
#define | SHOP_QUANTITY_CURSOR_X BY_LANGUAGE(128, 128, 120, 128, 120, 128) | The quantity cursor's x, in pixels: shop_buy.c and shop_sell.c both place it. |
Enumerations
| Name | Description | |
|---|---|---|
enum | SHOP_ACTION { SHOP_ACTION_BUY, SHOP_ACTION_SELL, SHOP_ACTION_ARTIFACTS, SH … } | Buy, Sell, Artifacts and Repair, held in shop->action while it runs. |
enum | SHOP_TYPE { SHOP_TYPE_ITEMS, SHOP_TYPE_WEAPONS, SHOP_TYPE_ARMOR } | A shop's type, the last column of its stock row: the equipment group it sells, as gmItemGetEquipmentGroup sorts items. |
enum | SHOP_STOCK_ROW { SHOP_STOCK_ROW_EMPTY, SHOP_STOCK_ROW_VALE_WEAPONS, SHOP_STOC … } | The stock rows the shop code itself names; each town's script names its own shops' rows where it opens them. |
enum | SANCTUM_SPARKLE_STATE { SANCTUM_SPARKLE_START, SANCTUM_SPARKLE_FLYING, SANCTUM_SPARK … } | What a sparkle of the sanctum's burst is doing (FIELD_PARTICLE.state, mnSanctumUpdateBurstSparkle). |
enum | SANCTUM_SERVICE { SANCTUM_SERVICE_REVIVE, SANCTUM_SERVICE_CURE_POISON, SANCTUM … } | What the sanctum does for one party member; each kind picks the party member's status it needs, its fee and its cure (shop_sanctum.c). |
enum | anonymous enum { SHOP_STOCK_ITEMS, SHOP_STOCK_ITEM_COUNT, SHOP_STOCK_ARTIFACT … } | Shop stock table layout (mnShopRun; SHOP_STOCK_ROW_EMPTY stands in for a row out of range). |
Variables
| Name | Description | |
|---|---|---|
extern const Uint16 | ShopQuantityBarSegmentOffsets [30] | The shop's tables (shop_tables.c). |
extern const Uint16 | ShopPriceDigitTileOffsets [5] | Where each of a price's five digits starts in its tile buffer, ones first. |
extern const Sint16 | ShopGameTicketCreditCosts [30] | The shop credit each Game Ticket costs, by how many have been given: five at each price: 300, then 500 doubling to 8000. |
extern const Sint16 | ShopUnusedItemIds [21] | Unused: a list of items ended by 0, which nothing reads: the Long Sword to the Muramasa, the Short Sword, Mint, the Demon Axe, Asura's Armor, the Cotton Shirt, the Travel Vest, Herb, Nut and the id after the Water of Life. |
extern const Sint16 | ShopStockTable [SHOP_STOCK_ROWS][SHOP_STOCK_COLUMNS] | Every shop's stock, a row by stock row: its items, artifacts and type. |
extern const Sint8 | SanctumServiceTunes [4] | The tune each service's burst plays. |
extern const Sint8 | InnPricesPerGuest [12] | The coins a night costs each living guest, by inn: Vale, Vault, Bilibin, Kolima, Imil, Xian, Altin, Kalay, Lunpa, Tolbi, Suhalla, Lalivero, in the order of their area names. |
Description
What every part of the shop object shares: its includes, the shop actions and
sanctum services, and the values that differ by edition. shop.c includes it
before the parts, and each part includes it too, so that a part read on its
own still resolves.
Macros in detail
INN_ID_XIAN
#define INN_ID_XIAN 5
The inn the inn's own code names (mnInnCheckIn's innId, a row of
InnPricesPerGuest); each town's script names its own inn where it opens it.
Referenced by mnInnCheckIn() and scLacquerRoomsBTalkToInnkeeper().
Definition at line 49 of file shop_internal.h.
SHOP_CANNOT_REMOVE_STATUS
#define SHOP_CANNOT_REMOVE_STATUS(discardStatus, selectionResult)
Referenced by mnItemPickerSelectItem().
Definition at lines 114 and 117 of file shop_internal.h.
SHOP_CONFIRM_MENU_X
#define SHOP_CONFIRM_MENU_X GERMAN_OR(6, 7)
The shop's Yes/No menu (shop_run.c): one column further left in German.
Referenced by mnShopAskYesNo().
Definition at line 125 of file shop_internal.h.
SHOP_PRICE_NUMBER_X
#define SHOP_PRICE_NUMBER_X FRENCH_OR(24, 32)
An item's price and the word after it in the price window that the buy, sell
and repair lists share (mnShopDrawItemPrice, shop_buy.c), in pixels: French
moves both 8 left, Spanish the word 8 right.
Referenced by mnShopDrawItemPrice().
Definition at line 130 of file shop_internal.h.
SHOP_PRICE_LABEL_X
#define SHOP_PRICE_LABEL_X BY_LANGUAGE(72, 72, 72, 80, 64, 72)
Referenced by mnShopDrawItemPrice().
Definition at line 131 of file shop_internal.h.
SHOP_EMPTY_GRID_X
#define SHOP_EMPTY_GRID_X ITALIAN_OR(20, 8)
Where the item grid (mnShopDrawMemberItems, shop_sell.c), shared by the sell,
repair and drop screens and the equip prompt, writes MsgNoItems for a party
member with no items, in pixels.
Referenced by mnShopDrawMemberItems().
Definition at line 136 of file shop_internal.h.
SHOP_EMPTY_GRID_Y
#define SHOP_EMPTY_GRID_Y ITALIAN_OR(12, 20)
Referenced by mnShopDrawMemberItems().
Definition at line 137 of file shop_internal.h.
SHOP_MONEY_WINDOW_WIDTH
#define SHOP_MONEY_WINDOW_WIDTH JAPANESE_OR(11, 12)
Outside Japan the coins window (SHOP_STATE.moneyWindow) is a tile wider, and
every counter's item description (mnShopDrawMessage, shop_buy.c) is drawn as
tiles (mnTextDrawMessageAsTilesStub) rather than into a text canvas.
Referenced by mnInnCheckIn(), mnSanctumRun(), mnShopChooseMember() and mnShopSelectBuy().
Definition at line 142 of file shop_internal.h.
SHOP_DRAW_MESSAGE
#define SHOP_DRAW_MESSAGE
Referenced by mnShopDrawMessage().
Definition at line 143 of file shop_internal.h.
SANCTUM_PRICE_WINDOW_X
#define SANCTUM_PRICE_WINDOW_X GERMAN_OR(0, 1)
The sanctum's fee window (shop_sanctum.c), wider for the German and French
text.
Referenced by mnSanctumRunPartyService().
Definition at line 148 of file shop_internal.h.
SANCTUM_PRICE_WINDOW_WIDTH
#define SANCTUM_PRICE_WINDOW_WIDTH BY_LANGUAGE(23, 23, 30, 23, 25, 23)
Referenced by mnSanctumRunPartyService().
Definition at line 149 of file shop_internal.h.
ITEM_PICKER_WINDOW_X
#define ITEM_PICKER_WINDOW_X JAPANESE_OR(16, 14)
The item picker's small window (shop_item_picker.c): two tiles wider, and two
further left, outside Japan.
Referenced by mnItemPickerSelectItem().
Definition at line 153 of file shop_internal.h.
ITEM_PICKER_WINDOW_WIDTH
#define ITEM_PICKER_WINDOW_WIDTH JAPANESE_OR(14, 16)
Referenced by mnItemPickerSelectItem().
Definition at line 154 of file shop_internal.h.
SHOP_ITEM_NOTE_X
#define SHOP_ITEM_NOTE_X JAPANESE_OR(8, 0)
The x of the note below an item's name, in pixels: shop_buy.c and
shop_item_picker.c both draw it.
Referenced by mnItemPickerDrawItem() and mnShopDrawItemPrice().
Definition at line 158 of file shop_internal.h.
SHOP_QUANTITY_CURSOR_X
#define SHOP_QUANTITY_CURSOR_X BY_LANGUAGE(128, 128, 120, 128, 120, 128)
The quantity cursor's x, in pixels: shop_buy.c and shop_sell.c both place it.
Referenced by mnShopSelectBuyCount() and mnShopSelectSellCount().
Definition at line 161 of file shop_internal.h.
Enumerations in detail
SHOP_ACTION
enum SHOP_ACTION
Buy, Sell, Artifacts and Repair, held in shop->action while it runs.
| Enumerator | Value | Description |
|---|---|---|
SHOP_ACTION_BUY | ||
SHOP_ACTION_SELL | ||
SHOP_ACTION_ARTIFACTS | ||
SHOP_ACTION_REPAIR |
Definition at line 29 of file shop_internal.h.
SHOP_TYPE
enum SHOP_TYPE
A shop's type, the last column of its stock row: the equipment group it
sells, as gmItemGetEquipmentGroup sorts items. It picks the artifacts the
shop lists and which of the keepers' lines it says.
| Enumerator | Value | Description |
|---|---|---|
SHOP_TYPE_ITEMS | EQUIPMENT_GROUP_NONE | |
SHOP_TYPE_WEAPONS | EQUIPMENT_GROUP_WEAPON | |
SHOP_TYPE_ARMOR | EQUIPMENT_GROUP_ARMOR |
Definition at line 40 of file shop_internal.h.
SHOP_STOCK_ROW
enum SHOP_STOCK_ROW
The stock rows the shop code itself names; each town's script names its own shops' rows where it opens them.
| Enumerator | Value | Description |
|---|---|---|
SHOP_STOCK_ROW_EMPTY | 0 | sells nothing; stands in for a bad row |
SHOP_STOCK_ROW_VALE_WEAPONS | 1 | |
SHOP_STOCK_ROW_VALE_ARMOR | 2 | |
SHOP_STOCK_ROW_XIAN_WEAPONS | 16 | Xian's weapon, armor and item shops, the warriors' shops, which greet the party with lines of their own (SHOP_STATE.warriorShop). |
SHOP_STOCK_ROW_XIAN_ARMOR | 17 | |
SHOP_STOCK_ROW_XIAN_ITEMS | 18 |
Definition at line 53 of file shop_internal.h.
SANCTUM_SPARKLE_STATE
enum SANCTUM_SPARKLE_STATE
What a sparkle of the sanctum's burst is doing (FIELD_PARTICLE.state,
mnSanctumUpdateBurstSparkle).
| Enumerator | Value | Description |
|---|---|---|
SANCTUM_SPARKLE_START | 0 | placed on a ring around the burst's centre, aimed inside it |
SANCTUM_SPARKLE_FLYING | 1 | flying in; starts again on arrival |
SANCTUM_SPARKLE_LAST_FLIGHT | 2 | set as the burst ends: freed on arrival |
Definition at line 67 of file shop_internal.h.
SANCTUM_SERVICE
enum SANCTUM_SERVICE
What the sanctum does for one party member; each kind picks the party
member's status it needs, its fee and its cure (shop_sanctum.c).
| Enumerator | Value | Description |
|---|---|---|
SANCTUM_SERVICE_REVIVE | for a downed party member (HP 0) | |
SANCTUM_SERVICE_CURE_POISON | for poison or deadly poison | |
SANCTUM_SERVICE_REPEL_EVIL | for a haunted party member | |
SANCTUM_SERVICE_REMOVE_CURSE | for any curse bit set |
Definition at line 77 of file shop_internal.h.
anonymous enum
enum { SHOP_STOCK_ITEMS, SHOP_STOCK_ITEM_COUNT, SHOP_STOCK_ARTIFACTS, SHOP_STOCK_ARTIFACT_COUNT, … }
Shop stock table layout (mnShopRun; SHOP_STOCK_ROW_EMPTY stands in for a row
out of range).
| Enumerator | Value | Description |
|---|---|---|
SHOP_STOCK_ITEMS | 0 | the first ordinary item's column |
SHOP_STOCK_ITEM_COUNT | 24 | ordinary items a row holds |
SHOP_STOCK_ARTIFACTS | 24 | the first artifact's column |
SHOP_STOCK_ARTIFACT_COUNT | 8 | artifacts a row holds |
SHOP_STOCK_TYPE | 32 | the shop's type (SHOP_TYPE) |
SHOP_STOCK_COLUMNS | 33 | |
SHOP_STOCK_ROWS | 35 | rows, indexed by the stock row a script |
SHOP_INVENTORY_COLUMNS | 5 | passes |
SHOP_STOCK_PAGE_ITEMS | 7 | stock items a page of the buy screen, 32 pixels apart |
Definition at line 87 of file shop_internal.h.