diff options
| author | Patrick12115 <115201185+Patrick12115@users.noreply.github.com> | 2023-05-30 14:25:59 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-30 14:25:59 -0400 |
| commit | f544aba6477f8af129f11ca002cceed9a286c6de (patch) | |
| tree | 7344b80b87d5663abfd05f2c2d40c45d40d1890b /soh/src/code | |
| parent | 507387f618752ed2a1e7cc665d3a1cd0c7e09c8f (diff) | |
[Rando] Adds Greg options to the Bridge and LACS reward options (#2663)
* Some reason not working
* Fixes and formatting
Moved the LACS Stones to be before the Medallions in all instances to line up with the Bridge requirements and because it just makes sense
* Removed unnecessary space
* Missed one
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/z_play.c | 48 |
1 files changed, 42 insertions, 6 deletions
diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index ead1574f7..a3d275390 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -338,29 +338,65 @@ u8 CheckDungeonCount() { return dungeonCount; } +u8 CheckBridgeRewardCount() { + u8 bridgeRewardCount = 0; + + switch (Randomizer_GetSettingValue(RSK_BRIDGE_OPTIONS)) { + case RO_BRIDGE_WILDCARD_REWARD: + if (Flags_GetRandomizerInf(RAND_INF_GREG_FOUND)) { + bridgeRewardCount += 1; + } + break; + case RO_BRIDGE_GREG_REWARD: + if (Flags_GetRandomizerInf(RAND_INF_GREG_FOUND)) { + bridgeRewardCount += 1; + } + break; + } + return bridgeRewardCount; +} + +u8 CheckLACSRewardCount() { + u8 lacsRewardCount = 0; + + switch (Randomizer_GetSettingValue(RSK_LACS_OPTIONS)) { + case RO_LACS_WILDCARD_REWARD: + if (Flags_GetRandomizerInf(RAND_INF_GREG_FOUND)) { + lacsRewardCount += 1; + } + break; + case RO_LACS_GREG_REWARD: + if (Flags_GetRandomizerInf(RAND_INF_GREG_FOUND)) { + lacsRewardCount += 1; + } + break; + } + return lacsRewardCount; +} + void GivePlayerRandoRewardZeldaLightArrowsGift(PlayState* play, RandomizerCheck check) { Player* player = GET_PLAYER(play); u8 meetsRequirements = 0; switch (Randomizer_GetSettingValue(RSK_GANONS_BOSS_KEY)) { - case RO_GANON_BOSS_KEY_LACS_MEDALLIONS: - if (CheckMedallionCount() >= Randomizer_GetSettingValue(RSK_LACS_MEDALLION_COUNT)) { + case RO_GANON_BOSS_KEY_LACS_STONES: + if ((CheckStoneCount() + CheckLACSRewardCount()) >= Randomizer_GetSettingValue(RSK_LACS_STONE_COUNT)) { meetsRequirements = true; } break; - case RO_GANON_BOSS_KEY_LACS_STONES: - if (CheckStoneCount() >= Randomizer_GetSettingValue(RSK_LACS_STONE_COUNT)) { + case RO_GANON_BOSS_KEY_LACS_MEDALLIONS: + if ((CheckMedallionCount() + CheckLACSRewardCount()) >= Randomizer_GetSettingValue(RSK_LACS_MEDALLION_COUNT)) { meetsRequirements = true; } break; case RO_GANON_BOSS_KEY_LACS_REWARDS: - if ((CheckMedallionCount() + CheckStoneCount()) >= Randomizer_GetSettingValue(RSK_LACS_REWARD_COUNT)) { + if ((CheckMedallionCount() + CheckStoneCount() + CheckLACSRewardCount()) >= Randomizer_GetSettingValue(RSK_LACS_REWARD_COUNT)) { meetsRequirements = true; } break; case RO_GANON_BOSS_KEY_LACS_DUNGEONS: - if (CheckDungeonCount() >= Randomizer_GetSettingValue(RSK_LACS_DUNGEON_COUNT)) { + if ((CheckDungeonCount() + CheckLACSRewardCount()) >= Randomizer_GetSettingValue(RSK_LACS_DUNGEON_COUNT)) { meetsRequirements = true; } break; |
