mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-19 04:50:05 -07:00
Track keys, heart pieces, and heart containers collected (#1849)
* Track keys, heart pieces, and heart containers collected * Update soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp
This commit is contained in:
parent
897e70b6fc
commit
3b7b4913eb
11 changed files with 144 additions and 28 deletions
|
@ -1760,6 +1760,7 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) {
|
|||
// but we check for a globalCtx here so the game won't crash if we do somehow get here.
|
||||
if (gSaveContext.n64ddFlag && globalCtx != NULL) {
|
||||
if (globalCtx->sceneNum == 10) { // ganon's tower -> ganon's castle
|
||||
gSaveContext.sohStats.dungeonKeys[13]++;
|
||||
if (gSaveContext.inventory.dungeonKeys[13] < 0) {
|
||||
gSaveContext.inventory.dungeonKeys[13] = 1;
|
||||
PerformAutosave(globalCtx, item);
|
||||
|
@ -1772,6 +1773,7 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) {
|
|||
}
|
||||
|
||||
if (globalCtx->sceneNum == 92) { // Desert Colossus -> Spirit Temple.
|
||||
gSaveContext.sohStats.dungeonKeys[6]++;
|
||||
if (gSaveContext.inventory.dungeonKeys[6] < 0) {
|
||||
gSaveContext.inventory.dungeonKeys[6] = 1;
|
||||
PerformAutosave(globalCtx, item);
|
||||
|
@ -1783,6 +1785,7 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) {
|
|||
}
|
||||
}
|
||||
}
|
||||
gSaveContext.sohStats.dungeonKeys[gSaveContext.mapIndex]++;
|
||||
if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] < 0) {
|
||||
gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] = 1;
|
||||
PerformAutosave(globalCtx, item);
|
||||
|
@ -2132,11 +2135,13 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) {
|
|||
return ITEM_NONE;
|
||||
} else if ((item == ITEM_HEART_PIECE_2) || (item == ITEM_HEART_PIECE)) {
|
||||
gSaveContext.inventory.questItems += 1 << (QUEST_HEART_PIECE + 4);
|
||||
gSaveContext.sohStats.heartPieces++;
|
||||
PerformAutosave(globalCtx, item);
|
||||
return ITEM_NONE;
|
||||
} else if (item == ITEM_HEART_CONTAINER) {
|
||||
gSaveContext.healthCapacity += 0x10;
|
||||
gSaveContext.health += 0x10;
|
||||
gSaveContext.sohStats.heartContainers++;
|
||||
PerformAutosave(globalCtx, item);
|
||||
return ITEM_NONE;
|
||||
} else if (item == ITEM_HEART) {
|
||||
|
@ -2447,6 +2452,7 @@ u16 Randomizer_Item_Give(GlobalContext* globalCtx, GetItemEntry giEntry) {
|
|||
}
|
||||
|
||||
if ((item >= RG_FOREST_TEMPLE_SMALL_KEY) && (item <= RG_GANONS_CASTLE_SMALL_KEY)) {
|
||||
gSaveContext.sohStats.dungeonKeys[mapIndex]++;
|
||||
if (gSaveContext.inventory.dungeonKeys[mapIndex] < 0) {
|
||||
gSaveContext.inventory.dungeonKeys[mapIndex] = 1;
|
||||
return RG_NONE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue