From ec0a080956fd0277f776273b9bfe284f58014498 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Tue, 12 Jul 2022 22:08:25 -0700 Subject: [PATCH 001/174] Rando: Minor feature - quest item fanfares In rando, when we find a special quest item somewhere (e.g. a medallion, stone, or song), play that item's unique fanfare instead of the default "get item" fanfare Closes HarbourMasters/Shipwright#716 --- .../actors/ovl_player_actor/z_player.c | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 1973a09a44..4e1b054df3 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -12675,6 +12675,33 @@ s32 func_8084DFF4(GlobalContext* globalCtx, Player* this) { else { temp1 = temp2 = (this->getItemId == GI_HEART_PIECE) ? NA_BGM_SMALL_ITEM_GET : NA_BGM_ITEM_GET | 0x900; } + + // In Rando, if we get special quest items (medallions/stones/songs), play their respective unique fanfares + // instead of the default "get item" fanfare + if (gSaveContext.n64ddFlag) { + // If the item we're getting is a medallion, play the "get a medallion" fanfare + if ((this->getItemId == GI_MEDALLION_FOREST) || (this->getItemId == GI_MEDALLION_FIRE) || + (this->getItemId == GI_MEDALLION_WATER) || (this->getItemId == GI_MEDALLION_SHADOW) || + (this->getItemId == GI_MEDALLION_SPIRIT) || (this->getItemId == GI_MEDALLION_LIGHT)) { + temp1 = NA_BGM_MEDALLION_GET | 0x900; + } + // If it's a Spiritual Stone, play the "get a spiritual stone" fanfare + if ((this->getItemId == GI_STONE_KOKIRI) || (this->getItemId == GI_STONE_GORON) || + (this->getItemId == GI_STONE_ZORA)) { + temp1 = NA_BGM_SPIRITUAL_STONE | 0x900; + } + // If the item we're getting is a song, play the "learned a song" fanfare + if ((this->getItemId == GI_SONG_OF_STORMS) || (this->getItemId == GI_SERENADE_OF_WATER) || + (this->getItemId == GI_EPONAS_SONG) || (this->getItemId == GI_SARIAS_SONG) || + (this->getItemId == GI_SUNS_SONG) || (this->getItemId == GI_SONG_OF_TIME) || + (this->getItemId == GI_PRELUDE_OF_LIGHT) || (this->getItemId == GI_MINUET_OF_FOREST) || + (this->getItemId == GI_BOLERO_OF_FIRE) || (this->getItemId == GI_NOCTURNE_OF_SHADOW) || + (this->getItemId == GI_REQUIEM_OF_SPIRIT) || (this->getItemId == GI_PRELUDE_OF_LIGHT)) { + temp1 = NA_BGM_OCA_FAIRY_GET | 0x900; + } + } + // *************************************************************************************** + Audio_PlayFanfare(temp1); } } From d424ee6fa88658852d76f08a1915a2f7ae9fec27 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Tue, 12 Jul 2022 22:21:30 -0700 Subject: [PATCH 002/174] Fix Zelda's Lullaby Accidentally had prelude in there twice --- soh/src/overlays/actors/ovl_player_actor/z_player.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 4e1b054df3..b78a8cce33 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -12696,7 +12696,7 @@ s32 func_8084DFF4(GlobalContext* globalCtx, Player* this) { (this->getItemId == GI_SUNS_SONG) || (this->getItemId == GI_SONG_OF_TIME) || (this->getItemId == GI_PRELUDE_OF_LIGHT) || (this->getItemId == GI_MINUET_OF_FOREST) || (this->getItemId == GI_BOLERO_OF_FIRE) || (this->getItemId == GI_NOCTURNE_OF_SHADOW) || - (this->getItemId == GI_REQUIEM_OF_SPIRIT) || (this->getItemId == GI_PRELUDE_OF_LIGHT)) { + (this->getItemId == GI_REQUIEM_OF_SPIRIT) || (this->getItemId == GI_ZELDAS_LULLABY)) { temp1 = NA_BGM_OCA_FAIRY_GET | 0x900; } } From dd761295fc7a6ba022684e417c96e5bcc352a8ba Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Wed, 13 Jul 2022 13:34:01 -0700 Subject: [PATCH 003/174] Add logic to also check for a toggle setting Added && for the gRandoFanfareByItemType to allow this to be a toggle setting --- soh/src/overlays/actors/ovl_player_actor/z_player.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index b78a8cce33..073a25f0b5 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -12677,8 +12677,8 @@ s32 func_8084DFF4(GlobalContext* globalCtx, Player* this) { } // In Rando, if we get special quest items (medallions/stones/songs), play their respective unique fanfares - // instead of the default "get item" fanfare - if (gSaveContext.n64ddFlag) { + // instead of the default "get item" fanfare (if we have the setting toggled on) + if (gSaveContext.n64ddFlag && CVar_GetS32("gRandoFanfareByItemType", 0)) { // If the item we're getting is a medallion, play the "get a medallion" fanfare if ((this->getItemId == GI_MEDALLION_FOREST) || (this->getItemId == GI_MEDALLION_FIRE) || (this->getItemId == GI_MEDALLION_WATER) || (this->getItemId == GI_MEDALLION_SHADOW) || From fa1327553d4a37b6253def5874b71d0b802c1a6b Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Wed, 13 Jul 2022 15:12:44 -0700 Subject: [PATCH 004/174] Fix syntax I think the !=0 is needed --- soh/src/overlays/actors/ovl_player_actor/z_player.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 073a25f0b5..f1d0fa6b48 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -12678,7 +12678,7 @@ s32 func_8084DFF4(GlobalContext* globalCtx, Player* this) { // In Rando, if we get special quest items (medallions/stones/songs), play their respective unique fanfares // instead of the default "get item" fanfare (if we have the setting toggled on) - if (gSaveContext.n64ddFlag && CVar_GetS32("gRandoFanfareByItemType", 0)) { + if (gSaveContext.n64ddFlag && CVar_GetS32("gRandoFanfareByItemType", 0) != 0) { // If the item we're getting is a medallion, play the "get a medallion" fanfare if ((this->getItemId == GI_MEDALLION_FOREST) || (this->getItemId == GI_MEDALLION_FIRE) || (this->getItemId == GI_MEDALLION_WATER) || (this->getItemId == GI_MEDALLION_SHADOW) || From fe8641cab468473aeab0f14ac146d9b05007f689 Mon Sep 17 00:00:00 2001 From: aMannus Date: Thu, 14 Jul 2022 10:45:42 +0200 Subject: [PATCH 005/174] not yet --- soh/randomizerTypes.h | 1 + .../Enhancements/randomizer/3drando/settings.cpp | 1 + soh/soh/Enhancements/randomizer/randomizer.cpp | 15 +++++++++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/soh/randomizerTypes.h b/soh/randomizerTypes.h index 5519668284..a35fe45721 100644 --- a/soh/randomizerTypes.h +++ b/soh/randomizerTypes.h @@ -973,6 +973,7 @@ typedef enum { RSK_STARTING_MAPS_COMPASSES, //RANDOTODO more options for this, rn it's just start with or own dungeon RSK_SHUFFLE_DUNGEON_REWARDS, RSK_SHUFFLE_SONGS, + RSK_SHUFFLE_TOKENS, RSK_SHUFFLE_WEIRD_EGG, RSK_SHUFFLE_GERUDO_MEMBERSHIP_CARD, RSK_ITEM_POOL, diff --git a/soh/soh/Enhancements/randomizer/3drando/settings.cpp b/soh/soh/Enhancements/randomizer/3drando/settings.cpp index 05fc10c4bb..6807c90522 100644 --- a/soh/soh/Enhancements/randomizer/3drando/settings.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/settings.cpp @@ -2488,6 +2488,7 @@ namespace Settings { ShuffleRewards.SetSelectedIndex(cvarSettings[RSK_SHUFFLE_DUNGEON_REWARDS]); ShuffleSongs.SetSelectedIndex(cvarSettings[RSK_SHUFFLE_SONGS]); + Tokensanity.SetSelectedIndex(cvarSettings[RSK_SHUFFLE_TOKENS]); ShuffleKokiriSword.SetSelectedIndex(cvarSettings[RSK_SHUFFLE_KOKIRI_SWORD]); ShuffleOcarinas.SetSelectedIndex(cvarSettings[RSK_SHUFFLE_OCARINA]); diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 09704e8671..354c6f7fc9 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -3016,6 +3016,10 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act return RC_GRAVEYARD_DAMPE_GRAVEDIGGING_TOUR; case 14346: return RC_GY_GOSSIP_STONE; + case 20608: + return RC_GRAVEYARD_GS_WALL; + //case 0: + //return RC_GRAVEYARD_GS_BEAN_PATCH; } break; case 84: @@ -3217,8 +3221,8 @@ void GenerateRandomizerImgui() { cvarSettings[RSK_STARTING_DEKU_SHIELD] = CVar_GetS32("gRandomizeStartingDekuShield", 0); cvarSettings[RSK_STARTING_MAPS_COMPASSES] = CVar_GetS32("gRandomizeStartingMapsCompasses", 0); cvarSettings[RSK_SHUFFLE_DUNGEON_REWARDS] = CVar_GetS32("gRandomizeShuffleDungeonReward", 0); - cvarSettings[RSK_SHUFFLE_SONGS] = CVar_GetS32("gRandomizeShuffleSongs", 0); - + cvarSettings[RSK_SHUFFLE_SONGS] = CVar_GetS32("gRandomizeShuffleTokens", 0); + cvarSettings[RSK_SHUFFLE_TOKENS] = CVar_GetS32("gRandomizeShuffleTokens", 0); cvarSettings[RSK_SKIP_CHILD_ZELDA] = CVar_GetS32("gRandomizeSkipChildZelda", 0); // if we skip child zelda, we start with zelda's letter, and malon starts @@ -3301,6 +3305,7 @@ void DrawRandoEditor(bool& open) { const char* randoShuffleDungeonRewards[4] = { "End of Dungeons", "Any Dungeon", "Overworld", "Anywhere" }; const char* randoLinksPocket[4] = { "Dungeon Reward", "Advancement", "Anything", "Nothing" }; const char* randoShuffleSongs[3] = { "Song Locations", "Dungeon Rewards", "Anywhere" }; + const char* randoShuffleTokens[4] = { "Off", "Dungeons", "Overworld", "All Tokens" }; const char* randoShopsanity[7] = { "Off", "0", "1", "2", "3", "4", "Random" }; const char* randoTokensanity[4] = { "Off", "Dungeons", "Overworld", "All Tokens" }; const char* randoShuffleScrubs[4] = { "Off", "Affordable", "Expensive", "Random Prices" }; @@ -3911,6 +3916,12 @@ void DrawRandoEditor(bool& open) { SohImGui::EnhancementCombobox("gRandomizeShuffleSongs", randoShuffleSongs, 3, 0); ImGui::Separator(); + // Shuffle Tokens + ImGui::Text("Shuffle Tokens"); + InsertHelpHoverText("Spoopy"); + SohImGui::EnhancementCombobox("gRandomizeShuffleTokens", randoShuffleTokens, 4, 0); + ImGui::Separator(); + // todo implement shops // // Shopsanity // ImGui::Text("Shopsanity"); From ac099018e4252a165757f4a6cfafa9e8eacea9dd Mon Sep 17 00:00:00 2001 From: aMannus Date: Fri, 15 Jul 2022 14:56:52 +0200 Subject: [PATCH 006/174] still nothing yet --- soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c index 51a5128559..14d0df0725 100644 --- a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -613,9 +613,18 @@ void func_80B0D878(EnSw* this, GlobalContext* globalCtx) { x = (this->unk_364.x * 10.0f); y = (this->unk_364.y * 10.0f); z = (this->unk_364.z * 10.0f); - temp_v0 = - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_SI, this->actor.world.pos.x + x, - this->actor.world.pos.y + y, this->actor.world.pos.z + z, 0, 0, 0, this->actor.params); + if (!(gSaveContext.n64ddFlag)) { + temp_v0 = Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_SI, + this->actor.world.pos.x + x, this->actor.world.pos.y + y, + this->actor.world.pos.z + z, 0, 0, 0, this->actor.params); + } else { + s32 getItemId = GI_NONE; + getItemId = GetRandomizedItemId(getItemId, this->actor.id, this->actor.params, globalCtx->sceneNum); + temp_v0 = Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, getItemId, + this->actor.world.pos.x + x, this->actor.world.pos.y + y, + this->actor.world.pos.z + z, 0, 0, 0, this->actor.params); + } + if (temp_v0 != NULL) { temp_v0->parent = NULL; } From cf0b68c572154a6df703bbb4e19a84e96990af8f Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Sat, 16 Jul 2022 00:24:38 -0700 Subject: [PATCH 007/174] Allow Equipment Toggle Allow player to toggle equipment on/off on the equipment subscreen. For tunics and boots, this will revert them to Kokiri Tunic/Kokiri Boots. For shields, it will un-equip the shield entirely. For swords, only BGS/Giant's Knife is affected, and it will revert to Master Sword. --- .../ovl_kaleido_scope/z_kaleido_equipment.c | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index a7d22e5845..7309193518 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -503,12 +503,48 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { (gEquipAgeReqs[pauseCtx->cursorY[PAUSE_EQUIP]][pauseCtx->cursorX[PAUSE_EQUIP]] == ((void)0, gSaveContext.linkAge))) { if (CHECK_BTN_ALL(input->press.button, BTN_A)) { + + // Allow Link to remove his equipment from the equipment subscreen by toggling on/off + // Shields will be un-equipped entirely, and tunics/boots will revert to Kokiri Tunic/Kokiri Boots + // Only BGS/Giant's Knife is affected, and it will revert to Master Sword. + + // If we have the feature toggled on + if (CVar_GetS32("gEquipmentCanBeRemoved", 0)) { + + // If we're on the "swords" section of the equipment screen AND we're on a currently-equipped BGS/Giant's Knife + if (pauseCtx->cursorY[PAUSE_EQUIP] == 0 && pauseCtx->cursorX[PAUSE_EQUIP] == 3 && CUR_EQUIP_VALUE(EQUIP_SWORD) == 3) { + Inventory_ChangeEquipment(EQUIP_SWORD, 2); // "Unequip" it by equipping Master Sword + gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER; + gSaveContext.infTable[29] = 0; + goto RESUME_EQUIPMENT_SWORD; // Skip to here so we don't re-equip it + } + + // If we're on the "shields" section of the equipment screen AND we're on a currently-equipped shield + if (pauseCtx->cursorY[PAUSE_EQUIP] == 1 && pauseCtx->cursorX[PAUSE_EQUIP] == CUR_EQUIP_VALUE(EQUIP_SHIELD)) { + Inventory_ChangeEquipment(EQUIP_SHIELD, 0); // Unequip it + goto RESUME_EQUIPMENT; // Skip to here so we don't re-equip it + } + + // If we're on the "tunics" section of the equipment screen AND we're on a currently-equipped tunic + if (pauseCtx->cursorY[PAUSE_EQUIP] == 2 && pauseCtx->cursorX[PAUSE_EQUIP] == CUR_EQUIP_VALUE(EQUIP_TUNIC)) { + Inventory_ChangeEquipment(EQUIP_TUNIC, 1); // "Unequip" it (by equipping Kokiri Tunic) + goto RESUME_EQUIPMENT; // Skip to here so we don't re-equip it + } + + // If we're on the "boots" section of the equipment screen AND we're on currently-equipped boots + if (pauseCtx->cursorY[PAUSE_EQUIP] == 3 && pauseCtx->cursorX[PAUSE_EQUIP] == CUR_EQUIP_VALUE(EQUIP_BOOTS)) { + Inventory_ChangeEquipment(EQUIP_BOOTS, 1); // "Unequip" it (by equipping Kokiri Boots) + goto RESUME_EQUIPMENT; // Skip to here so we don't re-equip it + } + } + if (CHECK_OWNED_EQUIP(pauseCtx->cursorY[PAUSE_EQUIP], pauseCtx->cursorX[PAUSE_EQUIP] - 1)) { Inventory_ChangeEquipment(pauseCtx->cursorY[PAUSE_EQUIP], pauseCtx->cursorX[PAUSE_EQUIP]); } else { goto EQUIP_FAIL; } + RESUME_EQUIPMENT: if (pauseCtx->cursorY[PAUSE_EQUIP] == 0) { gSaveContext.infTable[29] = 0; gSaveContext.equips.buttonItems[0] = cursorItem; @@ -525,7 +561,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KNIFE; } } - + RESUME_EQUIPMENT_SWORD: Interface_LoadItemIcon1(globalCtx, 0); } From 0f1f8c15f2cef9b01ecf67011066e7ff9bc9210a Mon Sep 17 00:00:00 2001 From: aMannus Date: Sat, 16 Jul 2022 12:20:53 +0200 Subject: [PATCH 008/174] Closer but not yet --- soh/src/overlays/actors/ovl_En_Si/z_en_si.c | 28 ++++++++++++++++++--- soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c | 14 +++-------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c index 7bd83a997f..d5abb04812 100644 --- a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -93,7 +93,12 @@ void func_80AFB768(EnSi* this, GlobalContext* globalCtx) { if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) { this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER; - Item_Give(globalCtx, ITEM_SKULL_TOKEN); + s32 getItemId = ITEM_SKULL_TOKEN; + if (gSaveContext.n64ddFlag) { + getItemId = GetRandomizedItemId(GI_SKULL_TOKEN, this->actor.id, this->actor.params, globalCtx->sceneNum); + } + //getItemId = ITEM_DINS_FIRE; + Item_Give(globalCtx, getItemId); if (CVar_GetS32("gSkulltulaFreeze", 0) != 1) { player->actor.freezeTimer = 20; } @@ -117,7 +122,12 @@ void func_80AFB89C(EnSi* this, GlobalContext* globalCtx) { this->actor.shape.rot.y += 0x400; if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_13)) { - Item_Give(globalCtx, ITEM_SKULL_TOKEN); + s32 getItemId = ITEM_SKULL_TOKEN; + if (gSaveContext.n64ddFlag) { + getItemId = GetRandomizedItemId(GI_SKULL_TOKEN, this->actor.id, this->actor.params, globalCtx->sceneNum); + } + //getItemId = ITEM_DINS_FIRE; + Item_Give(globalCtx, getItemId); Message_StartTextbox(globalCtx, 0xB4, NULL); Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET); this->actionFunc = func_80AFB950; @@ -150,6 +160,18 @@ void EnSi_Draw(Actor* thisx, GlobalContext* globalCtx) { if (this->actionFunc != func_80AFB950) { func_8002ED80(&this->actor, globalCtx, 0); func_8002EBCC(&this->actor, globalCtx, 0); - GetItem_Draw(globalCtx, GID_SKULL_TOKEN_2); + if (!gSaveContext.n64ddFlag) { + GetItem_Draw(globalCtx, GID_SKULL_TOKEN_2); + } else { + f32 mtxScale = 1.5f; + Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); + s32 randoGetItemId = + GetRandomizedItemId(GI_SKULL_TOKEN, this->actor.id, this->actor.params, globalCtx->sceneNum); + if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) { + EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); + } + GetItem_Draw(globalCtx, GetItemModelFromId(randoGetItemId)); + } + } } diff --git a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c index 14d0df0725..69fc0595ae 100644 --- a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -613,17 +613,9 @@ void func_80B0D878(EnSw* this, GlobalContext* globalCtx) { x = (this->unk_364.x * 10.0f); y = (this->unk_364.y * 10.0f); z = (this->unk_364.z * 10.0f); - if (!(gSaveContext.n64ddFlag)) { - temp_v0 = Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_SI, - this->actor.world.pos.x + x, this->actor.world.pos.y + y, - this->actor.world.pos.z + z, 0, 0, 0, this->actor.params); - } else { - s32 getItemId = GI_NONE; - getItemId = GetRandomizedItemId(getItemId, this->actor.id, this->actor.params, globalCtx->sceneNum); - temp_v0 = Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, getItemId, - this->actor.world.pos.x + x, this->actor.world.pos.y + y, - this->actor.world.pos.z + z, 0, 0, 0, this->actor.params); - } + temp_v0 = Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_SI, + this->actor.world.pos.x + x, this->actor.world.pos.y + y, + this->actor.world.pos.z + z, 0, 0, 0, this->actor.params); if (temp_v0 != NULL) { temp_v0->parent = NULL; From efe3294f1c08956441d0100a106fcaea39fbfe34 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Sat, 16 Jul 2022 10:10:34 -0700 Subject: [PATCH 009/174] Set up Cvar and check for MS Set up the cvar/imgui and add a check that we own the Master Sword (in case we're in the Ganon fight) --- libultraship/libultraship/ImGuiImpl.cpp | 2 ++ soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libultraship/libultraship/ImGuiImpl.cpp b/libultraship/libultraship/ImGuiImpl.cpp index 153a193e8d..d14f99128c 100644 --- a/libultraship/libultraship/ImGuiImpl.cpp +++ b/libultraship/libultraship/ImGuiImpl.cpp @@ -1001,6 +1001,8 @@ namespace SohImGui { Tooltip("Displays an icon and plays a sound when Stone of Agony\nshould be activated, for those without rumble"); EnhancementCheckbox("Assignable Tunics and Boots", "gAssignableTunicsAndBoots"); Tooltip("Allows equipping the tunic and boots to c-buttons"); + EnhancementCheckbox("Equipment Toggle", "gEquipmentCanBeRemoved"); + Tooltip("Allows equipment to be removed by toggling it off on\nthe equipment subscreen."); EnhancementCheckbox("Link's Cow in Both Time Periods", "gCowOfTime"); Tooltip("Allows the Lon Lon Ranch obstacle course reward to be\nshared across time periods"); EnhancementCheckbox("Enable visible guard vision", "gGuardVision"); diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index 7309193518..f08fc9abaa 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -512,7 +512,8 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { if (CVar_GetS32("gEquipmentCanBeRemoved", 0)) { // If we're on the "swords" section of the equipment screen AND we're on a currently-equipped BGS/Giant's Knife - if (pauseCtx->cursorY[PAUSE_EQUIP] == 0 && pauseCtx->cursorX[PAUSE_EQUIP] == 3 && CUR_EQUIP_VALUE(EQUIP_SWORD) == 3) { + if (pauseCtx->cursorY[PAUSE_EQUIP] == 0 && pauseCtx->cursorX[PAUSE_EQUIP] == 3 + && CUR_EQUIP_VALUE(EQUIP_SWORD) == 3 && CHECK_OWNED_EQUIP(0,1)){ // And we have the Master Sword Inventory_ChangeEquipment(EQUIP_SWORD, 2); // "Unequip" it by equipping Master Sword gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER; gSaveContext.infTable[29] = 0; From 4ccd4d58952851337ad171fce5732d0802dfcea9 Mon Sep 17 00:00:00 2001 From: aMannus Date: Sun, 17 Jul 2022 16:02:27 +0200 Subject: [PATCH 010/174] Exposed static table to change skulltokens This static table is normally only used within z_player.c, but is needed to switch the itemId to something Item_Give() can use and to set the correct TextId. --- soh/include/z64player.h | 10 ++++++++ soh/src/overlays/actors/ovl_En_Si/z_en_si.c | 24 +++++++++++-------- soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c | 1 - .../actors/ovl_player_actor/z_player.c | 11 ++------- 4 files changed, 26 insertions(+), 20 deletions(-) diff --git a/soh/include/z64player.h b/soh/include/z64player.h index 954c36c142..6128a57d85 100644 --- a/soh/include/z64player.h +++ b/soh/include/z64player.h @@ -5,6 +5,16 @@ struct Player; +typedef struct { + /* 0x00 */ u8 itemId; + /* 0x01 */ u8 field; // various bit-packed data + /* 0x02 */ s8 gi; // defines the draw id and chest opening animation + /* 0x03 */ u8 textId; + /* 0x04 */ u16 objectId; +} GetItemEntry; // size = 0x06 + +extern GetItemEntry sGetItemTable[160]; + typedef enum { /* 0 */ PLAYER_SWORD_NONE, /* 1 */ PLAYER_SWORD_KOKIRI, diff --git a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c index d5abb04812..bf8a93c4c4 100644 --- a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -93,16 +93,18 @@ void func_80AFB768(EnSi* this, GlobalContext* globalCtx) { if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) { this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER; - s32 getItemId = ITEM_SKULL_TOKEN; + s32 textId = 0xB4; + s32 itemGiveId = ITEM_SKULL_TOKEN; if (gSaveContext.n64ddFlag) { - getItemId = GetRandomizedItemId(GI_SKULL_TOKEN, this->actor.id, this->actor.params, globalCtx->sceneNum); + s32 getItemId = GetRandomizedItemId(GI_SKULL_TOKEN, this->actor.id, this->actor.params, globalCtx->sceneNum); + textId = sGetItemTable[getItemId - 1].textId; + itemGiveId = sGetItemTable[getItemId - 1].itemId; } - //getItemId = ITEM_DINS_FIRE; - Item_Give(globalCtx, getItemId); + Item_Give(globalCtx, itemGiveId); if (CVar_GetS32("gSkulltulaFreeze", 0) != 1) { player->actor.freezeTimer = 20; } - Message_StartTextbox(globalCtx, 0xB4, NULL); + Message_StartTextbox(globalCtx, textId, NULL); Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET); this->actionFunc = func_80AFB950; } else { @@ -122,13 +124,15 @@ void func_80AFB89C(EnSi* this, GlobalContext* globalCtx) { this->actor.shape.rot.y += 0x400; if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_13)) { - s32 getItemId = ITEM_SKULL_TOKEN; + s32 textId = 0xB4; + s32 itemGiveId = ITEM_SKULL_TOKEN; if (gSaveContext.n64ddFlag) { - getItemId = GetRandomizedItemId(GI_SKULL_TOKEN, this->actor.id, this->actor.params, globalCtx->sceneNum); + s32 getItemId = GetRandomizedItemId(GI_SKULL_TOKEN, this->actor.id, this->actor.params, globalCtx->sceneNum); + textId = sGetItemTable[getItemId - 1].textId; + itemGiveId = sGetItemTable[getItemId - 1].itemId; } - //getItemId = ITEM_DINS_FIRE; - Item_Give(globalCtx, getItemId); - Message_StartTextbox(globalCtx, 0xB4, NULL); + Item_Give(globalCtx, itemGiveId); + Message_StartTextbox(globalCtx, textId, NULL); Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET); this->actionFunc = func_80AFB950; } diff --git a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c index 69fc0595ae..864fa22707 100644 --- a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -616,7 +616,6 @@ void func_80B0D878(EnSw* this, GlobalContext* globalCtx) { temp_v0 = Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_SI, this->actor.world.pos.x + x, this->actor.world.pos.y + y, this->actor.world.pos.z + z, 0, 0, 0, this->actor.params); - if (temp_v0 != NULL) { temp_v0->parent = NULL; } diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 1973a09a44..330c53738e 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -6,6 +6,7 @@ #include "ultra64.h" #include "global.h" +#include "z64player.h" #include "overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h" #include "overlays/actors/ovl_Door_Shutter/z_door_shutter.h" @@ -21,14 +22,6 @@ #include "objects/object_link_child/object_link_child.h" #include "textures/icon_item_24_static/icon_item_24_static.h" -typedef struct { - /* 0x00 */ u8 itemId; - /* 0x01 */ u8 field; // various bit-packed data - /* 0x02 */ s8 gi; // defines the draw id and chest opening animation - /* 0x03 */ u8 textId; - /* 0x04 */ u16 objectId; -} GetItemEntry; // size = 0x06 - #define GET_ITEM(itemId, objectId, drawId, textId, field, chestAnim) \ { itemId, field, (chestAnim != CHEST_ANIM_SHORT ? 1 : -1) * (drawId + 1), textId, objectId } @@ -496,7 +489,7 @@ static u16 D_8085361C[] = { NA_SE_VO_LI_FALL_L, }; -static GetItemEntry sGetItemTable[] = { +GetItemEntry sGetItemTable[] = { GET_ITEM(ITEM_BOMBS_5, OBJECT_GI_BOMB_1, GID_BOMB, 0x32, 0x59, CHEST_ANIM_SHORT), GET_ITEM(ITEM_NUTS_5, OBJECT_GI_NUTS, GID_NUTS, 0x34, 0x0C, CHEST_ANIM_SHORT), GET_ITEM(ITEM_BOMBCHU, OBJECT_GI_BOMB_2, GID_BOMBCHU, 0x33, 0x80, CHEST_ANIM_SHORT), From 0da14603e2c97b69ac63e0ffeaff2b18ae4a77c3 Mon Sep 17 00:00:00 2001 From: aMannus Date: Sun, 17 Jul 2022 23:50:48 +0200 Subject: [PATCH 011/174] Freeze fix/first batch of skull actors --- .../Enhancements/randomizer/randomizer.cpp | 28 +++++++++++++++++++ soh/src/overlays/actors/ovl_En_Si/z_en_si.c | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 354c6f7fc9..a7d23c443b 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -2960,6 +2960,12 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act return RC_HF_COW_GROTTO_GOSSIP_STONE; case 14355: return RC_HC_STORMS_GROTTO_GOSSIP_STONE; + case 10753: + return RC_HF_GS_COW_GROTTO; + case 10754: + return RC_HF_GS_NEAR_KAK_GROTTO; + case 11778: + return RC_HC_GS_STORMS_GROTTO; default: return RC_UNKNOWN_CHECK; } @@ -2998,6 +3004,12 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act return RC_LLR_FREESTANDING_POH; } break; + case 77: + switch (actorParams) { + case -29176: + return RC_MARKET_GS_GUARD_HOUSE; + } + break; case 82: switch (actorId) { case 316: @@ -3044,6 +3056,12 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act return RC_KF_DEKU_TREE_RIGHT_GOSSIP_STONE; case 14623: return RC_KF_DEKU_TREE_LEFT_GOSSIP_STONE; + case 19458: + return RC_KF_GS_KNOW_IT_ALL_HOUSE; + case 27649: + return RC_KF_GS_BEAN_PATCH; + case 19460: + return RC_KF_GS_HOUSE_OF_TWINS; } break; case 86: @@ -3054,6 +3072,8 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act return RC_SFM_MAZE_UPPER_GOSSIP_STONE; case 14876: return RC_SFM_SARIA_GOSSIP_STONE; + case 19720: + return RC_SFM_GS; } break; case 87: @@ -3116,6 +3136,12 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act return RC_LW_DEKU_SCRUB_NEAR_BRIDGE; case 14365: return RC_LW_GOSSIP_STONE; + case 27905: + return RC_LW_GS_BEAN_PATCH_NEAR_BRIDGE; + case 27906: + return RC_LW_GS_BEAN_PATCH_NEAR_THEATER; + case 19716: + return RC_LW_GS_ABOVE_THEATER; } break; case 92: @@ -3149,6 +3175,8 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act return RC_HC_MALON_GOSSIP_STONE; case 14347: return RC_HC_ROCK_WALL_GOSSIP_STONE; + case -29180: + return RC_HC_GS_TREE; } break; case 96: diff --git a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c index bf8a93c4c4..9293a436f6 100644 --- a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -101,7 +101,7 @@ void func_80AFB768(EnSi* this, GlobalContext* globalCtx) { itemGiveId = sGetItemTable[getItemId - 1].itemId; } Item_Give(globalCtx, itemGiveId); - if (CVar_GetS32("gSkulltulaFreeze", 0) != 1) { + if (CVar_GetS32("gSkulltulaFreeze", 0) != 1 || itemGiveId != ITEM_SKULL_TOKEN) { player->actor.freezeTimer = 20; } Message_StartTextbox(globalCtx, textId, NULL); From 3b747b41becd8296b8e14b291426ca77f94fc9dc Mon Sep 17 00:00:00 2001 From: aMannus Date: Mon, 18 Jul 2022 09:05:32 +0200 Subject: [PATCH 012/174] Cleanup and freeze fix Don't freeze the player when the skulltula token check is something else than a token. Also some cleanup and declaring variables more globally within z_en_si.c --- soh/src/overlays/actors/ovl_En_Si/z_en_si.c | 40 ++++++++++--------- .../actors/ovl_player_actor/z_player.c | 1 - 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c index 9293a436f6..91fe0126c8 100644 --- a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -18,6 +18,10 @@ void func_80AFB768(EnSi* this, GlobalContext* globalCtx); void func_80AFB89C(EnSi* this, GlobalContext* globalCtx); void func_80AFB950(EnSi* this, GlobalContext* globalCtx); +s32 textId = 0xB4; +s32 giveItemId = ITEM_SKULL_TOKEN; +s32 getItemId; + static ColliderCylinderInit sCylinderInit = { { COLTYPE_NONE, @@ -93,15 +97,13 @@ void func_80AFB768(EnSi* this, GlobalContext* globalCtx) { if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) { this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER; - s32 textId = 0xB4; - s32 itemGiveId = ITEM_SKULL_TOKEN; if (gSaveContext.n64ddFlag) { - s32 getItemId = GetRandomizedItemId(GI_SKULL_TOKEN, this->actor.id, this->actor.params, globalCtx->sceneNum); + getItemId = GetRandomizedItemId(GI_SKULL_TOKEN, this->actor.id, this->actor.params, globalCtx->sceneNum); textId = sGetItemTable[getItemId - 1].textId; - itemGiveId = sGetItemTable[getItemId - 1].itemId; + giveItemId = sGetItemTable[getItemId - 1].itemId; } - Item_Give(globalCtx, itemGiveId); - if (CVar_GetS32("gSkulltulaFreeze", 0) != 1 || itemGiveId != ITEM_SKULL_TOKEN) { + Item_Give(globalCtx, giveItemId); + if (CVar_GetS32("gSkulltulaFreeze", 0) != 1 || giveItemId != ITEM_SKULL_TOKEN) { player->actor.freezeTimer = 20; } Message_StartTextbox(globalCtx, textId, NULL); @@ -124,14 +126,12 @@ void func_80AFB89C(EnSi* this, GlobalContext* globalCtx) { this->actor.shape.rot.y += 0x400; if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_13)) { - s32 textId = 0xB4; - s32 itemGiveId = ITEM_SKULL_TOKEN; if (gSaveContext.n64ddFlag) { - s32 getItemId = GetRandomizedItemId(GI_SKULL_TOKEN, this->actor.id, this->actor.params, globalCtx->sceneNum); + getItemId = GetRandomizedItemId(GI_SKULL_TOKEN, this->actor.id, this->actor.params, globalCtx->sceneNum); + giveItemId = sGetItemTable[getItemId - 1].itemId; textId = sGetItemTable[getItemId - 1].textId; - itemGiveId = sGetItemTable[getItemId - 1].itemId; } - Item_Give(globalCtx, itemGiveId); + Item_Give(globalCtx, giveItemId); Message_StartTextbox(globalCtx, textId, NULL); Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET); this->actionFunc = func_80AFB950; @@ -141,7 +141,7 @@ void func_80AFB89C(EnSi* this, GlobalContext* globalCtx) { void func_80AFB950(EnSi* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if (Message_GetState(&globalCtx->msgCtx) != TEXT_STATE_CLOSING && CVar_GetS32("gSkulltulaFreeze", 0) != 1) { + if (Message_GetState(&globalCtx->msgCtx) != TEXT_STATE_CLOSING && (CVar_GetS32("gSkulltulaFreeze", 0) != 1 || giveItemId != ITEM_SKULL_TOKEN)) { player->actor.freezeTimer = 10; } else { SET_GS_FLAGS((this->actor.params & 0x1F00) >> 8, this->actor.params & 0xFF); @@ -167,14 +167,16 @@ void EnSi_Draw(Actor* thisx, GlobalContext* globalCtx) { if (!gSaveContext.n64ddFlag) { GetItem_Draw(globalCtx, GID_SKULL_TOKEN_2); } else { - f32 mtxScale = 1.5f; - Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); - s32 randoGetItemId = - GetRandomizedItemId(GI_SKULL_TOKEN, this->actor.id, this->actor.params, globalCtx->sceneNum); - if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) { - EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); + f32 mtxScale; + getItemId = GetRandomizedItemId(GI_SKULL_TOKEN, this->actor.id, this->actor.params, globalCtx->sceneNum); + if (getItemId >= GI_MINUET_OF_FOREST && getItemId <= GI_DOUBLE_DEFENSE) { + EnItem00_CustomItemsParticles(&this->actor, globalCtx, getItemId); } - GetItem_Draw(globalCtx, GetItemModelFromId(randoGetItemId)); + if (getItemId != ITEM_SKULL_TOKEN) { + mtxScale = 1.5f; + Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); + } + GetItem_Draw(globalCtx, GetItemModelFromId(getItemId)); } } diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 330c53738e..6f4800a9fb 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -6,7 +6,6 @@ #include "ultra64.h" #include "global.h" -#include "z64player.h" #include "overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h" #include "overlays/actors/ovl_Door_Shutter/z_door_shutter.h" From 06c3c2ba67317a5d5c3b71aa9b087b4c228f3383 Mon Sep 17 00:00:00 2001 From: aMannus Date: Mon, 18 Jul 2022 09:10:36 +0200 Subject: [PATCH 013/174] Fixed mistake --- soh/soh/Enhancements/randomizer/randomizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index a7d23c443b..2bdc7f5051 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -3249,7 +3249,7 @@ void GenerateRandomizerImgui() { cvarSettings[RSK_STARTING_DEKU_SHIELD] = CVar_GetS32("gRandomizeStartingDekuShield", 0); cvarSettings[RSK_STARTING_MAPS_COMPASSES] = CVar_GetS32("gRandomizeStartingMapsCompasses", 0); cvarSettings[RSK_SHUFFLE_DUNGEON_REWARDS] = CVar_GetS32("gRandomizeShuffleDungeonReward", 0); - cvarSettings[RSK_SHUFFLE_SONGS] = CVar_GetS32("gRandomizeShuffleTokens", 0); + cvarSettings[RSK_SHUFFLE_SONGS] = CVar_GetS32("gRandomizeShuffleSongs", 0); cvarSettings[RSK_SHUFFLE_TOKENS] = CVar_GetS32("gRandomizeShuffleTokens", 0); cvarSettings[RSK_SKIP_CHILD_ZELDA] = CVar_GetS32("gRandomizeSkipChildZelda", 0); From 3341c3d404b669994a3f9baf84771e2e8f6b9a28 Mon Sep 17 00:00:00 2001 From: aMannus Date: Mon, 18 Jul 2022 11:08:35 +0200 Subject: [PATCH 014/174] Another batch of spooders --- .../Enhancements/randomizer/randomizer.cpp | 60 ++++++++++++++++++- .../actors/ovl_player_actor/z_player.c | 4 +- 2 files changed, 60 insertions(+), 4 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 2bdc7f5051..1948c414ca 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -3018,6 +3018,18 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act } else { return RC_KAK_ANJU_AS_CHILD; } + case -28640: + return RC_KAK_GS_TREE; + case 20482: + return RC_KAK_GS_GUARDS_HOUSE; + case 20484: + return RC_KAK_GS_WATCHTOWER; + case 20496: + return RC_KAK_GS_SKULLTULA_HOUSE; + case 20488: + return RC_KAK_GS_HOUSE_UNDER_CONSTRUCTION; + case 20544: + return RC_KAK_GS_ABOVE_IMPAS_HOUSE; } break; case 83: @@ -3028,10 +3040,10 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act return RC_GRAVEYARD_DAMPE_GRAVEDIGGING_TOUR; case 14346: return RC_GY_GOSSIP_STONE; + case 28673: + return RC_GRAVEYARD_GS_BEAN_PATCH; case 20608: return RC_GRAVEYARD_GS_WALL; - //case 0: - //return RC_GRAVEYARD_GS_BEAN_PATCH; } break; case 84: @@ -3044,6 +3056,14 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act return RC_ZR_NEAR_GROTTOS_GOSSIP_STONE; case 14860: return RC_ZR_NEAR_DOMAIN_GOSSIP_STONE; + case -28414: + return RC_ZR_GS_TREE; + case 20737: + return RC_ZR_GS_LADDER; + case 20752: + return RC_ZR_GS_NEAR_RAISED_GROTTOS; + case 20744: + return RC_ZR_GS_ABOVE_BRIDGE; } break; case 85: @@ -3102,6 +3122,8 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act return RC_ZD_CHEST; case 14345: return RC_ZD_GOSSIP_STONE; + case 20800: + return RC_ZD_GS_FROZEN_WATERFALL; } break; case 89: @@ -3116,6 +3138,12 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act case 14849: case 14337: return RC_FAIRY_GOSSIP_STONE; + case 20740: + return RC_ZF_GS_ABOVE_THE_LOG; + case -28288: + return RC_ZF_GS_TREE; + case 20768: + return RC_ZF_GS_HIDDEN_CAVE; } break; case 90: @@ -3187,6 +3215,14 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act return RC_DMT_CHEST; case 14340: return RC_DMT_GOSSIP_STONE; + case 12036: + return RC_DMT_GS_NEAR_KAK; + case 28418: + return RC_DMT_GS_BEAN_PATCH; + case 20232: + return RC_DMT_GS_ABOVE_DODONGOS_CAVERN; + case 20240: + return RC_DMT_GS_FALLING_ROCKS_PATH; } break; case 97: @@ -3197,6 +3233,10 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act return RC_DMC_WALL_FREESTANDING_POH; case 14341: return RC_DMC_GOSSIP_STONE; + case -28800: + return RC_DMC_GS_CRATE; + case 28417: + return RC_DMC_GS_BEAN_PATCH; } break; case 98: @@ -3213,6 +3253,22 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act return RC_GC_MAZE_GOSSIP_STONE; case 14873: return RC_GC_MEDIGORON_GOSSIP_STONE; + case 12064: + return RC_GC_GS_CENTER_PLATFORM; + case -28864: + return RC_GC_GS_BOULDER_MAZE; + } + break; + case 99: + switch (actorParams) { + case 11012: + return RC_LLR_GS_HOUSE_WINDOW; + case -29944: + return RC_LLR_GS_TREE; + case 11010: + return RC_LLR_GS_RAIN_SHED; + case 11009: + return RC_LLR_GS_BACK_WALL; } break; } diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 6f4800a9fb..59b7ade1af 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -6081,7 +6081,7 @@ void func_8083DFE0(Player* this, f32* arg1, s16* arg2) { if (this->swordState == 0) { float maxSpeed = R_RUN_SPEED_LIMIT / 100.0f; if (CVar_GetS32("gMMBunnyHood", 0) != 0 && this->currentMask == PLAYER_MASK_BUNNY) { - maxSpeed *= 1.5f; + maxSpeed *= 3.0f; } this->linearVelocity = CLAMP(this->linearVelocity, -maxSpeed, maxSpeed); } @@ -7688,7 +7688,7 @@ void func_80842180(Player* this, GlobalContext* globalCtx) { if (!func_8083C484(this, &sp2C, &sp2A)) { if (CVar_GetS32("gMMBunnyHood", 0) != 0 && this->currentMask == PLAYER_MASK_BUNNY) { - sp2C *= 1.5f; + sp2C *= 3.0f; } func_8083DF68(this, sp2C, sp2A); func_8083DDC8(this, globalCtx); From 3de4e955db89b176e72654022dff34ba96be96fd Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Mon, 18 Jul 2022 14:44:55 -0700 Subject: [PATCH 015/174] Giant's Knife Behaviour Fixes Fixes a case where Giant's Knife (specifically, breaking and re-buying it) can behave unexpectedly if you don't have a Kokiri Sword in your inventory. Also fixes the broken icon not showing up in inventory after you break it. --- soh/src/code/z_parameter.c | 7 +++++-- .../overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 0ac1e1048c..9266343397 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -1676,13 +1676,16 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { if (item == ITEM_SWORD_BGS) { gSaveContext.swordHealth = 8; - if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF) { - gSaveContext.inventory.equipment ^= 8 << gEquipShifts[EQUIP_SWORD]; + if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF + ||(gSaveContext.n64ddFlag && ALL_EQUIP_VALUE(EQUIP_SWORD))) { // In rando, when buying Giant's Knife, also check + gSaveContext.inventory.equipment ^= 8 << gEquipShifts[EQUIP_SWORD]; // for 0xE in case we don't have Kokiri Sword if (gSaveContext.equips.buttonItems[0] == ITEM_SWORD_KNIFE) { gSaveContext.equips.buttonItems[0] = ITEM_SWORD_BGS; Interface_LoadItemIcon1(globalCtx, 0); } } + + } else if (item == ITEM_SWORD_MASTER) { gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER; gSaveContext.equips.equipment &= 0xFFF0; diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index a7d22e5845..79b43eb3cc 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -652,7 +652,10 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { gsDPSetGrayscaleColor(POLY_KAL_DISP++, 109, 109, 109, 255); gsSPGrayscale(POLY_KAL_DISP++, true); } - KaleidoScope_DrawQuadTextureRGBA32(globalCtx->state.gfxCtx, gItemIcons[itemId], 32, 32, point); + + if (!((i == 0) && (k == 2) && (gBitFlags[bit + 1] & gSaveContext.inventory.equipment))) { // Don't draw the full BGS icon when we have a broken Giant's Knife + KaleidoScope_DrawQuadTextureRGBA32(globalCtx->state.gfxCtx, gItemIcons[itemId], 32, 32, point); + } gsSPGrayscale(POLY_KAL_DISP++, false); } } From b188ed8fb4770945cb99b5e4811c7cff44dc5540 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Mon, 18 Jul 2022 14:47:15 -0700 Subject: [PATCH 016/174] less whitespace --- soh/src/code/z_parameter.c | 1 - 1 file changed, 1 deletion(-) diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 9266343397..3baf7dd772 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -1685,7 +1685,6 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { } } - } else if (item == ITEM_SWORD_MASTER) { gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER; gSaveContext.equips.equipment &= 0xFFF0; From 3a11aa08bb0c24055bffd875259a4f6442e0badc Mon Sep 17 00:00:00 2001 From: aMannus Date: Mon, 18 Jul 2022 23:55:44 +0200 Subject: [PATCH 017/174] Added v1 ice traps and fixed some tokens --- .../Enhancements/randomizer/randomizer.cpp | 2 ++ soh/src/code/z_message_PAL.c | 14 ++++++++++ soh/src/overlays/actors/ovl_En_Si/z_en_si.c | 28 +++++++++++++------ 3 files changed, 36 insertions(+), 8 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 1948c414ca..2db510c174 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -3018,6 +3018,8 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act } else { return RC_KAK_ANJU_AS_CHILD; } + } + switch (actorParams) { case -28640: return RC_KAK_GS_TREE; case 20482: diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 9cf592e4fb..7f7733c79e 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -1735,6 +1735,20 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) { } else { msgCtx->msgLength = font->msgLength = CopyGanonHintText(font->msgBuf, sizeof(font->msgBuf)); } + } else if (textId == 0xF8 && GET_PLAYER(globalCtx)->getItemId == GI_ICE_TRAP) { + switch (gSaveContext.language) { + case LANGUAGE_FRA: + strcpy(font->msgBuf, "\x08\x06\x50\x05\x43IDIOT\x0E\x20\x02"); + break; + case LANGUAGE_GER: + strcpy(font->msgBuf, "\x08\x06\x15 Du bist ein\x05\x43 DUMMKOPF\x05\x40!\x0E\x20\x02"); + break; + case LANGUAGE_ENG: + default: + strcpy(font->msgBuf, "\x08\x06\x30You are a\x05\x43 FOWL\x05\x40!\x0E\x20\x02"); + break; + } + msgCtx->msgLength = font->msgLength = strlen(font->msgBuf); } else { msgCtx->msgLength = font->msgLength; char* src = (uintptr_t)font->msgOffset; diff --git a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c index 91fe0126c8..db91b77a13 100644 --- a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -98,11 +98,17 @@ void func_80AFB768(EnSi* this, GlobalContext* globalCtx) { if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) { this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER; if (gSaveContext.n64ddFlag) { - getItemId = GetRandomizedItemId(GI_SKULL_TOKEN, this->actor.id, this->actor.params, globalCtx->sceneNum); - textId = sGetItemTable[getItemId - 1].textId; - giveItemId = sGetItemTable[getItemId - 1].itemId; + if (getItemId == GI_ICE_TRAP) { + GiveItemWithoutActor(globalCtx, getItemId); + textId = 0xF8; + } else { + textId = sGetItemTable[getItemId - 1].textId; + giveItemId = sGetItemTable[getItemId - 1].itemId; + } + } + if (getItemId != GI_ICE_TRAP) { + Item_Give(globalCtx, giveItemId); } - Item_Give(globalCtx, giveItemId); if (CVar_GetS32("gSkulltulaFreeze", 0) != 1 || giveItemId != ITEM_SKULL_TOKEN) { player->actor.freezeTimer = 20; } @@ -127,11 +133,17 @@ void func_80AFB89C(EnSi* this, GlobalContext* globalCtx) { if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_13)) { if (gSaveContext.n64ddFlag) { - getItemId = GetRandomizedItemId(GI_SKULL_TOKEN, this->actor.id, this->actor.params, globalCtx->sceneNum); - giveItemId = sGetItemTable[getItemId - 1].itemId; - textId = sGetItemTable[getItemId - 1].textId; + if (getItemId == GI_ICE_TRAP) { + GiveItemWithoutActor(globalCtx, getItemId); + textId = 0xF8; + } else { + textId = sGetItemTable[getItemId - 1].textId; + giveItemId = sGetItemTable[getItemId - 1].itemId; + } + } + if (getItemId != GI_ICE_TRAP) { + Item_Give(globalCtx, giveItemId); } - Item_Give(globalCtx, giveItemId); Message_StartTextbox(globalCtx, textId, NULL); Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET); this->actionFunc = func_80AFB950; From cb1b725cdab2c7b1309f8076454c0ae914600253 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Mon, 18 Jul 2022 18:39:24 -0700 Subject: [PATCH 018/174] Shorten code Shortened the code --- .../actors/ovl_player_actor/z_player.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 916116156f..c518e7c2e9 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -12679,28 +12679,18 @@ s32 func_8084DFF4(GlobalContext* globalCtx, Player* this) { // In Rando, if we get special quest items (medallions/stones/songs), play their respective unique fanfares // instead of the default "get item" fanfare (if we have the setting toggled on) if (gSaveContext.n64ddFlag && CVar_GetS32("gRandoFanfareByItemType", 0) != 0) { - // If the item we're getting is a medallion, play the "get a medallion" fanfare - if ((this->getItemId == GI_MEDALLION_FOREST) || (this->getItemId == GI_MEDALLION_FIRE) || - (this->getItemId == GI_MEDALLION_WATER) || (this->getItemId == GI_MEDALLION_SHADOW) || - (this->getItemId == GI_MEDALLION_SPIRIT) || (this->getItemId == GI_MEDALLION_LIGHT)) { + if ((this->getItemId >= GI_MEDALLION_LIGHT) && (this->getItemId <= GI_MEDALLION_SPIRIT)) { temp1 = NA_BGM_MEDALLION_GET | 0x900; } // If it's a Spiritual Stone, play the "get a spiritual stone" fanfare - if ((this->getItemId == GI_STONE_KOKIRI) || (this->getItemId == GI_STONE_GORON) || - (this->getItemId == GI_STONE_ZORA)) { + if ((this->getItemId >= GI_STONE_KOKIRI) && (this->getItemId <= GI_STONE_ZORA)) { temp1 = NA_BGM_SPIRITUAL_STONE | 0x900; } // If the item we're getting is a song, play the "learned a song" fanfare - if ((this->getItemId == GI_SONG_OF_STORMS) || (this->getItemId == GI_SERENADE_OF_WATER) || - (this->getItemId == GI_EPONAS_SONG) || (this->getItemId == GI_SARIAS_SONG) || - (this->getItemId == GI_SUNS_SONG) || (this->getItemId == GI_SONG_OF_TIME) || - (this->getItemId == GI_PRELUDE_OF_LIGHT) || (this->getItemId == GI_MINUET_OF_FOREST) || - (this->getItemId == GI_BOLERO_OF_FIRE) || (this->getItemId == GI_NOCTURNE_OF_SHADOW) || - (this->getItemId == GI_REQUIEM_OF_SPIRIT) || (this->getItemId == GI_ZELDAS_LULLABY)) { + if ((this->getItemId >= GI_ZELDAS_LULLABY) && (this->getItemId <= GI_PRELUDE_OF_LIGHT)) { temp1 = NA_BGM_OCA_FAIRY_GET | 0x900; } - } - // *************************************************************************************** + } // *************************************************************************************** Audio_PlayFanfare(temp1); } From d9f4314f5c65154e5824e8f6a6060863bd9986d9 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Mon, 18 Jul 2022 19:01:47 -0700 Subject: [PATCH 019/174] Undo accidental commit I'm a dummy and accidentally committed changes from other branches I was working on. --- libultraship/libultraship/ImGuiImpl.cpp | 2 - soh/src/code/z_parameter.c | 6 +-- .../ovl_kaleido_scope/z_kaleido_equipment.c | 44 +------------------ 3 files changed, 4 insertions(+), 48 deletions(-) diff --git a/libultraship/libultraship/ImGuiImpl.cpp b/libultraship/libultraship/ImGuiImpl.cpp index 55316f2e34..b9ce62aee9 100644 --- a/libultraship/libultraship/ImGuiImpl.cpp +++ b/libultraship/libultraship/ImGuiImpl.cpp @@ -1105,8 +1105,6 @@ namespace SohImGui { Tooltip("Displays an icon and plays a sound when Stone of Agony\nshould be activated, for those without rumble"); EnhancementCheckbox("Assignable Tunics and Boots", "gAssignableTunicsAndBoots"); Tooltip("Allows equipping the tunic and boots to c-buttons"); - EnhancementCheckbox("Equipment Toggle", "gEquipmentCanBeRemoved"); - Tooltip("Allows equipment to be removed by toggling it off on\nthe equipment subscreen."); EnhancementCheckbox("Link's Cow in Both Time Periods", "gCowOfTime"); Tooltip("Allows the Lon Lon Ranch obstacle course reward to be\nshared across time periods"); EnhancementCheckbox("Enable visible guard vision", "gGuardVision"); diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 713ac3f9cd..4a79bd3bc5 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -1676,15 +1676,13 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { if (item == ITEM_SWORD_BGS) { gSaveContext.swordHealth = 8; - if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF - ||(gSaveContext.n64ddFlag && ALL_EQUIP_VALUE(EQUIP_SWORD))) { // In rando, when buying Giant's Knife, also check - gSaveContext.inventory.equipment ^= 8 << gEquipShifts[EQUIP_SWORD]; // for 0xE in case we don't have Kokiri Sword + if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF) { + gSaveContext.inventory.equipment ^= 8 << gEquipShifts[EQUIP_SWORD]; if (gSaveContext.equips.buttonItems[0] == ITEM_SWORD_KNIFE) { gSaveContext.equips.buttonItems[0] = ITEM_SWORD_BGS; Interface_LoadItemIcon1(globalCtx, 0); } } - } else if (item == ITEM_SWORD_MASTER) { gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER; gSaveContext.equips.equipment &= 0xFFF0; diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index f0af1a5aa7..a7d22e5845 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -503,49 +503,12 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { (gEquipAgeReqs[pauseCtx->cursorY[PAUSE_EQUIP]][pauseCtx->cursorX[PAUSE_EQUIP]] == ((void)0, gSaveContext.linkAge))) { if (CHECK_BTN_ALL(input->press.button, BTN_A)) { - - // Allow Link to remove his equipment from the equipment subscreen by toggling on/off - // Shields will be un-equipped entirely, and tunics/boots will revert to Kokiri Tunic/Kokiri Boots - // Only BGS/Giant's Knife is affected, and it will revert to Master Sword. - - // If we have the feature toggled on - if (CVar_GetS32("gEquipmentCanBeRemoved", 0)) { - - // If we're on the "swords" section of the equipment screen AND we're on a currently-equipped BGS/Giant's Knife - if (pauseCtx->cursorY[PAUSE_EQUIP] == 0 && pauseCtx->cursorX[PAUSE_EQUIP] == 3 - && CUR_EQUIP_VALUE(EQUIP_SWORD) == 3 && CHECK_OWNED_EQUIP(0,1)){ // And we have the Master Sword - Inventory_ChangeEquipment(EQUIP_SWORD, 2); // "Unequip" it by equipping Master Sword - gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER; - gSaveContext.infTable[29] = 0; - goto RESUME_EQUIPMENT_SWORD; // Skip to here so we don't re-equip it - } - - // If we're on the "shields" section of the equipment screen AND we're on a currently-equipped shield - if (pauseCtx->cursorY[PAUSE_EQUIP] == 1 && pauseCtx->cursorX[PAUSE_EQUIP] == CUR_EQUIP_VALUE(EQUIP_SHIELD)) { - Inventory_ChangeEquipment(EQUIP_SHIELD, 0); // Unequip it - goto RESUME_EQUIPMENT; // Skip to here so we don't re-equip it - } - - // If we're on the "tunics" section of the equipment screen AND we're on a currently-equipped tunic - if (pauseCtx->cursorY[PAUSE_EQUIP] == 2 && pauseCtx->cursorX[PAUSE_EQUIP] == CUR_EQUIP_VALUE(EQUIP_TUNIC)) { - Inventory_ChangeEquipment(EQUIP_TUNIC, 1); // "Unequip" it (by equipping Kokiri Tunic) - goto RESUME_EQUIPMENT; // Skip to here so we don't re-equip it - } - - // If we're on the "boots" section of the equipment screen AND we're on currently-equipped boots - if (pauseCtx->cursorY[PAUSE_EQUIP] == 3 && pauseCtx->cursorX[PAUSE_EQUIP] == CUR_EQUIP_VALUE(EQUIP_BOOTS)) { - Inventory_ChangeEquipment(EQUIP_BOOTS, 1); // "Unequip" it (by equipping Kokiri Boots) - goto RESUME_EQUIPMENT; // Skip to here so we don't re-equip it - } - } - if (CHECK_OWNED_EQUIP(pauseCtx->cursorY[PAUSE_EQUIP], pauseCtx->cursorX[PAUSE_EQUIP] - 1)) { Inventory_ChangeEquipment(pauseCtx->cursorY[PAUSE_EQUIP], pauseCtx->cursorX[PAUSE_EQUIP]); } else { goto EQUIP_FAIL; } - RESUME_EQUIPMENT: if (pauseCtx->cursorY[PAUSE_EQUIP] == 0) { gSaveContext.infTable[29] = 0; gSaveContext.equips.buttonItems[0] = cursorItem; @@ -562,7 +525,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KNIFE; } } - RESUME_EQUIPMENT_SWORD: + Interface_LoadItemIcon1(globalCtx, 0); } @@ -689,10 +652,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { gsDPSetGrayscaleColor(POLY_KAL_DISP++, 109, 109, 109, 255); gsSPGrayscale(POLY_KAL_DISP++, true); } - - if (!((i == 0) && (k == 2) && (gBitFlags[bit + 1] & gSaveContext.inventory.equipment))) { // Don't draw the full BGS icon when we have a broken Giant's Knife - KaleidoScope_DrawQuadTextureRGBA32(globalCtx->state.gfxCtx, gItemIcons[itemId], 32, 32, point); - } + KaleidoScope_DrawQuadTextureRGBA32(globalCtx->state.gfxCtx, gItemIcons[itemId], 32, 32, point); gsSPGrayscale(POLY_KAL_DISP++, false); } } From 02d0b354a1de58b20c2482babad4af0a2bf7554f Mon Sep 17 00:00:00 2001 From: aMannus Date: Tue, 12 Jul 2022 17:21:14 +0200 Subject: [PATCH 020/174] Copied over files from old branch Dev merge made it so I couldn't easily merge into the old branch, so this is the next best thing. --- .../randomizer/3drando/settings.cpp | 136 +- .../randomizer/3drando/settings.hpp | 10 +- .../Enhancements/randomizer/randomizer.cpp | 1375 +++++------------ 3 files changed, 420 insertions(+), 1101 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/3drando/settings.cpp b/soh/soh/Enhancements/randomizer/3drando/settings.cpp index 05fc10c4bb..c68898b26a 100644 --- a/soh/soh/Enhancements/randomizer/3drando/settings.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/settings.cpp @@ -52,19 +52,19 @@ namespace Settings { // Setting name, Options, Setting Descriptions (assigned in setting_descriptions.cpp) Category (default: Setting),Default index (default: 0), Default hidden (default: false) //Open Settings Any option index past the last description will use the last description Option RandomizeOpen = Option::Bool("Randomize Settings", {"No","Yes"}, {openRandomize}, OptionCategory::Toggle); - Option OpenForest = Option::U8 ("Forest", {"Closed", "Open", "Closed Deku"}, {forestClosed, forestOpen, forestClosedDeku}, OptionCategory::Setting, OPENFOREST_OPEN); + Option OpenForest = Option::U8 ("Forest", {"Closed", "Closed Deku", "Open"}, {forestClosed, forestClosedDeku, forestOpen}, OptionCategory::Setting, OPENFOREST_CLOSED); Option OpenKakariko = Option::U8 ("Kakariko Gate", {"Closed", "Open"}, {kakGateClosed, kakGateOpen}); - Option OpenDoorOfTime = Option::U8 ("Door of Time", {"Open", "Closed", "Intended"}, {doorOfTimeOpen, doorOfTimeClosed, doorOfTimeIntended}); - Option ZorasFountain = Option::U8 ("Zora's Fountain", {"Normal", "Adult", "Open"}, {fountainNormal, fountainAdult, fountainOpen}); + Option OpenDoorOfTime = Option::U8 ("Door of Time", {"Closed", "Song Only", "Open"}, {doorOfTimeIntended, doorOfTimeClosed, doorOfTimeOpen}); + Option ZorasFountain = Option::U8 ("Zora's Fountain", {"Closed", "Closed as child", "Open"}, {fountainNormal, fountainAdult, fountainOpen}); Option GerudoFortress = Option::U8 ("Gerudo Fortress", {"Normal", "Fast", "Open"}, {gerudoNormal, gerudoFast, gerudoOpen}); - Option Bridge = Option::U8 ("Rainbow Bridge", {"Open", "Vanilla", "Stones", "Medallions", "Rewards", "Dungeons", "Tokens"}, {bridgeOpen, bridgeVanilla, bridgeStones, bridgeMedallions, bridgeRewards, bridgeDungeons, bridgeTokens}, OptionCategory::Setting, RAINBOWBRIDGE_VANILLA); - Option BridgeStoneCount = Option::U8 (" Stone Count", {NumOpts(0, 3)}, {bridgeStoneCountDesc}, OptionCategory::Setting, 1, true); - Option BridgeMedallionCount= Option::U8 (" Medallion Count", {NumOpts(0, 6)}, {bridgeMedallionCountDesc}, OptionCategory::Setting, 1, true); - Option BridgeRewardCount = Option::U8 (" Reward Count", {NumOpts(0, 9)}, {bridgeRewardCountDesc}, OptionCategory::Setting, 1, true); - Option BridgeDungeonCount = Option::U8 (" Dungeon Count", {NumOpts(0, 8)}, {bridgeDungeonCountDesc}, OptionCategory::Setting, 1, true); - Option BridgeTokenCount = Option::U8 (" Token Count", {NumOpts(0, 100)}, {bridgeTokenCountDesc}, OptionCategory::Setting, 1, true); + Option Bridge = Option::U8 ("Rainbow Bridge", {"Vanilla", "Always open", "Stones", "Medallions", "Dungeon rewards", "Dungeons", "Tokens"}, {bridgeVanilla, bridgeOpen, bridgeStones, bridgeMedallions, bridgeRewards, bridgeDungeons, bridgeTokens}, OptionCategory::Setting, RAINBOWBRIDGE_VANILLA); + Option BridgeStoneCount = Option::U8 ("Stone Count", {NumOpts(0, 3)}, {bridgeStoneCountDesc}, OptionCategory::Setting, 1, true); + Option BridgeMedallionCount= Option::U8 ("Medallion Count", {NumOpts(0, 6)}, {bridgeMedallionCountDesc}, OptionCategory::Setting, 1, true); + Option BridgeRewardCount = Option::U8 ("Reward Count", {NumOpts(0, 9)}, {bridgeRewardCountDesc}, OptionCategory::Setting, 1, true); + Option BridgeDungeonCount = Option::U8 ("Dungeon Count", {NumOpts(0, 8)}, {bridgeDungeonCountDesc}, OptionCategory::Setting, 1, true); + Option BridgeTokenCount = Option::U8 ("Token Count", {NumOpts(0, 100)}, {bridgeTokenCountDesc}, OptionCategory::Setting, 1, true); Option RandomGanonsTrials = Option::Bool("Random Ganon's Trials", {"Off", "On"}, {randomGanonsTrialsDesc}, OptionCategory::Setting, ON); - Option GanonsTrialsCount = Option::U8 (" Trial Count", {NumOpts(0, 6)}, {ganonsTrialCountDesc}, OptionCategory::Setting, 1, true); + Option GanonsTrialsCount = Option::U8 ("Trial Count", {NumOpts(0, 6)}, {ganonsTrialCountDesc}, OptionCategory::Setting, 1, true); std::vector