summaryrefslogtreecommitdiff
path: root/soh/src
diff options
context:
space:
mode:
authorPatrick12115 <115201185+Patrick12115@users.noreply.github.com>2023-05-30 14:25:59 -0400
committerGitHub <noreply@github.com>2023-05-30 14:25:59 -0400
commitf544aba6477f8af129f11ca002cceed9a286c6de (patch)
tree7344b80b87d5663abfd05f2c2d40c45d40d1890b /soh/src
parent507387f618752ed2a1e7cc665d3a1cd0c7e09c8f (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')
-rw-r--r--soh/src/code/z_play.c48
-rw-r--r--soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c8
2 files changed, 46 insertions, 10 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;
diff --git a/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c b/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c
index 3d9649d79..1865b6a30 100644
--- a/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c
+++ b/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c
@@ -106,25 +106,25 @@ void BgGjyoBridge_TriggerCutscene(BgGjyoBridge* this, PlayState* play) {
}
break;
case RO_BRIDGE_STONES:
- if (CheckStoneCount() >= bridgeStoneCount) {
+ if ((CheckStoneCount() + CheckBridgeRewardCount()) >= bridgeStoneCount) {
this->actionFunc = BgGjyoBridge_SpawnBridge;
func_800F595C(NA_BGM_BRIDGE_TO_GANONS);
}
break;
case RO_BRIDGE_MEDALLIONS:
- if (CheckMedallionCount() >= bridgeMedallionCount) {
+ if ((CheckMedallionCount() + CheckBridgeRewardCount()) >= bridgeMedallionCount) {
this->actionFunc = BgGjyoBridge_SpawnBridge;
func_800F595C(NA_BGM_BRIDGE_TO_GANONS);
}
break;
case RO_BRIDGE_DUNGEON_REWARDS:
- if ((CheckMedallionCount() + CheckStoneCount()) >= bridgeRewardCount) {
+ if ((CheckMedallionCount() + CheckStoneCount() + CheckBridgeRewardCount()) >= bridgeRewardCount) {
this->actionFunc = BgGjyoBridge_SpawnBridge;
func_800F595C(NA_BGM_BRIDGE_TO_GANONS);
}
break;
case RO_BRIDGE_DUNGEONS:
- if (CheckDungeonCount() >= bridgeDungeonCount) {
+ if ((CheckDungeonCount() + CheckBridgeRewardCount()) >= bridgeDungeonCount) {
this->actionFunc = BgGjyoBridge_SpawnBridge;
func_800F595C(NA_BGM_BRIDGE_TO_GANONS);
}