Alchemy
Loading...
Searching...
No Matches

artifacts.c File Reference

The Game Ticket counter, the gift items and every shop's stock. More...

Go to the source code of this file.

Enumerations

enum  {
  SHOP_STOCK_ITEMS = 0 , SHOP_STOCK_ITEM_COUNT = 24 , SHOP_STOCK_ARTIFACTS = 24 , SHOP_STOCK_ARTIFACT_COUNT = 8 ,
  SHOP_STOCK_TYPE = 32 , SHOP_STOCK_COLUMNS = 33 , SHOP_STOCK_ROWS = 35
}
 The shops' stock, one row per shop: up to 24 items, then up to 8 artifacts (each list ending with 0 when shorter), then the shop's type. More...

Functions

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's cost, and lets the player choose who takes it.
s32 EventTable_GetRowLimit (void)
 Returns how many stock rows there are; Shop_Run refuses a row past them.
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 flag (FLAG_SHOP_ARTIFACTS_STOCKED + row) to remember it.
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, 2 armor, as Item_GetEquipmentGroup sorts items.

Variables

static const s16 sGameTicketCreditCosts [30]
 The shop credit each Game Ticket costs, by how many have been given: five at each price: 300, then 500 doubling to 8000.
const s16 gShop_GiftItemIds [21]
 Gift items, terminated by 0; no function reads this table.
static const s16 sStockTable [SHOP_STOCK_ROWS][SHOP_STOCK_COLUMNS]

Detailed Description

The Game Ticket counter, the gift items and every shop's stock.

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

Definition in file artifacts.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

The shops' stock, one row per shop: up to 24 items, then up to 8 artifacts (each list ending with 0 when shorter), then the shop's type.

Enumerator
SHOP_STOCK_ITEMS 
SHOP_STOCK_ITEM_COUNT 
SHOP_STOCK_ARTIFACTS 
SHOP_STOCK_ARTIFACT_COUNT 
SHOP_STOCK_TYPE 
SHOP_STOCK_COLUMNS 
SHOP_STOCK_ROWS 

Definition at line 113 of file artifacts.c.

Function Documentation

◆ Shop_BuySpecialItem()

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's cost, and lets the player choose who takes it.

Spends the credit and counts the gift, not coins. Called by Shop_SelectBuy after each purchase.

Definition at line 32 of file artifacts.c.

Referenced by Shop_BuySpecialItem(), and Shop_SelectBuy().

◆ EventTable_GetRowLimit()

s32 EventTable_GetRowLimit ( void )

Returns how many stock rows there are; Shop_Run refuses a row past them.

Definition at line 304 of file artifacts.c.

Referenced by EventTable_GetRowLimit(), and Shop_Run().

◆ EventTable_ApplyRowAbilities()

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 flag (FLAG_SHOP_ARTIFACTS_STOCKED + row) to remember it.

Called by Shop_Run as a shop opens.

Definition at line 309 of file artifacts.c.

Referenced by EventTable_ApplyRowAbilities(), and Shop_Run().

◆ EventTable_CopyRowHeader()

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.

Called by Shop_Run for Buy.

Definition at line 338 of file artifacts.c.

Referenced by EventTable_CopyRowHeader(), and Shop_Run().

◆ EventTable_GetRowType()

s32 EventTable_GetRowType ( s32 stockRow)

Returns the shop's type from the last column of its stock row: 0 items, 1 weapons, 2 armor, as Item_GetEquipmentGroup sorts items.

Called by Shop_Run.

Definition at line 366 of file artifacts.c.

Referenced by EventTable_GetRowType(), and Shop_Run().

Variable Documentation

◆ sGameTicketCreditCosts

const s16 sGameTicketCreditCosts[30]
static
Initial value:
= {
300, 300, 300, 300, 300,
500, 500, 500, 500, 500,
1000, 1000, 1000, 1000, 1000,
2000, 2000, 2000, 2000, 2000,
4000, 4000, 4000, 4000, 4000,
8000, 8000, 8000, 8000, 8000,
}

The shop credit each Game Ticket costs, by how many have been given: five at each price: 300, then 500 doubling to 8000.

Definition at line 10 of file artifacts.c.

Referenced by Shop_BuySpecialItem().

◆ gShop_GiftItemIds

const s16 gShop_GiftItemIds[21]
Initial value:
= {
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
16, 195, 38, 84, 89, 90, 180, 181, 190, 0,
}

Gift items, terminated by 0; no function reads this table.

They are 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 an unused row.

Definition at line 22 of file artifacts.c.

◆ sStockTable