0
|
1 #pragma once
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6 /* 348 */
|
|
7 enum CHEST_FLAGS
|
|
8 {
|
|
9 CHEST_TRAPPED = 0x1,
|
|
10 CHEST_ITEMS_PLACED = 0x2,
|
|
11 CHEST_OPENED = 0x4,
|
|
12 };
|
|
13
|
|
14
|
|
15
|
|
16 #pragma pack(push, 1)
|
|
17 struct ChestDesc
|
|
18 {
|
|
19 char pName[32];
|
|
20 char uWidth;
|
|
21 char uHeight;
|
|
22 __int16 uTextureID;
|
|
23 };
|
|
24 #pragma pack(pop)
|
|
25
|
|
26
|
|
27
|
|
28 #pragma pack(push, 1)
|
|
29 struct ChestList
|
|
30 {
|
|
31 inline ChestList(): //----- (00458438)
|
|
32 uNumChests(0), pChests(nullptr)
|
|
33 {}
|
|
34
|
|
35 void ToFile();
|
|
36 void FromFile(void *pSerialized);
|
|
37 int FromFileTxt(const char *Args);
|
|
38
|
|
39
|
|
40 unsigned int uNumChests;
|
|
41 struct ChestDesc *pChests;
|
|
42 };
|
|
43 #pragma pack(pop)
|
|
44
|
|
45
|
|
46
|
|
47 /* 65 */
|
|
48 #pragma pack(push, 1)
|
526
|
49 struct Chest //0x14cc
|
0
|
50 {
|
426
|
51 inline bool Initialized() const {return uFlags & CHEST_ITEMS_PLACED;}
|
|
52 inline void SetInitialized(bool b) {if (b) uFlags |= CHEST_ITEMS_PLACED; else uFlags &= ~CHEST_ITEMS_PLACED;}
|
|
53 inline bool Trapped() const {return uFlags & CHEST_TRAPPED;}
|
|
54
|
706
|
55 static bool CanPlaceItemAt(signed int a1, int a2, signed int uChestID);
|
|
56 static int CountChestItems(signed int uChestID);
|
|
57 static int PutItemInChest(int a1, ItemGen *a2, signed int uChestID);
|
|
58 static void PlaceItemAt(unsigned int put_cell_pos, unsigned int uItemIdx, signed int uChestID);
|
|
59 static void PlaceItems(signed int uChestID);
|
526
|
60 static bool Open(signed int uChestID);
|
706
|
61 static void DrawChestUI(signed int uChestID);
|
|
62 static void ToggleFlag(signed int uChestID, unsigned __int16 uFlag, unsigned int bToggle);
|
0
|
63
|
526
|
64 unsigned __int16 uChestBitmapID; //0
|
|
65 unsigned __int16 uFlags; //2
|
|
66 struct ItemGen igChestItems[140]; //4
|
528
|
67 signed __int16 pInventoryIndices[140]; //0x13b4
|
0
|
68 };
|
|
69 #pragma pack(pop)
|
|
70
|
526
|
71 void __fastcall sub_420B13(int a1, int a2);
|
0
|
72
|
|
73
|
|
74 extern size_t uNumChests; // idb
|
|
75 extern struct ChestList *pChestList;
|
|
76 extern Chest pChests[20]; |