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