forked from SeekyCt/mkw-structures
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitemslotdata.h
36 lines (33 loc) · 2.01 KB
/
itemslotdata.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
ItemSlotData is the class that handles data from ItemSlot.bin / ItemSlotTable.slt
A pointer to an instance of this class is stored at 0x809c3670 PAL
See also http://wiki.tockdom.com/wiki/Filesystem/Race/Common.szs/ItemSlot.bin
*/
typedef struct {
uint32_t columns;
short * data;
} ItemSlotTableHolder; // Total size 0x8
class ItemSlotData {
public:
virtual ~ItemSlotData(); // 807ba650 PAL
int decideItem(int itemboxSetting, int position, int r6, int r7, void * r8); // 807bb42c PAL
uint8_t * processTableAndIter(uint8_t * itemTable, ItemSlotTableHolder * tableHolder, bool updateItemsInWheek, bool isSpecialTable); // 807ba9d8 PAL, takes a pointer to a raw table in an item slot file, processes the values and writes them to the data field of the table holder, then returns the pointer to the start of the next table
void scaleTableForPlayerCount(ItemSlotTableHolder * tableHolder)// 807bad20 PAL
void resetLightningTimer(); // 807bb9bc PAL
void resetBlueShellTimer(); // 807bb9c8 PAL, goes unused
void resetBlooperTimer(); // 807bb9d4 PAL
void resetPowTimer(); // 807bb9e0 PAL
void updateTimers(); // 807bb9ec PAL, also responsible for setting them to their initial values on the first frame
bool checkSpawnTimer(int objectId, int r5); // 807bb380 (from Star)
// Always constructed inline
// vtable 808d27b4 PAL
// unknown 0x4-f
ItemSlotTableHolder playerChances;
ItemSlotTableHolder cpuChances;
ItemSlotTableHolder specialChances;
int * itemsInWheel; // first int is number of items, followed by the item ids (visual only, doesn't stop you pulling other items)
int * specialBoxItemsInWheel; // a series of lists in same structure as itemsInWheel, one for each column of the special table
// unknown 0x30-33
unsigned int itemSpawnTimers[4]; // timers in frames for when an item can next be pulled. 0 = lightning, 1 = blue shell, 2 = blooper, 3 = pow
unsigned int playerCount; // copied from the global variable by constructor, used to check when the player count changes online
}; // Total size 0x48