Alchemy
Loading...
Searching...
No Matches

shop.h

Go to the documentation of this file.
1#ifndef ALCHEMY_SHOP_H
2#define ALCHEMY_SHOP_H
3
4/// @file
5/// ShopRuntime, a shop's work, and the shop screen's tiles.
6
7#include "unit/shop/shop.h"
8#include "global_cells.h"
9#include "item.h"
10#include "static_assert.h"
11#include "render_input.h"
12#include "effect_slot.h"
13#include "animspr.h"
14#include "cursor.h"
15
16/// A shop's work: its windows, the party members' icons, the stock, the cursor
17/// and its icons, and the particle effects.
19 u8 unk000[0x0c]; ///< not named by TBS code
20 struct UiWindow *moneyWindow; ///< the coins window
21 u8 unk010[0x10]; ///< not named by TBS code
23 u8 unk024[0xf0]; ///< not named by TBS code
24 struct AnimationObject *partyMemberIcons[8]; ///< the party row's sprites
25 s16 partyMemberX[8]; ///< pixels
26 s16 partyMemberY[8]; ///< pixels
27 s32 partyMemberScale[8]; ///< 16.16 fixed point, 0x10000 full size
28 u8 unk174[0xf8]; ///< not named by TBS code
29 s16 stockItemIds[129]; ///< the items on sale, ended by 0
30 s16 partyMemberIds[9]; ///< the party in order (Party_ListActiveOwners)
31 struct ShopCursor cursor; ///< the hand cursor
32 /// VRAM cache slots of the six cursor icons, loaded when the work is set
33 /// up and freed with it.
34 ///@{
35 u16 cursorIcon; ///< the hand
41 ///@}
42 u16 unk39c; ///< not named by TBS code
43 u16 selectedItem; ///< the item being bought, sold or repaired
44 u8 unk3a0[4]; ///< not named by TBS code
45 u16 keeperResource; ///< the shopkeeper's animation; picks the portrait
48 u8 mode; ///< passed on as the hand cursor's kind; set to 12 at first
49 u8 shopType; ///< the stock row's type: 0 items, 2 armor, else weapons
50 s8 partyAction; ///< the counter chosen (enum ShopAction)
51 s8 burstMember; ///< the sanctum's member whose pose is randomized; -1 none
52 u8 warriorShop; ///< 1 for stock rows 16 to 18, which greet as warriors'
53 u8 unk3ad[3]; ///< not named by TBS code
54 struct EffectSlot effects[24]; ///< the sanctum service's particles
55};
56
57STATIC_ASSERT(sizeof(struct ShopRuntime) == 0xa70);
58STATIC_ASSERT(offsetof(struct ShopRuntime, moneyWindow) == 0x00c);
59STATIC_ASSERT(offsetof(struct ShopRuntime, itemWindow) == 0x020);
60STATIC_ASSERT(offsetof(struct ShopRuntime, partyMemberIcons) == 0x114);
61STATIC_ASSERT(offsetof(struct ShopRuntime, partyMemberScale) == 0x154);
62STATIC_ASSERT(offsetof(struct ShopRuntime, stockItemIds) == 0x26c);
63STATIC_ASSERT(offsetof(struct ShopRuntime, partyMemberIds) == 0x36e);
64STATIC_ASSERT(offsetof(struct ShopRuntime, cursor) == 0x380);
65STATIC_ASSERT(offsetof(struct ShopRuntime, stockCount) == 0x3a6);
66STATIC_ASSERT(offsetof(struct ShopRuntime, partyMemberCount) == 0x3a7);
67STATIC_ASSERT(offsetof(struct ShopRuntime, partyAction) == 0x3aa);
68STATIC_ASSERT(offsetof(struct ShopRuntime, partyMemberX) == 0x134);
69STATIC_ASSERT(offsetof(struct ShopRuntime, partyMemberY) == 0x144);
70STATIC_ASSERT(offsetof(struct ShopRuntime, burstMember) == 0x3ab);
71STATIC_ASSERT(offsetof(struct ShopRuntime, warriorShop) == 0x3ac);
72STATIC_ASSERT(offsetof(struct ShopRuntime, effects) == 0x3b0);
73
74extern const u8 gShop_HandTiles[];
75extern const u8 gShop_GemTiles[];
76extern const u8 gShop_SmallDownArrowTiles[];
77extern const u8 gShop_SmallUpArrowTiles[];
78extern const u8 gShop_UpArrowTiles[];
79extern const u8 gShop_DownArrowTiles[];
80
81extern const u8 gShop_PriceTiles[];
82extern const u8 gShop_QuantityTiles[];
83
84#endif
Animated sprites: their layers, frames and colour modes, and the resource slots they draw from.
The cursor that approaches its target, shared by shops, name entry and settings.
Effect slots: the particles Psynergy effects move and draw.
The work slots of gWorkSlot, read through their own names.
Items: their definitions, types, flags and effects.
The sprite renderer's inputs and outputs: render inputs, OAM attributes and render output lists.
const u8 gShop_PriceTiles[]
const u8 gShop_QuantityTiles[]
const u8 gShop_UpArrowTiles[]
const u8 gShop_GemTiles[]
const u8 gShop_SmallUpArrowTiles[]
const u8 gShop_SmallDownArrowTiles[]
const u8 gShop_DownArrowTiles[]
const u8 gShop_HandTiles[]
STATIC_ASSERT, a compile-time check that emits nothing.
#define STATIC_ASSERT(condition)
C89 permits repeated extern declarations of the same array.
#define offsetof(type, member)
Definition stddef.h:19
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
Definition animspr.h:108
A particle a Psynergy effect moves and draws: its sprite, its position and target,...
Definition effect_slot.h:18
Cursor that approaches its target, shared by shop, name entry and settings.
Definition cursor.h:13
A shop's work: its windows, the party members' icons, the stock, the cursor and its icons,...
Definition shop.h:18
s32 partyMemberScale[8]
16.16 fixed point, 0x10000 full size
Definition shop.h:27
s8 burstMember
the sanctum's member whose pose is randomized; -1 none
Definition shop.h:51
struct EffectSlot effects[24]
the sanctum service's particles
Definition shop.h:54
u16 previousPageIcon
Definition shop.h:36
s8 partyMemberCount
Definition shop.h:47
struct UiWindow * itemWindow
Definition shop.h:22
struct ShopCursor cursor
the hand cursor
Definition shop.h:31
s16 partyMemberIds[9]
the party in order (Party_ListActiveOwners)
Definition shop.h:30
struct AnimationObject * partyMemberIcons[8]
the party row's sprites
Definition shop.h:24
u8 warriorShop
1 for stock rows 16 to 18, which greet as warriors'
Definition shop.h:52
u16 statDownIcon
Definition shop.h:40
u8 unk174[0xf8]
not named by TBS code
Definition shop.h:28
s16 partyMemberY[8]
pixels
Definition shop.h:26
struct UiWindow * moneyWindow
the coins window
Definition shop.h:20
u16 keeperResource
the shopkeeper's animation; picks the portrait
Definition shop.h:45
u16 selectedItem
the item being bought, sold or repaired
Definition shop.h:43
u8 unk000[0x0c]
not named by TBS code
Definition shop.h:19
u16 nextPageIcon
Definition shop.h:37
u16 cursorIcon
VRAM cache slots of the six cursor icons, loaded when the work is set up and freed with it.
Definition shop.h:35
u8 unk3a0[4]
not named by TBS code
Definition shop.h:44
s8 stockCount
Definition shop.h:46
s16 stockItemIds[129]
the items on sale, ended by 0
Definition shop.h:29
u8 unk010[0x10]
not named by TBS code
Definition shop.h:21
u8 shopType
the stock row's type: 0 items, 2 armor, else weapons
Definition shop.h:49
s16 partyMemberX[8]
pixels
Definition shop.h:25
u16 unk39c
not named by TBS code
Definition shop.h:42
s8 partyAction
the counter chosen (enum ShopAction)
Definition shop.h:50
u8 unk3ad[3]
not named by TBS code
Definition shop.h:53
u8 mode
passed on as the hand cursor's kind; set to 12 at first
Definition shop.h:48
u16 gemIcon
Definition shop.h:38
u16 statUpIcon
Definition shop.h:39
u8 unk024[0xf0]
not named by TBS code
Definition shop.h:23
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...
Definition uiwindow.h:11
signed int s32
Definition types.h:14
signed char s8
Definition types.h:10
signed short s16
Definition types.h:12
unsigned short u16
Definition types.h:13
unsigned char u8
Definition types.h:11