enums for rainbow bridge (#2052)

* enums for rainbow bridge

* reorder enum

Co-authored-by: briaguya <briaguya@alice>
This commit is contained in:
briaguya 2022-11-29 23:41:46 -05:00 committed by GitHub
parent 00a862a252
commit e193f0dc0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 21 deletions

View File

@ -561,7 +561,7 @@ const std::vector<PresetEntry> s6PresetEntries = {
PRESET_ENTRY_S32("gRandomizeKakarikoGate", RO_KAK_GATE_OPEN), PRESET_ENTRY_S32("gRandomizeKakarikoGate", RO_KAK_GATE_OPEN),
PRESET_ENTRY_S32("gRandomizeMedallionCount", 6), PRESET_ENTRY_S32("gRandomizeMedallionCount", 6),
PRESET_ENTRY_S32("gRandomizeMqDungeons", 0), PRESET_ENTRY_S32("gRandomizeMqDungeons", 0),
PRESET_ENTRY_S32("gRandomizeRainbowBridge", 3), PRESET_ENTRY_S32("gRandomizeRainbowBridge", RO_BRIDGE_MEDALLIONS),
PRESET_ENTRY_S32("gRandomizeShuffleAdultTrade", 1), PRESET_ENTRY_S32("gRandomizeShuffleAdultTrade", 1),
PRESET_ENTRY_S32("gRandomizeShuffleDungeonReward", RO_DUNGEON_REWARDS_END_OF_DUNGEON), PRESET_ENTRY_S32("gRandomizeShuffleDungeonReward", RO_DUNGEON_REWARDS_END_OF_DUNGEON),
PRESET_ENTRY_S32("gRandomizeShuffleGanonBossKey", RO_GANON_BOSS_KEY_STARTWITH), PRESET_ENTRY_S32("gRandomizeShuffleGanonBossKey", RO_GANON_BOSS_KEY_STARTWITH),
@ -601,7 +601,7 @@ const std::vector<PresetEntry> hellModePresetEntries = {
PRESET_ENTRY_S32("gRandomizeKeysanity", RO_DUNGEON_ITEM_LOC_ANYWHERE), PRESET_ENTRY_S32("gRandomizeKeysanity", RO_DUNGEON_ITEM_LOC_ANYWHERE),
PRESET_ENTRY_S32("gRandomizeLinksPocket", RO_LINKS_POCKET_NOTHING), PRESET_ENTRY_S32("gRandomizeLinksPocket", RO_LINKS_POCKET_NOTHING),
PRESET_ENTRY_S32("gRandomizeMqDungeons", 2), PRESET_ENTRY_S32("gRandomizeMqDungeons", 2),
PRESET_ENTRY_S32("gRandomizeRainbowBridge", 4), PRESET_ENTRY_S32("gRandomizeRainbowBridge", RO_BRIDGE_DUNGEON_REWARDS),
PRESET_ENTRY_S32("gRandomizeShopsanity", 5), PRESET_ENTRY_S32("gRandomizeShopsanity", 5),
PRESET_ENTRY_S32("gRandomizeShuffleAdultTrade", 1), PRESET_ENTRY_S32("gRandomizeShuffleAdultTrade", 1),
PRESET_ENTRY_S32("gRandomizeShuffleBeans", 1), PRESET_ENTRY_S32("gRandomizeShuffleBeans", 1),

View File

@ -2568,7 +2568,7 @@ void GenerateRandomizerImgui() {
cvarSettings[RSK_ZORAS_FOUNTAIN] = CVar_GetS32("gRandomizeZorasFountain", 0); cvarSettings[RSK_ZORAS_FOUNTAIN] = CVar_GetS32("gRandomizeZorasFountain", 0);
cvarSettings[RSK_STARTING_AGE] = CVar_GetS32("gRandomizeStartingAge", 0); cvarSettings[RSK_STARTING_AGE] = CVar_GetS32("gRandomizeStartingAge", 0);
cvarSettings[RSK_GERUDO_FORTRESS] = CVar_GetS32("gRandomizeGerudoFortress", RO_GF_NORMAL); cvarSettings[RSK_GERUDO_FORTRESS] = CVar_GetS32("gRandomizeGerudoFortress", RO_GF_NORMAL);
cvarSettings[RSK_RAINBOW_BRIDGE] = CVar_GetS32("gRandomizeRainbowBridge", 0); cvarSettings[RSK_RAINBOW_BRIDGE] = CVar_GetS32("gRandomizeRainbowBridge", RO_BRIDGE_VANILLA);
cvarSettings[RSK_RAINBOW_BRIDGE_STONE_COUNT] = CVar_GetS32("gRandomizeStoneCount", 3); cvarSettings[RSK_RAINBOW_BRIDGE_STONE_COUNT] = CVar_GetS32("gRandomizeStoneCount", 3);
cvarSettings[RSK_RAINBOW_BRIDGE_MEDALLION_COUNT] = CVar_GetS32("gRandomizeMedallionCount", 6); cvarSettings[RSK_RAINBOW_BRIDGE_MEDALLION_COUNT] = CVar_GetS32("gRandomizeMedallionCount", 6);
cvarSettings[RSK_RAINBOW_BRIDGE_REWARD_COUNT] = CVar_GetS32("gRandomizeRewardCount", 9); cvarSettings[RSK_RAINBOW_BRIDGE_REWARD_COUNT] = CVar_GetS32("gRandomizeRewardCount", 9);
@ -2960,32 +2960,32 @@ void DrawRandoEditor(bool& open) {
UIWidgets::EnhancementCombobox("gRandomizeRainbowBridge", randoRainbowBridge, 7, RO_BRIDGE_VANILLA); UIWidgets::EnhancementCombobox("gRandomizeRainbowBridge", randoRainbowBridge, 7, RO_BRIDGE_VANILLA);
ImGui::PopItemWidth(); ImGui::PopItemWidth();
switch (CVar_GetS32("gRandomizeRainbowBridge", 0)) { switch (CVar_GetS32("gRandomizeRainbowBridge", RO_BRIDGE_VANILLA)) {
case 0: case RO_BRIDGE_ALWAYS_OPEN:
break; break;
case 1: case RO_BRIDGE_VANILLA:
break; break;
case 2: case RO_BRIDGE_STONES:
ImGui::Dummy(ImVec2(0.0f, 0.0f)); ImGui::Dummy(ImVec2(0.0f, 0.0f));
UIWidgets::EnhancementSliderInt("Stone Count: %d", "##RandoStoneCount", UIWidgets::EnhancementSliderInt("Stone Count: %d", "##RandoStoneCount",
"gRandomizeStoneCount", 1, 3, "", 3, true); "gRandomizeStoneCount", 1, 3, "", 3, true);
break; break;
case 3: case RO_BRIDGE_MEDALLIONS:
ImGui::Dummy(ImVec2(0.0f, 0.0f)); ImGui::Dummy(ImVec2(0.0f, 0.0f));
UIWidgets::EnhancementSliderInt("Medallion Count: %d", "##RandoMedallionCount", UIWidgets::EnhancementSliderInt("Medallion Count: %d", "##RandoMedallionCount",
"gRandomizeMedallionCount", 1, 6, "", 6, true); "gRandomizeMedallionCount", 1, 6, "", 6, true);
break; break;
case 4: case RO_BRIDGE_DUNGEON_REWARDS:
ImGui::Dummy(ImVec2(0.0f, 0.0f)); ImGui::Dummy(ImVec2(0.0f, 0.0f));
UIWidgets::EnhancementSliderInt("Reward Count: %d", "##RandoRewardCount", UIWidgets::EnhancementSliderInt("Reward Count: %d", "##RandoRewardCount",
"gRandomizeRewardCount", 1, 9, "", 9, true); "gRandomizeRewardCount", 1, 9, "", 9, true);
break; break;
case 5: case RO_BRIDGE_DUNGEONS:
ImGui::Dummy(ImVec2(0.0f, 0.0f)); ImGui::Dummy(ImVec2(0.0f, 0.0f));
UIWidgets::EnhancementSliderInt("Dungeon Count: %d", "##RandoDungeonCount", UIWidgets::EnhancementSliderInt("Dungeon Count: %d", "##RandoDungeonCount",
"gRandomizeDungeonCount", 1, 8, "", 8, true); "gRandomizeDungeonCount", 1, 8, "", 8, true);
break; break;
case 6: case RO_BRIDGE_TOKENS:
ImGui::Dummy(ImVec2(0.0f, 0.0f)); ImGui::Dummy(ImVec2(0.0f, 0.0f));
UIWidgets::EnhancementSliderInt("Token Count: %d", "##RandoTokenCount", UIWidgets::EnhancementSliderInt("Token Count: %d", "##RandoTokenCount",
"gRandomizeTokenCount", 1, 100, "", 100, true); "gRandomizeTokenCount", 1, 100, "", 100, true);

View File

@ -1109,9 +1109,9 @@ typedef enum RandoOption {
RO_KAK_GATE_CLOSED = 0, RO_KAK_GATE_CLOSED = 0,
RO_KAK_GATE_OPEN, RO_KAK_GATE_OPEN,
//Rainbow Bridge settings (always open, vanilla, stones, medallions, dungeon rewards, dungeons, tokens) //Rainbow Bridge settings (vanilla, always open, stones, medallions, dungeon rewards, dungeons, tokens)
RO_BRIDGE_ALWAYS_OPEN = 0, RO_BRIDGE_VANILLA = 0,
RO_BRIDGE_VANILLA, RO_BRIDGE_ALWAYS_OPEN,
RO_BRIDGE_STONES, RO_BRIDGE_STONES,
RO_BRIDGE_MEDALLIONS, RO_BRIDGE_MEDALLIONS,
RO_BRIDGE_DUNGEON_REWARDS, RO_BRIDGE_DUNGEON_REWARDS,

View File

@ -51,7 +51,7 @@ void BgGjyoBridge_Init(Actor* thisx, PlayState* play) {
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader);
int bridge = Randomizer_GetSettingValue(RSK_RAINBOW_BRIDGE); int bridge = Randomizer_GetSettingValue(RSK_RAINBOW_BRIDGE);
if (gSaveContext.eventChkInf[4] & 0x2000 || (gSaveContext.n64ddFlag && bridge == 0)) { if (gSaveContext.eventChkInf[4] & 0x2000 || (gSaveContext.n64ddFlag && bridge == RO_BRIDGE_ALWAYS_OPEN)) {
this->actionFunc = func_808787A4; this->actionFunc = func_808787A4;
} else { } else {
this->dyna.actor.draw = NULL; this->dyna.actor.draw = NULL;
@ -98,38 +98,38 @@ void BgGjyoBridge_TriggerCutscene(BgGjyoBridge* this, PlayState* play) {
int bridgeTokenCount = Randomizer_GetSettingValue(RSK_RAINBOW_BRIDGE_TOKEN_COUNT); int bridgeTokenCount = Randomizer_GetSettingValue(RSK_RAINBOW_BRIDGE_TOKEN_COUNT);
switch (bridge) { switch (bridge) {
case 1: case RO_BRIDGE_VANILLA:
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) && if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) &&
(INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT)) { (INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT)) {
this->actionFunc = BgGjyoBridge_SpawnBridge; this->actionFunc = BgGjyoBridge_SpawnBridge;
func_800F595C(NA_BGM_BRIDGE_TO_GANONS); func_800F595C(NA_BGM_BRIDGE_TO_GANONS);
} }
break; break;
case 2: case RO_BRIDGE_STONES:
if (CheckStoneCount() >= bridgeStoneCount) { if (CheckStoneCount() >= bridgeStoneCount) {
this->actionFunc = BgGjyoBridge_SpawnBridge; this->actionFunc = BgGjyoBridge_SpawnBridge;
func_800F595C(NA_BGM_BRIDGE_TO_GANONS); func_800F595C(NA_BGM_BRIDGE_TO_GANONS);
} }
break; break;
case 3: case RO_BRIDGE_MEDALLIONS:
if (CheckMedallionCount() >= bridgeMedallionCount) { if (CheckMedallionCount() >= bridgeMedallionCount) {
this->actionFunc = BgGjyoBridge_SpawnBridge; this->actionFunc = BgGjyoBridge_SpawnBridge;
func_800F595C(NA_BGM_BRIDGE_TO_GANONS); func_800F595C(NA_BGM_BRIDGE_TO_GANONS);
} }
break; break;
case 4: case RO_BRIDGE_DUNGEON_REWARDS:
if ((CheckMedallionCount() + CheckStoneCount()) >= bridgeRewardCount) { if ((CheckMedallionCount() + CheckStoneCount()) >= bridgeRewardCount) {
this->actionFunc = BgGjyoBridge_SpawnBridge; this->actionFunc = BgGjyoBridge_SpawnBridge;
func_800F595C(NA_BGM_BRIDGE_TO_GANONS); func_800F595C(NA_BGM_BRIDGE_TO_GANONS);
} }
break; break;
case 5: case RO_BRIDGE_DUNGEONS:
if (CheckDungeonCount() >= bridgeDungeonCount) { if (CheckDungeonCount() >= bridgeDungeonCount) {
this->actionFunc = BgGjyoBridge_SpawnBridge; this->actionFunc = BgGjyoBridge_SpawnBridge;
func_800F595C(NA_BGM_BRIDGE_TO_GANONS); func_800F595C(NA_BGM_BRIDGE_TO_GANONS);
} }
break; break;
case 6: case RO_BRIDGE_TOKENS:
if (gSaveContext.inventory.gsTokens >= bridgeTokenCount) { if (gSaveContext.inventory.gsTokens >= bridgeTokenCount) {
this->actionFunc = BgGjyoBridge_SpawnBridge; this->actionFunc = BgGjyoBridge_SpawnBridge;
func_800F595C(NA_BGM_BRIDGE_TO_GANONS); func_800F595C(NA_BGM_BRIDGE_TO_GANONS);