Skip to content

Commit

Permalink
Break up shuffle pot options to dungeon/overworld/all
Browse files Browse the repository at this point in the history
  • Loading branch information
aMannus committed Jan 5, 2024
1 parent 76c2c5c commit 8c78154
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 7 deletions.
27 changes: 25 additions & 2 deletions soh/soh/Enhancements/randomizer/3drando/item_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,8 +751,31 @@ void GenerateItemPool() {
PlaceVanillaCowMilk();
}

if (ctx->GetOption(RSK_SHUFFLE_POTS)) {
AddItemToMainPool(RG_GREEN_RUPEE);
// Shuffle Pots
if (ctx->GetOption(RSK_SHUFFLE_POTS).Is(RO_SHUFFLE_POTS_OFF)) {
for (RandomizerCheck loc : ctx->GetLocations(ctx->allLocations, Category::cPot)) {
ctx->PlaceItemInLocation(loc, RG_GREEN_RUPEE, false, true);
}
} else if (ctx->GetOption(RSK_SHUFFLE_POTS).Is(RO_SHUFFLE_POTS_DUNGEONS)) {
for (RandomizerCheck loc : ctx->GetLocations(ctx->allLocations, Category::cPot)) {
if (Rando::StaticData::GetLocation(loc)->IsOverworld()) {
ctx->PlaceItemInLocation((RandomizerCheck)loc, RG_GREEN_RUPEE, false, true);
} else {
AddItemToMainPool(RG_GREEN_RUPEE);
}
}
} else if (ctx->GetOption(RSK_SHUFFLE_POTS).Is(RO_SHUFFLE_POTS_OVERWORLD)) {
for (RandomizerCheck loc : ctx->GetLocations(ctx->allLocations, Category::cPot)) {
if (Rando::StaticData::GetLocation(loc)->IsDungeon()) {
ctx->PlaceItemInLocation((RandomizerCheck)loc, RG_GREEN_RUPEE, false, true);
} else {
AddItemToMainPool(RG_GREEN_RUPEE);
}
}
} else {
for (RandomizerCheck loc : ctx->GetLocations(ctx->allLocations, Category::cPot)) {
AddItemToMainPool(RG_GREEN_RUPEE);
}
}

if (ctx->GetOption(RSK_SHUFFLE_MAGIC_BEANS)) {
Expand Down
12 changes: 10 additions & 2 deletions soh/soh/Enhancements/randomizer/option_descriptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,16 @@ void Settings::CreateOptionDescriptions() {
"\n"
"The Gerudo Card is required to enter the Gerudo Training Grounds, opening "
"the gate to Haunted Wasteland and the Horseback Archery minigame.";
mOptionDescriptions[RSK_SHUFFLE_POTS] =
"Freestanding pots will drop a randomized item the first time they're broken and collected. Pots will have a different appearance when they hold a randomized item.";
mOptionDescriptions[RSK_SHUFFLE_POTS] = "Freestanding pots will drop a randomized item the first time they're broken and collected."
" Pots will have a different appearance when they hold a randomized item.\n"
"\n"
"Off - Pots will not be shuffled.\n"
"\n"
"Dungeons - Only shuffle pots that are within dungeons.\n"
"\n"
"Overworld - Only shuffle pots that are outside of dungeons.\n"
"\n"
"All pots - Shuffle all pots.";
mOptionDescriptions[RSK_SHOPSANITY] = "Off - All shop items will be the same as vanilla.\n"
"\n"
"0 Items - Vanilla shop items will be shuffled among different shops.\n"
Expand Down
8 changes: 8 additions & 0 deletions soh/soh/Enhancements/randomizer/randomizerTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -4968,6 +4968,14 @@ typedef enum {
RO_TOKENSANITY_ALL,
} RandoOptionTokensanity;

// Shuffle Pots settings (off, dungeons, overworld, all)
typedef enum {
RO_SHUFFLE_POTS_OFF,
RO_SHUFFLE_POTS_DUNGEONS,
RO_SHUFFLE_POTS_OVERWORLD,
RO_SHUFFLE_POTS_ALL,
} RandoOptionShufflePots;

//Link's Pocket Settings (dungeon reward, advancement, anything, nothing)
typedef enum {
RO_LINKS_POCKET_DUNGEON_REWARD,
Expand Down
4 changes: 2 additions & 2 deletions soh/soh/Enhancements/randomizer/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void Settings::CreateOptions() {
mOptions[RSK_SHUFFLE_OCARINA_BUTTONS] = Option::Bool("Shuffle Ocarina Buttons", "gRandomizeShuffleOcarinaButtons", mOptionDescriptions[RSK_SHUFFLE_OCARINA_BUTTONS]);
mOptions[RSK_SHUFFLE_WEIRD_EGG] = Option::Bool("Shuffle Weird Egg", "gRandomizeShuffleWeirdEgg", mOptionDescriptions[RSK_SHUFFLE_WEIRD_EGG]);
mOptions[RSK_SHUFFLE_GERUDO_MEMBERSHIP_CARD] = Option::Bool("Shuffle Gerudo Membership Card", "gRandomizeShuffleGerudoToken", mOptionDescriptions[RSK_SHUFFLE_GERUDO_MEMBERSHIP_CARD]);
mOptions[RSK_SHUFFLE_POTS] = Option::Bool("Shuffle Pot Contents", "gRandomizeShufflePotContents", mOptionDescriptions[RSK_SHUFFLE_POTS]);
mOptions[RSK_SHUFFLE_POTS] = Option::U8("Shuffle Pots", {"Off", "Dungeons", "Overworld", "All Pots"}, OptionCategory::Setting, "gRandomizeShufflePots", mOptionDescriptions[RSK_SHUFFLE_POTS], WidgetType::Combobox, RO_SHUFFLE_POTS_OFF);
mOptions[RSK_SHUFFLE_MAGIC_BEANS] = Option::Bool("Shuffle Magic Beans", "gRandomizeShuffleBeans", mOptionDescriptions[RSK_SHUFFLE_MAGIC_BEANS]);
mOptions[RSK_SHUFFLE_MERCHANTS] = Option::U8("Shuffle Merchants", {"Off", "On (No Hints)", "On (With Hints)"}, OptionCategory::Setting, "gRandomizeShuffleMerchants", mOptionDescriptions[RSK_SHUFFLE_MERCHANTS], WidgetType::Combobox, RO_SHUFFLE_MERCHANTS_OFF);
mOptions[RSK_SHUFFLE_FROG_SONG_RUPEES] = Option::Bool("Shuffle Frog Song Rupees", "gRandomizeShuffleFrogSongRupees", mOptionDescriptions[RSK_SHUFFLE_FROG_SONG_RUPEES]);
Expand Down Expand Up @@ -1022,7 +1022,7 @@ void Settings::CreateOptions() {
{ "Shuffle Settings:Link's Pocket", RSK_LINKS_POCKET },
{ "Shuffle Settings:Shuffle Songs", RSK_SHUFFLE_SONGS },
{ "Shuffle Settings:Shuffle Gerudo Membership Card", RSK_SHUFFLE_GERUDO_MEMBERSHIP_CARD },
{ "Shuffle Settings:Shuffle Pot Contents", RSK_SHUFFLE_POTS },
{ "Shuffle Settings:Shuffle Pots", RSK_SHUFFLE_POTS },
{ "Shuffle Settings:Shopsanity", RSK_SHOPSANITY },
{ "Shuffle Settings:Shopsanity Prices", RSK_SHOPSANITY_PRICES },
{ "Shuffle Settings:Affordable Prices", RSK_SHOPSANITY_PRICES_AFFORDABLE },
Expand Down
2 changes: 1 addition & 1 deletion soh/src/overlays/actors/ovl_player_actor/z_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -6666,7 +6666,7 @@ s32 func_8083E5A8(Player* this, PlayState* play) {
// this specifically for items coming from bushes/rocks/enemies when the player has already picked that item up.
uint8_t skipItemCutsceneRando = IS_RANDO && Item_CheckObtainability(giEntry.itemId) != ITEM_NONE && isDropToSkip;

// Automatically skip the pickup messages for very frequent items coming from pots with "Shuffle Pot Contents" on.
// Automatically skip the pickup messages for very frequent items coming from pots with "Shuffle Pots" on.
uint8_t isPotItemToSkip = interactedActor->id == ACTOR_EN_ITEM00 &&
interactedActor->params == ITEM00_SMALL_KEY &&
(giEntry.itemId == ITEM_RUPEE_GREEN || giEntry.itemId == ITEM_RUPEE_BLUE ||
Expand Down

0 comments on commit 8c78154

Please sign in to comment.