DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
Loading...
Searching...
No Matches
shop.hpp
1#pragma once
2
3#include "common.h"
4
5#include "itemdata.hpp"
6#include "stockitem.hpp"
7
11// clang-format off
12enum ShopTalkMode {
13 SHOP_TALK_NONE = 0,
14 SHOP_TALK_FADE_IN = 1,
15 SHOP_TALK_FADE_OUT = 2,
16 SHOP_TALK_GREETING = 3,
17 SHOP_TALK_CANNOT_SELL = 4,
18 SHOP_TALK_WEAPON_EQUIPPED = 5,
19 SHOP_TALK_DEAL_PENDING = 6,
20 SHOP_TALK_CANNOT_CHARGE = 7,
21 SHOP_TALK_STOCK_FULL = 8,
22 SHOP_TALK_UNK_9 = 9,
23 SHOP_TALK_INVENTORY_OVERFLOW = 10,
24 SHOP_TALK_NO_SPACE = 11,
25 SHOP_TALK_CONFIRM_DEAL = 12,
26 SHOP_TALK_BUY_PROMPT = 13,
27 SHOP_TALK_SELL_PROMPT = 14,
28 SHOP_TALK_UNK_10 = 16,
29 SHOP_TALK_CHARGE_PUT_PROMPT = 17,
30 SHOP_TALK_CHARGE_TAKE_PROMPT = 18,
31 SHOP_TALK_DEAL_DONE = 20,
32 SHOP_TALK_NOT_ENOUGH_MONEY = 21,
33 SHOP_TALK_TOO_MUCH_MONEY = 22,
34 SHOP_TALK_NOTHING_MARKED = 23,
35 SHOP_TALK_LEAVE_PROMPT = 24,
36 SHOP_TALK_GOODBYE = 25,
37 SHOP_TALK_BUTTON_FLASH = 26,
38};
39
40// clang-format on
41
45// clang-format off
46enum ShopMsgMode {
47 SHOP_MSG_IDLE = 0,
48 SHOP_MSG_TALKING = 1,
49};
50
51// clang-format on
52
56// clang-format off
57enum ShopSide {
58 SHOP_SIDE_STOCK = 0,
59 SHOP_SIDE_PERSONAL = 1,
60 SHOP_SIDE_CHECK_BUTTON = 2,
61};
62
63// clang-format on
64
68// clang-format off
69enum ShopSlotState {
70 SHOP_SLOT_EMPTY = 0,
71 SHOP_SLOT_SHOP_GOOD = 1,
72 SHOP_SLOT_PLAYER_ITEM = 2,
73};
74
75// clang-format on
76
80// clang-format off
81enum ShopKind {
82 SHOP_KIND_CHARGE = 0,
83 SHOP_KIND_ITEM = 1,
84};
85
86// clang-format on
87
91// clang-format off
92enum FishExchangeMode {
93 FISH_EXCHANGE_FADE_IN = 0,
94 FISH_EXCHANGE_FADE_OUT = 1,
95 FISH_EXCHANGE_SELECT = 3,
96 FISH_EXCHANGE_CONFIRM = 4,
97 FISH_EXCHANGE_REFUSE = 5,
98};
99
100// clang-format on
101
105// clang-format off
106enum FishRecordMode {
107 FISH_RECORD_FADE_IN = 0,
108 FISH_RECORD_FADE_OUT = 1,
109 FISH_RECORD_VIEW = 2,
110};
111
112// clang-format on
113
114// Forward declarations for the types these declarations name. The skeleton
115// headers are generated from the retail symbol table, which knows the type
116// names but not where they live.
117struct ITEM_PACK;
118struct SV_FISH_DATA;
119
129
130STATIC_ASSERT(sizeof(MENU_ITEMDATA) == 0xF8);
131
137 u8 unk_02[2];
139};
140
141STATIC_ASSERT(sizeof(SHOP_ITEMLIST) == 0xFC);
142
154
155STATIC_ASSERT(sizeof(IHAVEITEM) == 0x14);
156
160extern IHAVEITEM *ShopHaveItemPt;
161
165extern WEAPON_HAVE *ShopHaveWepPt;
166
170extern ATTACH_LIST *ShopHaveAttachPt;
171
179s16 *GetItemShopList(int shop_no);
180
188void InitShopItemListData(SHOP_ITEMLIST *item_list);
189
194public:
196 s16 spare;
199 float pos_x;
200 float pos_y;
202 u8 unk_12[2];
212 void IconMoveTarSet(int slot_no, int icon_no, int item_no, MENU_ITEMDATA *item_data, float start_x, float start_y, int to_stock);
213
221 int IconAutoMove(int item_shop, int force_arrive);
222
230 void IconAutoMoveDraw();
231};
232
233STATIC_ASSERT(sizeof(ShopIconMove) == 0x10C);
234
242int ShopNoInput(int *tex_block, int shop_no, int mode);
243
251void InitAllHaveData();
252
260int CommonShopLoop();
261
269void ShopTextureLoadFix();
270
278void InitChargeShop(int *tex_block, int shop_no, int mode);
279
287void ChargeShopLimmitCheck();
288
296int ChargeShopLoop();
297
305int ChargeShopKey();
306
314void DrawChargeShop();
315
323void ChargeShopBoardDraw(int x, int y, int alpha);
324
332static int BuyMoneyCheck2();
333
341int CompItem1(int first_item_no, int second_item_no);
342
350int SeitonShopItemBoardSub(ITEM_PACK *pack);
351
359int CompAttach1(ATTACH_LIST *first, ATTACH_LIST *second);
360
368int SeitonShopAttachBoardSub(ATTACH_LIST *attachments);
369
377int ItemShopLoop2();
378
386int CheckSideKey2();
387
395void DrawSellTicket22(int x, int y, int clip_top, int clip_bottom, int alpha);
396
405void ItemShopGetPacFileName(int shop_kind, int shop_no, char *file_name);
406
414void ItemShopGetImgFileName(int shop_kind, int shop_no, char *file_name);
415
424void ItemShopMemoryAlloc();
425
434void ItemPosInfoInit();
435
443void InitItemShop2(int *tex_block, int shop_no, int mode);
444
452int ItemShopKey2();
453
461void ItemShopDraw2();
462
470int GetMardanGareyanFlag();
471
479void SetAlreadyGetMardanWeapon(int taken);
480
488void SetFishMardanGarayanNum(int count);
489
497int GetFishMardanGarayanNum();
498
506void ClearFishMardanGarayanNum();
507
515void InitFishingExchange(u_long128 *buffer, int *tex_block, int mode);
516
524int FishingExchangeKey();
525
533void FishingExchangeDraw();
534
542void ExitFishingExchange();
543
551int FishingExchangeLoop();
552
560int GetFishMsgNo(int fish_no);
561
569SV_FISH_DATA *GetFishingRankData(int rank_index);
570
578void InitFishRecordView(u_long128 *buffer, int *tex_block, int mode);
579
587void FishRecordTextureEnter();
588
596int FishRecordViewLoop();
597
599extern s8 FishMsg[18];
600
606 s16 price;
607};
608
609STATIC_ASSERT(sizeof(FISH_EXCHANGE_ITEM) == 4);
610
612extern FISH_EXCHANGE_ITEM exitemlst[35];
613
617extern char FishFrameImage[];
618
622extern char FishMessageFile[];
void IconAutoMoveDraw()
Definition shop.cpp:620
s16 item_no
Definition shop.hpp:201
float pos_x
Definition shop.hpp:199
void IconMoveTarSet(int slot_no, int icon_no, int item_no, MENU_ITEMDATA *item_data, float start_x, float start_y, int to_stock)
Definition shop.cpp:512
int IconAutoMove(int item_shop, int force_arrive)
Definition shop.cpp:522
MENU_ITEMDATA data
Definition shop.hpp:203
s16 to_stock
Definition shop.hpp:195
float pos_y
Definition shop.hpp:200
s16 icon_no
Definition shop.hpp:198
s16 slot_no
Definition shop.hpp:197
s16 volume
Definition shop.hpp:152
s32 from_page
Definition shop.hpp:148
s32 slot_state
Definition shop.hpp:147
s32 last_slot
Definition shop.hpp:149
s16 item_no
Definition shop.hpp:151
s32 from_slot
Definition shop.hpp:150
MENU_ITEMDATA data
Definition shop.hpp:138
s16 param[0x7C]
Definition shop.hpp:127
ATTACH_LIST attach
Definition shop.hpp:126
WEAPON_HAVE weapon
Definition shop.hpp:125