greg bridge in logic (#2460)

* greg bridge in logic

---------

Co-authored-by: briaguya <briaguya@alice>
This commit is contained in:
briaguya 2023-02-16 21:53:08 -05:00 committed by GitHub
parent 3d8752b3aa
commit 68c8f50a71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 37 additions and 6 deletions

View File

@ -116,6 +116,10 @@ public:
return false;
}
if (randomizerGet == RG_GREG_RUPEE) {
return Bridge.Is(RAINBOWBRIDGE_GREG);
}
return IsAdvancement();
}

View File

@ -177,7 +177,7 @@ void ItemTable_Init() { // RandomizerGet
//Generic Items
itemTable[RECOVERY_HEART] = Item(RG_RECOVERY_HEART, Text{"Recovery Heart", "Coeur de Vie", "Corazón"}, ITEMTYPE_ITEM, GI_HEART, false, &noVariable, RECOVERY_HEART);
itemTable[GREEN_RUPEE] = Item(RG_GREEN_RUPEE, Text{"Green Rupee", "Rubis Vert", "Rupia verde"}, ITEMTYPE_ITEM, GI_RUPEE_GREEN, false, &noVariable, GREEN_RUPEE);
itemTable[GREG_RUPEE] = Item(RG_GREG_RUPEE, Text{"Greg Rupee", "Rubis Greg", "Rupia Greg"}, ITEMTYPE_ITEM, GI_RUPEE_GREEN, false, &noVariable, GREG_RUPEE);
itemTable[GREG_RUPEE] = Item(RG_GREG_RUPEE, Text{"Greg Rupee", "Rubis Greg", "Rupia Greg"}, ITEMTYPE_ITEM, GI_RUPEE_GREEN, true, &Greg, GREG_RUPEE);
itemTable[BLUE_RUPEE] = Item(RG_BLUE_RUPEE, Text{"Blue Rupee", "Rubis Bleu", "Rupia azul"}, ITEMTYPE_ITEM, GI_RUPEE_BLUE, false, &noVariable, BLUE_RUPEE);
itemTable[RED_RUPEE] = Item(RG_RED_RUPEE, Text{"Red Rupee", "Rubis Rouge", "Rupia roja"}, ITEMTYPE_ITEM, GI_RUPEE_RED, false, &noVariable, RED_RUPEE);
itemTable[PURPLE_RUPEE] = Item(RG_PURPLE_RUPEE, Text{"Purple Rupee", "Rubis Pourpre", "Rupia morada"}, ITEMTYPE_ITEM, GI_RUPEE_PURPLE, false, &noVariable, PURPLE_RUPEE);

View File

@ -120,6 +120,9 @@ namespace Logic {
bool ShadowTrialClear = false;
bool LightTrialClear = false;
//Greg
bool Greg = false;
//Progressive Items
uint8_t ProgressiveBulletBag = 0;
uint8_t ProgressiveBombBag = 0;
@ -781,7 +784,8 @@ namespace Logic {
(Bridge.Is(RAINBOWBRIDGE_MEDALLIONS) && MedallionCount >= BridgeMedallionCount.Value<uint8_t>()) ||
(Bridge.Is(RAINBOWBRIDGE_REWARDS) && StoneCount + MedallionCount >= BridgeRewardCount.Value<uint8_t>()) ||
(Bridge.Is(RAINBOWBRIDGE_DUNGEONS) && DungeonCount >= BridgeDungeonCount.Value<uint8_t>()) ||
(Bridge.Is(RAINBOWBRIDGE_TOKENS) && GoldSkulltulaTokens >= BridgeTokenCount.Value<uint8_t>());
(Bridge.Is(RAINBOWBRIDGE_TOKENS) && GoldSkulltulaTokens >= BridgeTokenCount.Value<uint8_t>()) ||
(Bridge.Is(RAINBOWBRIDGE_GREG) && Greg);
CanTriggerLACS = (LACSCondition == LACSCONDITION_VANILLA && ShadowMedallion && SpiritMedallion) ||
(LACSCondition == LACSCONDITION_STONES && StoneCount >= LACSStoneCount.Value<uint8_t>()) ||
@ -998,6 +1002,9 @@ namespace Logic {
ShadowTrialClear = false;
LightTrialClear = false;
//Greg
Greg = false;
//Progressive Items
ProgressiveBulletBag = 0;
ProgressiveBombBag = 0;

View File

@ -113,6 +113,9 @@ extern bool SpiritTrialClear;
extern bool ShadowTrialClear;
extern bool LightTrialClear;
//Greg
extern bool Greg;
// Progression Items
extern uint8_t ProgressiveBulletBag;
extern uint8_t ProgressiveBombBag;

View File

@ -109,6 +109,8 @@ string_view bridgeDungeons = "The Rainbow Bridge requires completing
"into the blue warp at the end of them."; //
string_view bridgeTokens = "The Rainbow Bridge requires collecting a\n" //
"configurable number of Gold Skulltula Tokens."; //
string_view bridgeGreg = "The Rainbow Bridge requires collecting\n" //
"Greg the green rupee."; //
/*------------------------------ //
| BRIDGE CONDITIONS | //
------------------------------*/ //

View File

@ -40,6 +40,7 @@ extern string_view bridgeMedallions;
extern string_view bridgeRewards;
extern string_view bridgeDungeons;
extern string_view bridgeTokens;
extern string_view bridgeGreg;
extern string_view bridgeStoneCountDesc;
extern string_view bridgeMedallionCountDesc;

View File

@ -59,7 +59,7 @@ namespace Settings {
Option OpenDoorOfTime = Option::U8 ("Door of Time", {"Closed", "Song only", "Open"}, {doorOfTimeClosed, doorOfTimeSongOnly, doorOfTimeOpen});
Option ZorasFountain = Option::U8 ("Zora's Fountain", {"Closed", "Closed as child", "Open"}, {fountainNormal, fountainAdult, fountainOpen});
Option GerudoFortress = Option::U8 ("Gerudo Fortress", {"Normal", "Fast", "Open"}, {gerudoNormal, gerudoFast, gerudoOpen});
Option Bridge = Option::U8 ("Rainbow Bridge", {"Vanilla", "Always open", "Stones", "Medallions", "Dungeon rewards", "Dungeons", "Tokens"}, {bridgeVanilla, bridgeOpen, bridgeStones, bridgeMedallions, bridgeRewards, bridgeDungeons, bridgeTokens}, OptionCategory::Setting, RAINBOWBRIDGE_VANILLA);
Option Bridge = Option::U8 ("Rainbow Bridge", {"Vanilla", "Always open", "Stones", "Medallions", "Dungeon rewards", "Dungeons", "Tokens", "Greg"}, {bridgeVanilla, bridgeOpen, bridgeStones, bridgeMedallions, bridgeRewards, bridgeDungeons, bridgeTokens, bridgeGreg}, OptionCategory::Setting, RAINBOWBRIDGE_VANILLA);
Option BridgeStoneCount = Option::U8 ("Stone Count", {NumOpts(0, 3)}, {bridgeStoneCountDesc}, OptionCategory::Setting, 1, true);
Option BridgeMedallionCount= Option::U8 ("Medallion Count", {NumOpts(0, 6)}, {bridgeMedallionCountDesc}, OptionCategory::Setting, 1, true);
Option BridgeRewardCount = Option::U8 ("Reward Count", {NumOpts(0, 9)}, {bridgeRewardCountDesc}, OptionCategory::Setting, 1, true);

View File

@ -69,6 +69,7 @@ typedef enum {
RAINBOWBRIDGE_REWARDS,
RAINBOWBRIDGE_DUNGEONS,
RAINBOWBRIDGE_TOKENS,
RAINBOWBRIDGE_GREG,
} RainbowBridgeSetting;
typedef enum {

View File

@ -690,6 +690,8 @@ void Randomizer::ParseRandomizerSettingsFile(const char* spoilerFileName) {
gSaveContext.randoSettings[index].value = RO_BRIDGE_DUNGEONS;
} else if(it.value() == "Tokens") {
gSaveContext.randoSettings[index].value = RO_BRIDGE_TOKENS;
} else if(it.value() == "Greg") {
gSaveContext.randoSettings[index].value = RO_BRIDGE_GREG;
}
break;
case RSK_RAINBOW_BRIDGE_STONE_COUNT:
@ -2987,8 +2989,8 @@ void DrawRandoEditor(bool& open) {
static const char* randoDoorOfTime[3] = { "Closed", "Song only", "Open" };
static const char* randoZorasFountain[3] = { "Closed", "Closed as child", "Open" };
static const char* randoGerudoFortress[3] = { "Normal", "Fast", "Open" };
static const char* randoRainbowBridge[7] = { "Vanilla", "Always open", "Stones", "Medallions",
"Dungeon rewards", "Dungeons", "Tokens" };
static const char* randoRainbowBridge[8] = { "Vanilla", "Always open", "Stones", "Medallions",
"Dungeon rewards", "Dungeons", "Tokens", "Greg" };
static const char* randoGanonsTrial[3] = { "Skip", "Set Number", "Random Number" };
static const char* randoMqDungeons[3] = { "None", "Set Number", "Random Number" };
@ -3228,7 +3230,9 @@ void DrawRandoEditor(bool& open) {
"are considered complete after stepping in to the blue warp after "
"the boss.\n"
"\n"
"Tokens - Obtain the specified amount of Skulltula tokens."
"Tokens - Obtain the specified amount of Skulltula tokens.\n"
"\n"
"Greg - Find Greg the Green Rupee."
);
UIWidgets::EnhancementCombobox("gRandomizeRainbowBridge", randoRainbowBridge, RO_BRIDGE_MAX, RO_BRIDGE_VANILLA);
@ -3263,6 +3267,8 @@ void DrawRandoEditor(bool& open) {
UIWidgets::EnhancementSliderInt("Token Count: %d", "##RandoTokenCount",
"gRandomizeTokenCount", 1, 100, "", 100, true);
break;
case RO_BRIDGE_GREG:
break;
}
UIWidgets::PaddedSeparator();

View File

@ -1175,6 +1175,7 @@ typedef enum {
RO_BRIDGE_DUNGEON_REWARDS,
RO_BRIDGE_DUNGEONS,
RO_BRIDGE_TOKENS,
RO_BRIDGE_GREG,
RO_BRIDGE_MAX,
} RandoOptionRainbowBridge;

View File

@ -135,6 +135,12 @@ void BgGjyoBridge_TriggerCutscene(BgGjyoBridge* this, PlayState* play) {
func_800F595C(NA_BGM_BRIDGE_TO_GANONS);
}
break;
case RO_BRIDGE_GREG:
if (Flags_GetRandomizerInf(RAND_INF_GREG_FOUND)) {
this->actionFunc = BgGjyoBridge_SpawnBridge;
func_800F595C(NA_BGM_BRIDGE_TO_GANONS);
}
break;
}
}
}