Skip to content

Commit

Permalink
[Enhancement] Receive oceanside spider house wallet reward on any day
Browse files Browse the repository at this point in the history
  • Loading branch information
lscholte committed Nov 16, 2024
1 parent 5a73539 commit 0e11640
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 27 deletions.
5 changes: 5 additions & 0 deletions mm/2s2h/BenGui/BenMenuBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,11 @@ void DrawEnhancementsMenu() {
"swords. It may still steal other items." })) {
RegisterDisableTakkuriSteal();
}

UIWidgets::CVarCheckbox(
"Receive Oceanside Spider House Wallet Reward Any Day", "gEnhancements.Cheats.OceansideWalletAnyDay",
{ .tooltip = "The wallet reward for clearing the oceanside spider house can be received on any day." });

ImGui::EndMenu();
}

Expand Down
5 changes: 4 additions & 1 deletion mm/2s2h/BenGui/SearchableMenuItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,10 @@ void AddEnhancements() {
"Prevents the Takkuri from stealing key items like bottles and swords. It may still steal other items.",
WIDGET_CVAR_CHECKBOX,
{},
[](widgetInfo& info) { RegisterDisableTakkuriSteal(); } } } } });
[](widgetInfo& info) { RegisterDisableTakkuriSteal(); } },
{ "Receive Oceanside Spider House Wallet Reward Any Day", "gEnhancements.Cheats.OceansideWalletAnyDay",
"The wallet reward for clearing the oceanside spider house can be received on any day.",
WIDGET_CVAR_CHECKBOX } } } });
enhancementsSidebar.push_back({ "HUD Editor",
1,
{ // HUD Editor
Expand Down
47 changes: 21 additions & 26 deletions mm/src/overlays/actors/ovl_En_Sth/z_en_sth.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,34 +369,29 @@ void EnSth_HandleOceansideSpiderHouseConversation(EnSth* this, PlayState* play)
// This flag prevents multiple rewards, switching to secondary dialogue after
SET_WEEKEVENTREG(WEEKEVENTREG_OCEANSIDE_SPIDER_HOUSE_COLLECTED_REWARD);

switch (day) {
case 0: // first day
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_OCEANSIDE_WALLET_UPGRADE)) {
STH_GI_ID(&this->actor) = GI_RUPEE_SILVER;
} else {
// This flag prevents getting two wallets from the same place.
// Instead, getting silver rupee above.
SET_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_OCEANSIDE_WALLET_UPGRADE);
switch (CUR_UPG_VALUE(UPG_WALLET)) {
case 0:
STH_GI_ID(&this->actor) = GI_WALLET_ADULT;
break;

case 1:
STH_GI_ID(&this->actor) = GI_WALLET_GIANT;
break;
}
if (day == 0 || CVarGetInteger("gEnhancements.Cheats.OceansideWalletAnyDay", 0)) {
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_OCEANSIDE_WALLET_UPGRADE)) {
STH_GI_ID(&this->actor) = GI_RUPEE_SILVER;
} else {
// This flag prevents getting two wallets from the same place.
// Instead, getting silver rupee above.
SET_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_OCEANSIDE_WALLET_UPGRADE);
switch (CUR_UPG_VALUE(UPG_WALLET)) {
case 0:
STH_GI_ID(&this->actor) = GI_WALLET_ADULT;
break;

case 1:
STH_GI_ID(&this->actor) = GI_WALLET_GIANT;
break;
}
break;

case 1: // second day
STH_GI_ID(&this->actor) = GI_RUPEE_PURPLE;
break;

default: // final day
STH_GI_ID(&this->actor) = GI_RUPEE_RED;
break;
}
} else if (day == 1) {
STH_GI_ID(&this->actor) = GI_RUPEE_PURPLE;
} else {
STH_GI_ID(&this->actor) = GI_RUPEE_RED;
}

Message_CloseTextbox(play);
this->actionFunc = EnSth_GiveOceansideSpiderHouseReward;
EnSth_GiveOceansideSpiderHouseReward(this, play);
Expand Down

0 comments on commit 0e11640

Please sign in to comment.