Lost Woods Ocarina Game Difficulty Options (#3371)

* Menu options, note speed, unlimited playback time

* Instant win

* Add custom ocarina game cvar to all options and presets

* Extra spaces

* Add starting note count, ending note count by round, more presets

* Block out vanilla code + comments

* finish blocking out vanilla code

* new documentation formatting

* add starting notes to randomizer preset
This commit is contained in:
Eric Hoey 2024-02-01 20:52:10 -05:00 committed by GitHub
parent 7ff46ba1a7
commit be948339b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 119 additions and 18 deletions

View File

@ -186,6 +186,14 @@ const std::vector<const char*> enhancementsCvars = {
"gBombchuBowlingNoSmallCucco", "gBombchuBowlingNoSmallCucco",
"gBombchuBowlingNoBigCucco", "gBombchuBowlingNoBigCucco",
"gBombchuBowlingAmmunition", "gBombchuBowlingAmmunition",
"gCustomizeOcarinaGame",
"gInstantOcarinaGameWin",
"gOcarinaGameNoteSpeed",
"gOcarinaUnlimitedFailTime",
"gOcarinaGameStartingNotes",
"gOcarinaGameRoundOneNotes",
"gOcarinaGameRoundTwoNotes",
"gOcarinaGameRoundThreeNotes",
"gCreditsFix", "gCreditsFix",
"gSilverRupeeJingleExtend", "gSilverRupeeJingleExtend",
"gStaticExplosionRadius", "gStaticExplosionRadius",
@ -787,6 +795,13 @@ const std::vector<PresetEntry> randomizerPresetEntries = {
// Adult Minimum Weight (8 to 13) // Adult Minimum Weight (8 to 13)
PRESET_ENTRY_S32("gAdultMinimumWeightFish", 6), PRESET_ENTRY_S32("gAdultMinimumWeightFish", 6),
// Customize Lost Woods Ocarina Game Behavior
PRESET_ENTRY_S32("gCustomizeOcarinaGame", 1),
// Start With Five Notes
PRESET_ENTRY_S32("gOcarinaGameStartingNotes", 5),
// Round One Notes
PRESET_ENTRY_S32("gOcarinaGameRoundOneNotes", 5),
// Visual Stone of Agony // Visual Stone of Agony
PRESET_ENTRY_S32("gVisualAgony", 1), PRESET_ENTRY_S32("gVisualAgony", 1),
// Pull grave during the day // Pull grave during the day

View File

@ -817,6 +817,40 @@ void DrawEnhancementsMenu() {
UIWidgets::Tooltip("The minimum weight for the unique fishing reward as an adult"); UIWidgets::Tooltip("The minimum weight for the unique fishing reward as an adult");
ImGui::EndMenu(); ImGui::EndMenu();
} }
UIWidgets::Spacer(0);
if (ImGui::BeginMenu("Lost Woods Ocarina Game")) {
UIWidgets::EnhancementCheckbox("Customize Behavior", "gCustomizeOcarinaGame");
UIWidgets::Tooltip("Turn on/off changes to the lost woods ocarina game behavior");
bool disabled = !CVarGetInteger("gCustomizeOcarinaGame", 0);
static const char* disabledTooltip = "This option is disabled because \"Customize Behavior\" is turned off";
UIWidgets::PaddedEnhancementCheckbox("Instant Win", "gInstantOcarinaGameWin", true, false, disabled, disabledTooltip);
UIWidgets::Tooltip("Skips the lost woods ocarina game");
UIWidgets::PaddedEnhancementSliderInt("Note Play Speed: %dx", "##OcarinaGameNoteSpeed", "gOcarinaGameNoteSpeed", 1, 5, "", 1, true, true, false, disabled, disabledTooltip);
UIWidgets::Tooltip("Adjust the speed that the skull kids play notes");
UIWidgets::PaddedEnhancementCheckbox("Unlimited Playback Time", "gOcarinaUnlimitedFailTime", true, false, disabled, disabledTooltip);
UIWidgets::Tooltip("Removes the timer to play back the song");
UIWidgets::PaddedEnhancementSliderInt("Number of Starting Notes: %d", "##OcarinaGameStartingNotes", "gOcarinaGameStartingNotes", 1, 8, "", 3, true, true, false,
disabled, disabledTooltip);
UIWidgets::Tooltip("Adjust the number of notes the skull kids play to start the first round");
int roundMin = CVarGetInteger("gOcarinaGameStartingNotes", 3);
UIWidgets::PaddedEnhancementSliderInt("Round One Notes: %d", "##OcarinaGameRoundOne",
"gOcarinaGameRoundOneNotes", roundMin, 8, "", 5, true, true,
false,
disabled, disabledTooltip);
UIWidgets::Tooltip("Adjust the number of notes you need to play to end the first round");
UIWidgets::PaddedEnhancementSliderInt("Round Two Notes: %d", "##OcarinaGameRoundTwoNotes",
"gOcarinaGameRoundTwoNotes", roundMin, 8, "", 6, true, true,
false,
disabled, disabledTooltip);
UIWidgets::Tooltip("Adjust the number of notes you need to play to end the second round");
UIWidgets::PaddedEnhancementSliderInt("Round Three Notes: %d", "##OcarinaGameRoundThreeNotes",
"gOcarinaGameRoundThreeNotes", roundMin, 8, "", 8, true, true,
false,
disabled, disabledTooltip);
UIWidgets::Tooltip("Adjust the number of notes you need to play to end the third round");
ImGui::EndMenu();
}
UIWidgets::Spacer(0); UIWidgets::Spacer(0);

View File

@ -2065,16 +2065,40 @@ void func_800EE404(void) {
void Audio_OcaMemoryGameStart(u8 minigameRound) { void Audio_OcaMemoryGameStart(u8 minigameRound) {
u8 i; u8 i;
// #region SOH [Enhancement]
if (CVarGetInteger("gCustomizeOcarinaGame", 0)) {
u8 startingNotes = 3;
u8 roundOneCount = CVarGetInteger("gOcarinaGameRoundOneNotes", 5);
u8 roundTwoCount = CVarGetInteger("gOcarinaGameRoundTwoNotes", 6);
u8 roundThreeCount = CVarGetInteger("gOcarinaGameRoundThreeNotes", 8);
u8 modMinigameNoteCnts[] = { roundOneCount, roundTwoCount, roundThreeCount };
if (minigameRound > 2) {
minigameRound = 2;
}
sOcaMinigameAppendPos = 0; startingNotes = CVarGetInteger("gOcarinaGameStartingNotes", 3);
sOcaMinigameEndPos = sOcaMinigameNoteCnts[minigameRound];
for (i = 0; i < 3; i++) { if (minigameRound > 2) {
Audio_OcaMemoryGameGenNote(); minigameRound = 2;
}
sOcaMinigameAppendPos = 0;
sOcaMinigameEndPos = modMinigameNoteCnts[minigameRound];
for (i = 0; i < startingNotes; i++) {
Audio_OcaMemoryGameGenNote();
}
// #endregion
} else {
if (minigameRound > 2) {
minigameRound = 2;
}
sOcaMinigameAppendPos = 0;
sOcaMinigameEndPos = sOcaMinigameNoteCnts[minigameRound];
for (i = 0; i < 3; i++) {
Audio_OcaMemoryGameGenNote();
}
} }
} }
@ -2093,11 +2117,24 @@ s32 Audio_OcaMemoryGameGenNote(void) {
rndNote = sOcarinaNoteValues[(rnd + 1) % 5]; rndNote = sOcarinaNoteValues[(rnd + 1) % 5];
} }
sOcarinaSongs[OCARINA_SONG_MEMORY_GAME][sOcaMinigameAppendPos].noteIdx = rndNote; // #region SOH [Enhancement]
sOcarinaSongs[OCARINA_SONG_MEMORY_GAME][sOcaMinigameAppendPos].unk_02 = 0x2D; if (CVarGetInteger("gCustomizeOcarinaGame", 0)) {
sOcarinaSongs[OCARINA_SONG_MEMORY_GAME][sOcaMinigameAppendPos].volume = 0x50; int noteSpeed = 0x2D;
sOcarinaSongs[OCARINA_SONG_MEMORY_GAME][sOcaMinigameAppendPos].vibrato = 0; noteSpeed = noteSpeed / CVarGetInteger("gOcarinaGameNoteSpeed", 1);
sOcarinaSongs[OCARINA_SONG_MEMORY_GAME][sOcaMinigameAppendPos].tone = 0;
sOcarinaSongs[OCARINA_SONG_MEMORY_GAME][sOcaMinigameAppendPos].noteIdx = rndNote;
sOcarinaSongs[OCARINA_SONG_MEMORY_GAME][sOcaMinigameAppendPos].unk_02 = noteSpeed;
sOcarinaSongs[OCARINA_SONG_MEMORY_GAME][sOcaMinigameAppendPos].volume = 0x50;
sOcarinaSongs[OCARINA_SONG_MEMORY_GAME][sOcaMinigameAppendPos].vibrato = 0;
sOcarinaSongs[OCARINA_SONG_MEMORY_GAME][sOcaMinigameAppendPos].tone = 0;
// #endregion
} else {
sOcarinaSongs[OCARINA_SONG_MEMORY_GAME][sOcaMinigameAppendPos].noteIdx = rndNote;
sOcarinaSongs[OCARINA_SONG_MEMORY_GAME][sOcaMinigameAppendPos].unk_02 = 0x2D;
sOcarinaSongs[OCARINA_SONG_MEMORY_GAME][sOcaMinigameAppendPos].volume = 0x50;
sOcarinaSongs[OCARINA_SONG_MEMORY_GAME][sOcaMinigameAppendPos].vibrato = 0;
sOcarinaSongs[OCARINA_SONG_MEMORY_GAME][sOcaMinigameAppendPos].tone = 0;
}
sOcaMinigameAppendPos++; sOcaMinigameAppendPos++;

View File

@ -1412,12 +1412,20 @@ void EnSkj_StartOcarinaMinigame(EnSkj* this, PlayState* play) {
EnSkj_TurnPlayer(this, player); EnSkj_TurnPlayer(this, player);
if (dialogState == TEXT_STATE_CLOSING) { if (dialogState == TEXT_STATE_CLOSING) {
func_8010BD58(play, OCARINA_ACTION_MEMORY_GAME); // #region SOH [Enhancement]
if (sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid != NULL) { if (CVarGetInteger("gInstantOcarinaGameWin", 0) && CVarGetInteger("gCustomizeOcarinaGame", 0)) {
sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid->minigameState = SKULL_KID_OCARINA_PLAY_NOTES; play->msgCtx.ocarinaMode = OCARINA_MODE_0F;
this->songFailTimer = 160;
this->actionFunc = EnSkj_WaitForPlayback;
// #endregion
} else {
func_8010BD58(play, OCARINA_ACTION_MEMORY_GAME);
if (sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid != NULL) {
sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid->minigameState = SKULL_KID_OCARINA_PLAY_NOTES;
this->songFailTimer = 160;
this->actionFunc = EnSkj_WaitForPlayback;
}
} }
this->songFailTimer = 160;
this->actionFunc = EnSkj_WaitForPlayback;
} }
} }
@ -1466,7 +1474,14 @@ void EnSkj_WaitForPlayback(EnSkj* this, PlayState* play) {
break; break;
case MSGMODE_MEMORY_GAME_PLAYER_PLAYING: case MSGMODE_MEMORY_GAME_PLAYER_PLAYING:
if (this->songFailTimer != 0) { if (this->songFailTimer != 0) {
this->songFailTimer--; // #region SOH [Enhancement]
if (CVarGetInteger("gOcarinaUnlimitedFailTime", 0) == 1 &&
CVarGetInteger("gCustomizeOcarinaGame", 0) == 1) {
// don't decrement timer
// #endregion
} else {
this->songFailTimer--;
}
} else { // took too long, game failed } else { // took too long, game failed
func_80078884(NA_SE_SY_OCARINA_ERROR); func_80078884(NA_SE_SY_OCARINA_ERROR);
Message_CloseTextbox(play); Message_CloseTextbox(play);