This commit is contained in:
Eric Hoey 2024-04-10 22:35:53 +00:00 committed by GitHub
commit ed0679ddf5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 66 additions and 8 deletions

View File

@ -200,6 +200,10 @@ const std::vector<const char*> enhancementsCvars = {
"gOcarinaGameRoundOneNotes",
"gOcarinaGameRoundTwoNotes",
"gOcarinaGameRoundThreeNotes",
"gCustomizeFrogsOcarinaGame",
"gInstantFrogsGameWin",
"gFrogsUnlimitedFailTime",
"gFrogsModifyFailTime",
"gCreditsFix",
"gSilverRupeeJingleExtend",
"gStaticExplosionRadius",

View File

@ -898,6 +898,32 @@ void DrawEnhancementsMenu() {
UIWidgets::Spacer(0);
if (ImGui::BeginMenu("Frogs Ocarina Game")) {
UIWidgets::EnhancementCheckbox("Customize Behavior", "gCustomizeFrogsOcarinaGame");
UIWidgets::Tooltip("Turn on/off changes to the frogs ocarina game behavior");
bool disabled = !CVarGetInteger("gCustomizeFrogsOcarinaGame", 0);
static const char* disabledTooltip =
"This option is disabled because \"Customize Behavior\" is turned off";
UIWidgets::PaddedEnhancementCheckbox("Instant Win", "gInstantFrogsGameWin", true, false, disabled, disabledTooltip);
UIWidgets::Tooltip("Skips the frogs ocarina game");
UIWidgets::PaddedEnhancementCheckbox("Unlimited Playback Time", "gFrogsUnlimitedFailTime", true, false, disabled, disabledTooltip);
UIWidgets::Tooltip("Removes the timer to play back the song");
bool disabledFrog = 0;
static const char* disabledFrogTooltip =
"This option is disabled because \"Customize Behavior\" is turned off or \"Unlimited Playback Time\" is on";
if (CVarGetInteger("gCustomizeFrogsOcarinaGame", 0) == 0 || CVarGetInteger("gFrogsUnlimitedFailTime", 0) == 1) {
disabledFrog = 1;
} else {
disabledFrog = 0;
}
UIWidgets::PaddedEnhancementSliderInt("Modify note timer: %dx", "##FrogsFailTimer", "gFrogsModifyFailTime", 1, 5, "", 1, true, true, false,
disabledFrog, disabledFrogTooltip);
UIWidgets::Tooltip("Adjusts the time allowed for playback before failing");
ImGui::EndMenu();
}
UIWidgets::Spacer(0);
UIWidgets::PaddedEnhancementCheckbox("Delete File On Death", "gDeleteFileOnDeath", true, false);
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.0f, 0.0f, 1.0f));
UIWidgets::Tooltip("Dying will delete your file\n\n " ICON_FA_EXCLAMATION_TRIANGLE " WARNING " ICON_FA_EXCLAMATION_TRIANGLE "\nTHIS IS NOT REVERSABLE\nUSE AT YOUR OWN RISK!");

View File

@ -819,12 +819,28 @@ void EnFr_SetupFrogSong(EnFr* this, PlayState* play) {
if (this->frogSongTimer != 0) {
this->frogSongTimer--;
} else {
this->frogSongTimer = 40;
this->ocarinaNoteIndex = 0;
func_8010BD58(play, OCARINA_ACTION_FROGS);
this->ocarinaNote = EnFr_GetNextNoteFrogSong(this->ocarinaNoteIndex);
EnFr_CheckOcarinaInputFrogSong(this->ocarinaNote);
this->actionFunc = EnFr_ContinueFrogSong;
// #region SOH [Enhancement]
if (CVarGetInteger("gCustomizeFrogsOcarinaGame", 0) == 1) {
this->frogSongTimer = 40 * CVarGetInteger("gFrogsModifyFailTime", 1);
if (CVarGetInteger("gInstantFrogsGameWin", 0) == 1) {
this->actor.textId = 0x40AC;
EnFr_SetupReward(this, play, false);
} else {
this->ocarinaNoteIndex = 0;
func_8010BD58(play, OCARINA_ACTION_FROGS);
this->ocarinaNote = EnFr_GetNextNoteFrogSong(this->ocarinaNoteIndex);
EnFr_CheckOcarinaInputFrogSong(this->ocarinaNote);
this->actionFunc = EnFr_ContinueFrogSong;
}
// #endregion
} else {
this->frogSongTimer = 40;
this->ocarinaNoteIndex = 0;
func_8010BD58(play, OCARINA_ACTION_FROGS);
this->ocarinaNote = EnFr_GetNextNoteFrogSong(this->ocarinaNoteIndex);
EnFr_CheckOcarinaInputFrogSong(this->ocarinaNote);
this->actionFunc = EnFr_ContinueFrogSong;
}
}
}
@ -846,7 +862,13 @@ s32 EnFr_IsFrogSongComplete(EnFr* this, PlayState* play) {
ocarinaNote = EnFr_GetNextNoteFrogSong(ocarinaNoteIndex);
this->ocarinaNote = ocarinaNote;
EnFr_CheckOcarinaInputFrogSong(ocarinaNote);
this->frogSongTimer = sTimerFrogSong[index];
// #region SOH [Enhancement]
if (CVarGetInteger("gCustomizeFrogsOcarinaGame", 0)) {
this->frogSongTimer = sTimerFrogSong[index] * CVarGetInteger("gFrogsModifyFailTime", 1);
// #endregion
} else {
this->frogSongTimer = sTimerFrogSong[index];
}
}
return false;
}
@ -870,7 +892,13 @@ void EnFr_ContinueFrogSong(EnFr* this, PlayState* play) {
if (this->frogSongTimer == 0) {
EnFr_OcarinaMistake(this, play);
} else {
this->frogSongTimer--;
// #region SOH [Enhancement]
if (CVarGetInteger("gCustomizeFrogsOcarinaGame", 0) == 1 && CVarGetInteger("gFrogsUnlimitedFailTime", 0) == 1) {
// Don't decrement timer
// #endregion
} else {
this->frogSongTimer--;
}
if (play->msgCtx.msgMode == MSGMODE_FROGS_PLAYING) {
counter = 0;
for (i = 0; i < ARRAY_COUNT(sEnFrPointers.frogs); i++) {