This commit is contained in:
engineer124
2022-06-28 09:48:27 +10:00
parent f8e57470b2
commit d1947c0f1b
5 changed files with 19 additions and 14 deletions
+3 -2
View File
@@ -78,8 +78,9 @@ typedef struct Inventory {
/* 0x30 */ s8 ammo[24]; // "item_count"
/* 0x48 */ u32 upgrades; // "non_equip_register" some bits are wallet upgrades
/* 0x4C */ u32 questItems; // "collect_register"
/* 0x50 */ u8 dungeonItems[10]; // "key_compass_map"
/* 0x5A */ s8 dungeonKeys[10]; // "key_register"
/* 0x50 */ u8 dungeonItems[10]; // "key_compass_map"
/* 0x5A */ s8 dungeonKeys[9]; // "key_register"
/* 0x59 */ s8 defenseHearts;
/* 0x64 */ s8 strayFairies[10]; // "orange_fairy"
/* 0x6E */ char dekuPlaygroundPlayerName[3][8]; // "degnuts_memory_name" Stores playerName (8 char) over (3 days) when getting a new high score
} Inventory; // size = 0x88
+1 -1
View File
@@ -223,7 +223,7 @@ void LifeMeter_Draw(PlayState* play) {
f32 lifesize = interfaceCtx->lifeSizeChange * 0.1f;
u32 curCombineModeSet = 0;
TexturePtr temp = NULL;
s32 ddCount = gSaveContext.save.inventory.dungeonKeys[9] - 1;
s32 ddCount = gSaveContext.save.inventory.defenseHearts - 1;
OPEN_DISPS(gfxCtx);
+12 -8
View File
@@ -434,7 +434,7 @@ void Sram_SaveEndOfCycle(PlayState* play) {
for (i = 0; i < 8; i++) {
gSaveContext.save.inventory.dungeonItems[i] &= (u8)~1;
gSaveContext.save.inventory.dungeonKeys[i] = 0;
DUNGEON_KEY_COUNT(i) = 0;
gSaveContext.save.inventory.strayFairies[i] = 0;
}
@@ -624,7 +624,9 @@ Inventory sSaveDefaultInventory = {
// dungeonItems
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
// dungeonKeys
{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0 },
{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },
// defenseHearts
0,
// strayFairies
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
// dekuPlaygroundPlayerName
@@ -768,7 +770,9 @@ Inventory sSaveDebugInventory = {
// dungeonItems
{ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 },
// dungeonKeys
{ 8, 8, 8, 8, 8, 8, 8, 8, 8, 0 },
{ 8, 8, 8, 8, 8, 8, 8, 8, 8 },
// defenseHearts
0,
// strayFairies
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
// dekuPlaygroundPlayerName
@@ -1142,7 +1146,7 @@ void func_801457CC(FileChooseContext* fileChooseCtx2, SramContext* sramCtx) {
fileChooseCtx->healthCapacity[sp76] = gSaveContext.save.playerData.healthCapacity;
fileChooseCtx->health[sp76] = gSaveContext.save.playerData.health;
fileChooseCtx->unk_24454[sp76] = gSaveContext.save.inventory.dungeonKeys[9];
fileChooseCtx->unk_24454[sp76] = gSaveContext.save.inventory.defenseHearts;
fileChooseCtx->unk_24444[sp76] = gSaveContext.save.inventory.questItems;
fileChooseCtx->unk_24458[sp76] = gSaveContext.save.time;
fileChooseCtx->unk_24460[sp76] = gSaveContext.save.day;
@@ -1237,7 +1241,7 @@ void func_801457CC(FileChooseContext* fileChooseCtx2, SramContext* sramCtx) {
fileChooseCtx->healthCapacity[sp76] = gSaveContext.save.playerData.healthCapacity;
fileChooseCtx->health[sp76] = gSaveContext.save.playerData.health;
fileChooseCtx->unk_24454[sp76] = gSaveContext.save.inventory.dungeonKeys[9];
fileChooseCtx->unk_24454[sp76] = gSaveContext.save.inventory.defenseHearts;
fileChooseCtx->unk_24444[sp76] = gSaveContext.save.inventory.questItems;
fileChooseCtx->unk_24458[sp76] = gSaveContext.save.time;
fileChooseCtx->unk_24460[sp76] = gSaveContext.save.day;
@@ -1350,7 +1354,7 @@ void func_80146628(FileChooseContext* fileChooseCtx2, SramContext* sramCtx) {
fileChooseCtx->unk_24438[fileChooseCtx->fileNum] = gSaveContext.save.playerData.healthCapacity;
fileChooseCtx->unk_24440[fileChooseCtx->fileNum] = gSaveContext.save.playerData.health;
fileChooseCtx->unk_24456[fileChooseCtx->fileNum] = gSaveContext.save.inventory.dungeonKeys[9];
fileChooseCtx->unk_24456[fileChooseCtx->fileNum] = gSaveContext.save.inventory.defenseHearts;
fileChooseCtx->unk_2444C[fileChooseCtx->fileNum] = gSaveContext.save.inventory.questItems;
fileChooseCtx->unk_2445C[fileChooseCtx->fileNum] = gSaveContext.save.time;
fileChooseCtx->unk_24464[fileChooseCtx->fileNum] = gSaveContext.save.day;
@@ -1393,7 +1397,7 @@ void func_80146628(FileChooseContext* fileChooseCtx2, SramContext* sramCtx) {
fileChooseCtx->healthCapacity[fileChooseCtx->fileNum] = gSaveContext.save.playerData.healthCapacity;
fileChooseCtx->health[fileChooseCtx->fileNum] = gSaveContext.save.playerData.health;
fileChooseCtx->unk_24454[fileChooseCtx->fileNum] = gSaveContext.save.inventory.dungeonKeys[9];
fileChooseCtx->unk_24454[fileChooseCtx->fileNum] = gSaveContext.save.inventory.defenseHearts;
fileChooseCtx->unk_24444[fileChooseCtx->fileNum] = gSaveContext.save.inventory.questItems;
fileChooseCtx->unk_24458[fileChooseCtx->fileNum] = gSaveContext.save.time;
fileChooseCtx->unk_24460[fileChooseCtx->fileNum] = gSaveContext.save.day;
@@ -1462,7 +1466,7 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx2, SramContext* sramCtx) {
fileChooseCtx->healthCapacity[fileChooseCtx->unk_24480] = gSaveContext.save.playerData.healthCapacity;
fileChooseCtx->health[fileChooseCtx->unk_24480] = gSaveContext.save.playerData.health;
fileChooseCtx->unk_24454[fileChooseCtx->unk_24480] = gSaveContext.save.inventory.dungeonKeys[9];
fileChooseCtx->unk_24454[fileChooseCtx->unk_24480] = gSaveContext.save.inventory.defenseHearts;
fileChooseCtx->unk_24444[fileChooseCtx->unk_24480] = gSaveContext.save.inventory.questItems;
fileChooseCtx->unk_24458[fileChooseCtx->unk_24480] = gSaveContext.save.time;
fileChooseCtx->unk_24460[fileChooseCtx->unk_24480] = gSaveContext.save.day;
@@ -343,7 +343,7 @@ void func_808A1090(DoorShutter* this, PlayState* play) {
if (this->unk_166 != 0) {
Flags_SetSwitch(play, DOORSHUTTER_GET_7F(&this->actor));
if (this->doorType != 5) {
gSaveContext.save.inventory.dungeonKeys[gSaveContext.mapIndex]--;
DUNGEON_KEY_COUNT(gSaveContext.mapIndex) = DUNGEON_KEY_COUNT(gSaveContext.mapIndex) - 1;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIN_KEY_UNLOCK);
} else {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIN_KEY_UNLOCK_B);
+2 -2
View File
@@ -482,7 +482,7 @@ void func_80866B20(EnDoor* this, PlayState* play) {
Animation_PlayOnceSetSpeed(&this->skelAnime, sAnimations[this->animIndex],
(player->stateFlags1 & 0x8000000) ? 0.75f : 1.5f);
if (this->unk_1A6 != 0) {
gSaveContext.save.inventory.dungeonKeys[gSaveContext.mapIndex]--;
DUNGEON_KEY_COUNT(gSaveContext.mapIndex) = DUNGEON_KEY_COUNT(gSaveContext.mapIndex) - 1;
Flags_SetSwitch(play, this->switchFlag);
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK);
}
@@ -502,7 +502,7 @@ void func_80866B20(EnDoor* this, PlayState* play) {
player->doorDirection = playerPosRelToDoor.z >= 0.0f ? 1.0f : -1.0f;
player->doorActor = &this->dyna.actor;
if (this->unk_1A6 != 0) {
if (gSaveContext.save.inventory.dungeonKeys[((void)0, gSaveContext.mapIndex)] <= 0) {
if (DUNGEON_KEY_COUNT(gSaveContext.mapIndex) <= 0) {
player->doorType = -1;
this->dyna.actor.textId = 0x1802;
} else {