Rando: Starting hearts (#3974)

* Initial implementation

* Re-run build

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
This commit is contained in:
Pepe20129 2024-05-10 04:39:22 +02:00 committed by GitHub
parent 24e1d45e95
commit 118cd044b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 2 deletions

View File

@ -434,7 +434,7 @@ void UpdatePermanentHeartLossState() {
if (!CVarGetInteger(CVAR_ENHANCEMENT("PermanentHeartLoss"), 0) && hasAffectedHealth) {
uint8_t heartContainers = gSaveContext.sohStats.heartContainers; // each worth 16 health
uint8_t heartPieces = gSaveContext.sohStats.heartPieces; // each worth 4 health, but only in groups of 4
uint8_t startingHealth = 16 * 3;
uint8_t startingHealth = 16 * (IS_RANDO ? (OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_STARTING_HEARTS) + 1) : 3);
uint8_t newCapacity = startingHealth + (heartContainers * 16) + ((heartPieces - (heartPieces % 4)) * 4);

View File

@ -140,6 +140,11 @@ void SetStartingItems() {
gSaveContext.inventory.gsTokens = Randomizer_GetSettingValue(RSK_STARTING_SKULLTULA_TOKEN);
}
if ((Randomizer_GetSettingValue(RSK_STARTING_HEARTS) + 1) != 3) {
gSaveContext.healthCapacity = (Randomizer_GetSettingValue(RSK_STARTING_HEARTS) + 1) * 16;
gSaveContext.health = gSaveContext.healthCapacity;
}
if (Randomizer_GetSettingValue(RSK_STARTING_OCARINA)) {
INV_CONTENT(ITEM_OCARINA_FAIRY) = ITEM_OCARINA_FAIRY;
}

View File

@ -202,7 +202,7 @@ void Settings::CreateOptions() {
mOptions[RSK_STARTING_NOCTURNE_OF_SHADOW] = Option::Bool("Start with Nocturne of Shadow", CVAR_RANDOMIZER_SETTING("StartingNocturneOfShadow"), "", IMFLAG_NONE);
mOptions[RSK_STARTING_PRELUDE_OF_LIGHT] = Option::Bool("Start with Prelude of Light", CVAR_RANDOMIZER_SETTING("StartingPreludeOfLight"));
mOptions[RSK_STARTING_SKULLTULA_TOKEN] = Option::U8("Gold Skulltula Tokens", {NumOpts(0, 100)}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("StartingSkulltulaToken"), "", WidgetType::Slider);
mOptions[RSK_STARTING_HEARTS] = Option::U8("Hearts", {NumOpts(1, 20)}, OptionCategory::Setting, "", "", WidgetType::Slider, 2);
mOptions[RSK_STARTING_HEARTS] = Option::U8("Hearts", {NumOpts(1, 20)}, OptionCategory::Setting, "gRandomizeStartingHearts", "", WidgetType::Slider, 2);
// TODO: Remainder of Starting Items
mOptions[RSK_LOGIC_RULES] = Option::U8("Logic", {"Glitchless", "Glitched", "No Logic", "Vanilla"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("LogicRules"), mOptionDescriptions[RSK_LOGIC_RULES], WidgetType::Combobox, RO_LOGIC_GLITCHLESS);
mOptions[RSK_ALL_LOCATIONS_REACHABLE] = Option::Bool("All Locations Reachable", {"Off", "On"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("AllLocationsReachable"), mOptionDescriptions[RSK_ALL_LOCATIONS_REACHABLE], WidgetType::Checkbox, RO_GENERIC_ON);
@ -773,6 +773,7 @@ void Settings::CreateOptions() {
&mOptions[RSK_STARTING_OCARINA],
&mOptions[RSK_STARTING_CONSUMABLES],
&mOptions[RSK_STARTING_SKULLTULA_TOKEN],
&mOptions[RSK_STARTING_HEARTS],
}, false, WidgetContainerType::COLUMN);
mOptionGroups[RSG_STARTING_NORMAL_SONGS_IMGUI] = OptionGroup::SubGroup("Normal Songs", {
&mOptions[RSK_STARTING_ZELDAS_LULLABY],
@ -933,6 +934,7 @@ void Settings::CreateOptions() {
&mOptions[RSK_STARTING_CONSUMABLES],
&mOptions[RSK_FULL_WALLETS],
&mOptions[RSK_STARTING_SKULLTULA_TOKEN],
&mOptions[RSK_STARTING_HEARTS],
}, false);
mOptionGroups[RSG_STARTING_INVENTORY] = OptionGroup("Starting Inventory", {
&mOptionGroups[RSG_STARTING_ITEMS],
@ -1196,6 +1198,7 @@ void Settings::CreateOptions() {
{ "Start with Consumables", RSK_STARTING_CONSUMABLES },
{ "Full Wallets", RSK_FULL_WALLETS },
{ "Gold Skulltula Tokens", RSK_STARTING_SKULLTULA_TOKEN },
{ "Hearts", RSK_STARTING_HEARTS },
{ "Timesaver Settings:Cuccos to return", RSK_CUCCO_COUNT },
{ "Timesaver Settings:Big Poe Target Count", RSK_BIG_POE_COUNT },
{ "Timesaver Settings:Skip Child Stealth", RSK_SKIP_CHILD_STEALTH },