use enum for shuffle scrubs (#2089)

Co-authored-by: briaguya <briaguya@alice>
This commit is contained in:
briaguya 2022-12-06 01:00:12 -05:00 committed by GitHub
parent ca4875befc
commit 541d1d35a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 5 deletions

View File

@ -613,7 +613,7 @@ const std::vector<PresetEntry> hellModePresetEntries = {
PRESET_ENTRY_S32("gRandomizeShuffleKeyRings", 1),
PRESET_ENTRY_S32("gRandomizeShuffleKokiriSword", 1),
PRESET_ENTRY_S32("gRandomizeShuffleOcarinas", 1),
PRESET_ENTRY_S32("gRandomizeShuffleScrubs", 3),
PRESET_ENTRY_S32("gRandomizeShuffleScrubs", RO_SCRUBS_RANDOM),
PRESET_ENTRY_S32("gRandomizeShuffleSongs", RO_SONG_SHUFFLE_ANYWHERE),
PRESET_ENTRY_S32("gRandomizeShuffleTokens", RO_TOKENSANITY_ALL),
PRESET_ENTRY_S32("gRandomizeShuffleWeirdEgg", 1),

View File

@ -2440,7 +2440,7 @@ ScrubIdentity Randomizer::IdentifyScrub(s32 sceneNum, s32 actorParams, s32 respa
scrubIdentity.randomizerInf = rcToRandomizerInf[rcObject.rc];
scrubIdentity.randomizerCheck = rcObject.rc;
scrubIdentity.getItemId = rcObject.ogItemId;
scrubIdentity.isShuffled = GetRandoSettingValue(RSK_SHUFFLE_SCRUBS) > 0;
scrubIdentity.isShuffled = GetRandoSettingValue(RSK_SHUFFLE_SCRUBS) != RO_SCRUBS_OFF;
if (rcObject.rc == RC_HF_DEKU_SCRUB_GROTTO || rcObject.rc == RC_LW_DEKU_SCRUB_GROTTO_FRONT || rcObject.rc == RC_LW_DEKU_SCRUB_NEAR_BRIDGE) {
scrubIdentity.isShuffled = true;
@ -2594,7 +2594,7 @@ void GenerateRandomizerImgui() {
cvarSettings[RSK_SHUFFLE_SONGS] = CVar_GetS32("gRandomizeShuffleSongs", RO_SONG_SHUFFLE_SONG_LOCATIONS);
cvarSettings[RSK_SHUFFLE_TOKENS] = CVar_GetS32("gRandomizeShuffleTokens", RO_TOKENSANITY_OFF);
cvarSettings[RSK_SHOPSANITY] = CVar_GetS32("gRandomizeShopsanity", RO_SHOPSANITY_OFF);
cvarSettings[RSK_SHUFFLE_SCRUBS] = CVar_GetS32("gRandomizeShuffleScrubs", 0);
cvarSettings[RSK_SHUFFLE_SCRUBS] = CVar_GetS32("gRandomizeShuffleScrubs", RO_SCRUBS_OFF);
cvarSettings[RSK_SHUFFLE_COWS] = CVar_GetS32("gRandomizeShuffleCows", 0);
cvarSettings[RSK_SHUFFLE_ADULT_TRADE] = CVar_GetS32("gRandomizeShuffleAdultTrade", 0);
cvarSettings[RSK_SHUFFLE_MAGIC_BEANS] = CVar_GetS32("gRandomizeShuffleBeans", 0);

View File

@ -105,7 +105,7 @@ void SaveManager::LoadRandomizerVersion1() {
randomizer->LoadRandomizerSettings("");
size_t merchantPricesSize = 0;
if (randomizer->GetRandoSettingValue(RSK_SHUFFLE_SCRUBS) > 0) {
if (randomizer->GetRandoSettingValue(RSK_SHUFFLE_SCRUBS) != RO_SCRUBS_OFF) {
merchantPricesSize += NUM_SCRUBS;
}
if (randomizer->GetRandoSettingValue(RSK_SHOPSANITY) != RO_SHOPSANITY_OFF) {

View File

@ -172,7 +172,9 @@ void EnDns_Init(Actor* thisx, PlayState* play) {
s16 respawnData = gSaveContext.respawn[RESPAWN_MODE_RETURN].data & ((1 << 8) - 1);
this->scrubIdentity = Randomizer_IdentifyScrub(play->sceneNum, this->actor.params, respawnData);
if ((Randomizer_GetSettingValue(RSK_SHUFFLE_SCRUBS) == 1 || Randomizer_GetSettingValue(RSK_SHUFFLE_SCRUBS) == 3) && this->scrubIdentity.itemPrice != -1) {
if ((Randomizer_GetSettingValue(RSK_SHUFFLE_SCRUBS) == RO_SCRUBS_AFFORDABLE ||
Randomizer_GetSettingValue(RSK_SHUFFLE_SCRUBS) == RO_SCRUBS_RANDOM) &&
this->scrubIdentity.itemPrice != -1) {
this->dnsItemEntry->itemPrice = this->scrubIdentity.itemPrice;
}