From 56d8dd6d8b754e2f77aa6f27169f58b73701172a Mon Sep 17 00:00:00 2001 From: Malkierian Date: Thu, 25 Apr 2024 17:31:28 -0700 Subject: [PATCH] All MenuBar enhancement CVars done. (#4064) --- .../cosmetics/CosmeticsEditor.cpp | 2 +- .../cosmetics/authenticGfxPatches.cpp | 7 +- soh/soh/Enhancements/debugconsole.cpp | 2 +- .../Enhancements/debugger/MessageViewer.cpp | 2 +- soh/soh/Enhancements/enemyrandomizer.cpp | 3 +- soh/soh/Enhancements/gameplaystats.cpp | 3 +- soh/soh/Enhancements/mods.cpp | 90 +- soh/soh/Enhancements/presets.h | 872 +++++++++--------- .../randomizer/randomizer_check_tracker.cpp | 2 +- .../randomizer/randomizer_entrance.c | 2 +- soh/soh/OTRGlobals.cpp | 12 +- soh/soh/SohMenuBar.cpp | 532 +++++------ soh/src/code/code_80097A00.c | 2 +- soh/src/code/code_800EC960.c | 16 +- soh/src/code/shrink_window.c | 4 +- soh/src/code/z_actor.c | 12 +- soh/src/code/z_camera.c | 10 +- soh/src/code/z_collision_check.c | 4 +- soh/src/code/z_construct.c | 4 +- soh/src/code/z_demo.c | 6 +- soh/src/code/z_en_item00.c | 58 +- soh/src/code/z_face_reaction.c | 2 +- soh/src/code/z_fcurve_data_skelanime.c | 2 +- soh/src/code/z_lifemeter.c | 4 +- soh/src/code/z_map_exp.c | 6 +- soh/src/code/z_message_PAL.c | 26 +- soh/src/code/z_olib.c | 2 +- soh/src/code/z_onepointdemo.c | 6 +- soh/src/code/z_parameter.c | 22 +- soh/src/code/z_play.c | 8 +- soh/src/code/z_player_lib.c | 46 +- soh/src/code/z_skelanime.c | 6 +- soh/src/code/z_sram.c | 4 +- .../actors/ovl_Bg_Breakwall/z_bg_breakwall.c | 2 +- .../overlays/actors/ovl_Bg_Haka/z_bg_haka.c | 2 +- .../actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c | 4 +- .../actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c | 4 +- .../ovl_Bg_Heavy_Block/z_bg_heavy_block.c | 6 +- .../ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c | 6 +- .../ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c | 2 +- .../actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c | 4 +- .../actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c | 2 +- .../ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c | 2 +- .../z_bg_mori_kaitenkabe.c | 4 +- .../actors/ovl_Bg_Po_Event/z_bg_po_event.c | 6 +- .../ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c | 6 +- .../ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c | 2 +- .../actors/ovl_Boss_Ganon/z_boss_ganon.c | 2 +- .../actors/ovl_Boss_Ganon2/z_boss_ganon2.c | 2 +- .../actors/ovl_Boss_Goma/z_boss_goma.c | 6 +- .../overlays/actors/ovl_Boss_Sst/z_boss_sst.c | 6 +- .../overlays/actors/ovl_Door_Ana/z_door_ana.c | 2 +- .../overlays/actors/ovl_Elf_Msg/z_elf_msg.c | 2 +- soh/src/overlays/actors/ovl_En_Am/z_en_am.c | 2 +- .../ovl_En_Anubice_Fire/z_en_anubice_fire.c | 2 +- .../actors/ovl_En_Blkobj/z_en_blkobj.c | 4 +- soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c | 6 +- .../ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c | 6 +- .../actors/ovl_En_Bom_Chu/z_en_bom_chu.c | 2 +- soh/src/overlays/actors/ovl_En_Box/z_en_box.c | 6 +- .../actors/ovl_En_Clear_Tag/z_en_clear_tag.c | 4 +- soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c | 2 +- .../overlays/actors/ovl_En_Crow/z_en_crow.c | 2 +- soh/src/overlays/actors/ovl_En_Dog/z_en_dog.c | 6 +- .../overlays/actors/ovl_En_Door/z_en_door.c | 4 +- soh/src/overlays/actors/ovl_En_Du/z_en_du.c | 6 +- soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c | 8 +- .../actors/ovl_En_Encount1/z_en_encount1.c | 8 +- .../actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c | 2 +- .../actors/ovl_En_G_Switch/z_en_g_switch.c | 4 +- soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c | 2 +- .../overlays/actors/ovl_En_GirlA/z_en_girla.c | 6 +- soh/src/overlays/actors/ovl_En_Go/z_en_go.c | 2 +- soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c | 4 +- .../actors/ovl_En_Heishi4/z_en_heishi4.c | 4 +- soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c | 2 +- soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c | 8 +- .../actors/ovl_En_Kakasi2/z_en_kakasi2.c | 2 +- soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c | 2 +- .../overlays/actors/ovl_En_Kusa/z_en_kusa.c | 4 +- soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c | 4 +- soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c | 12 +- soh/src/overlays/actors/ovl_En_Md/z_en_md.c | 2 +- soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c | 2 +- .../actors/ovl_En_Nutsball/z_en_nutsball.c | 4 +- .../overlays/actors/ovl_En_Okuta/z_en_okuta.c | 4 +- soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c | 16 +- .../actors/ovl_En_Peehat/z_en_peehat.c | 2 +- soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c | 4 +- soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c | 2 +- soh/src/overlays/actors/ovl_En_Si/z_en_si.c | 4 +- soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c | 4 +- soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c | 6 +- soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c | 4 +- .../ovl_En_Syateki_Itm/z_en_syateki_itm.c | 6 +- .../ovl_En_Syateki_Man/z_en_syateki_man.c | 6 +- soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c | 16 +- .../actors/ovl_En_Torch2/z_en_torch2.c | 4 +- .../overlays/actors/ovl_En_Toryo/z_en_toryo.c | 2 +- .../overlays/actors/ovl_En_Vali/z_en_vali.c | 2 +- .../actors/ovl_En_Wallmas/z_en_wallmas.c | 4 +- soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c | 2 +- .../actors/ovl_En_Wood02/z_en_wood02.c | 6 +- soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c | 2 +- .../overlays/actors/ovl_Fishing/z_fishing.c | 12 +- .../overlays/actors/ovl_Obj_Comb/z_obj_comb.c | 2 +- .../ovl_Obj_Lightswitch/z_obj_lightswitch.c | 2 +- .../overlays/actors/ovl_Obj_Mure/z_obj_mure.c | 4 +- .../actors/ovl_Obj_Mure2/z_obj_mure2.c | 4 +- .../actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c | 6 +- .../ovl_Obj_Roomtimer/z_obj_roomtimer.c | 2 +- .../actors/ovl_Oceff_Wipe/z_oceff_wipe.c | 2 +- .../actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c | 2 +- .../actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c | 2 +- .../actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c | 2 +- .../actors/ovl_player_actor/z_player.c | 174 ++-- .../z_eff_ss_solder_srch_ball.c | 2 +- .../ovl_file_choose/z_file_choose.c | 16 +- .../overlays/gamestates/ovl_title/z_title.c | 6 +- .../misc/ovl_kaleido_scope/z_kaleido_debug.c | 2 +- .../ovl_kaleido_scope/z_kaleido_equipment.c | 36 +- .../misc/ovl_kaleido_scope/z_kaleido_item.c | 20 +- .../ovl_kaleido_scope/z_kaleido_scope_PAL.c | 26 +- 123 files changed, 1203 insertions(+), 1200 deletions(-) diff --git a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp index 0b0f94f21..8dbabd460 100644 --- a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp +++ b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp @@ -1248,7 +1248,7 @@ void Draw_Placements(){ ImGui::EndTable(); } } - if (CVarGetInteger("gVisualAgony",0) && ImGui::CollapsingHeader("Visual stone of agony position")) { + if (CVarGetInteger(CVAR_ENHANCEMENT("VisualAgony"),0) && ImGui::CollapsingHeader("Visual stone of agony position")) { if (ImGui::BeginTable("tabledvisualstoneofagony", 1, FlagsTable)) { ImGui::TableSetupColumn("Visual stone of agony settings", FlagsCell, TablesCellsWidth); Table_InitHeader(false); diff --git a/soh/soh/Enhancements/cosmetics/authenticGfxPatches.cpp b/soh/soh/Enhancements/cosmetics/authenticGfxPatches.cpp index 709854c35..310517299 100644 --- a/soh/soh/Enhancements/cosmetics/authenticGfxPatches.cpp +++ b/soh/soh/Enhancements/cosmetics/authenticGfxPatches.cpp @@ -1,5 +1,6 @@ #include #include +#include "soh/OTRGlobals.h" extern "C" { #include @@ -81,7 +82,7 @@ void PatchDekuStickTextureOverflow() { const char* dlist = gLinkChildLinkDekuStickDL; int start = 5; - if (!CVarGetInteger("gFixTexturesOOB", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("FixTexturesOOB"), 0)) { // Unpatch the other texture fix for (size_t i = 0; i < 7; i++) { int instruction = start + (i == 0 ? 0 : i + 1); @@ -121,7 +122,7 @@ void PatchFreezardTextureOverflow() { char patchNameBuf[24]; // Patch using custom overflowed texture - if (!CVarGetInteger("gFixTexturesOOB", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("FixTexturesOOB"), 0)) { // Unpatch the other texture fix for (size_t i = 0; i < 7; i++) { int instruction = start + (i == 0 ? 0 : i + 1); @@ -163,7 +164,7 @@ void PatchIronKnuckleTextureOverflow() { // Until this is solved, Iron Knuckle will be hardcoded to always display with the "authentic" texture fix // Patch using custom overflowed texture - // if (!CVarGetInteger("gFixTexturesOOB", 0)) { + // if (!CVarGetInteger(CVAR_ENHANCEMENT("FixTexturesOOB"), 0)) { // Unpatch the other texture fix for (size_t i = 0; i < 7; i++) { int instruction = start + (i == 0 ? 0 : i + 1); diff --git a/soh/soh/Enhancements/debugconsole.cpp b/soh/soh/Enhancements/debugconsole.cpp index bbf72a6d3..e75450c7c 100644 --- a/soh/soh/Enhancements/debugconsole.cpp +++ b/soh/soh/Enhancements/debugconsole.cpp @@ -471,7 +471,7 @@ static bool FWHandler(std::shared_ptr Console, const std::vector @@ -233,7 +234,7 @@ extern "C" uint8_t GetRandomizedEnemy(PlayState* play, int16_t *actorId, f32 *po } EnemyEntry GetRandomizedEnemyEntry(uint32_t seed) { - if (CVarGetInteger("gRandomizedEnemies", ENEMY_RANDOMIZER_OFF) == ENEMY_RANDOMIZER_RANDOM_SEEDED) { + if (CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), ENEMY_RANDOMIZER_OFF) == ENEMY_RANDOMIZER_RANDOM_SEEDED) { uint32_t finalSeed = seed + (IS_RANDO ? gSaveContext.finalSeed : gSaveContext.sohStats.fileCreatedAt); Random_Init(finalSeed); } diff --git a/soh/soh/Enhancements/gameplaystats.cpp b/soh/soh/Enhancements/gameplaystats.cpp index efcf44efb..fa35edfb6 100644 --- a/soh/soh/Enhancements/gameplaystats.cpp +++ b/soh/soh/Enhancements/gameplaystats.cpp @@ -14,6 +14,7 @@ extern "C" { #include #include #include "soh/Enhancements/enhancementTypes.h" +#include "soh/OTRGlobals.h" extern "C" { #include @@ -538,7 +539,7 @@ void DrawGameplayStatsCountsTab() { GameplayStatsRow("Sword Swings:", formatIntGameplayStat(gSaveContext.sohStats.count[COUNT_SWORD_SWINGS])); GameplayStatsRow("Steps Taken:", formatIntGameplayStat(gSaveContext.sohStats.count[COUNT_STEPS])); // If using MM Bunny Hood enhancement, show how long it's been equipped (not counting pause time) - if (CVarGetInteger("gMMBunnyHood", BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA || gSaveContext.sohStats.count[COUNT_TIME_BUNNY_HOOD] > 0) { + if (CVarGetInteger(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA || gSaveContext.sohStats.count[COUNT_TIME_BUNNY_HOOD] > 0) { GameplayStatsRow("Bunny Hood Time:", formatTimestampGameplayStat(gSaveContext.sohStats.count[COUNT_TIME_BUNNY_HOOD] / 2)); } GameplayStatsRow("Rolls:", formatIntGameplayStat(gSaveContext.sohStats.count[COUNT_ROLLS])); diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index b32e7d798..a10dd559b 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -253,7 +253,7 @@ void RegisterOcarinaTimeTravel() { GameInteractor::Instance->RegisterGameHook([]() { if (!GameInteractor::IsSaveLoaded(true)) { - CVarClear("gTimeTravel"); + CVarClear(CVAR_ENHANCEMENT("TimeTravel")); return; } @@ -267,7 +267,7 @@ void RegisterOcarinaTimeTravel() { uint8_t hasOcarinaOfTime = (INV_CONTENT(ITEM_OCARINA_TIME) == ITEM_OCARINA_TIME); // If TimeTravel + Player have the Ocarina of Time + Have Master Sword + is in proper range // TODO: Once Swordless Adult is fixed: Remove the Master Sword check - if (((CVarGetInteger("gTimeTravel", 0) == 1 && hasOcarinaOfTime) || CVarGetInteger("gTimeTravel", 0) == 2) && hasMasterSword && + if (((CVarGetInteger(CVAR_ENHANCEMENT("TimeTravel"), 0) == 1 && hasOcarinaOfTime) || CVarGetInteger(CVAR_ENHANCEMENT("TimeTravel"), 0) == 2) && hasMasterSword && gPlayState->msgCtx.lastPlayedSong == OCARINA_SONG_TIME && !nearbyTimeBlockEmpty && !nearbyTimeBlock && !nearbyOcarinaSpot && !nearbyFrogs) { @@ -289,13 +289,13 @@ void AutoSave(GetItemEntry itemEntry) { // Don't autosave immediately after buying items from shops to prevent getting them for free! // Don't autosave in the Chamber of Sages since resuming from that map breaks the game // Don't autosave during the Ganon fight when picking up the Master Sword - if ((CVarGetInteger("gAutosave", AUTOSAVE_OFF) != AUTOSAVE_OFF) && (gPlayState != NULL) && (gSaveContext.pendingSale == ITEM_NONE) && + if ((CVarGetInteger(CVAR_ENHANCEMENT("Autosave"), AUTOSAVE_OFF) != AUTOSAVE_OFF) && (gPlayState != NULL) && (gSaveContext.pendingSale == ITEM_NONE) && (gPlayState->gameplayFrames > 60 && gSaveContext.cutsceneIndex < 0xFFF0) && (gPlayState->sceneNum != SCENE_GANON_BOSS) && (gPlayState->sceneNum != SCENE_CHAMBER_OF_THE_SAGES)) { - if (((CVarGetInteger("gAutosave", AUTOSAVE_OFF) == AUTOSAVE_LOCATION_AND_ALL_ITEMS) || (CVarGetInteger("gAutosave", AUTOSAVE_OFF) == AUTOSAVE_ALL_ITEMS)) && (item != ITEM_NONE)) { + if (((CVarGetInteger(CVAR_ENHANCEMENT("Autosave"), AUTOSAVE_OFF) == AUTOSAVE_LOCATION_AND_ALL_ITEMS) || (CVarGetInteger(CVAR_ENHANCEMENT("Autosave"), AUTOSAVE_OFF) == AUTOSAVE_ALL_ITEMS)) && (item != ITEM_NONE)) { // Autosave for all items performSave = true; - } else if (((CVarGetInteger("gAutosave", AUTOSAVE_OFF) == AUTOSAVE_LOCATION_AND_MAJOR_ITEMS) || (CVarGetInteger("gAutosave", AUTOSAVE_OFF) == AUTOSAVE_MAJOR_ITEMS)) && (item != ITEM_NONE)) { + } else if (((CVarGetInteger(CVAR_ENHANCEMENT("Autosave"), AUTOSAVE_OFF) == AUTOSAVE_LOCATION_AND_MAJOR_ITEMS) || (CVarGetInteger(CVAR_ENHANCEMENT("Autosave"), AUTOSAVE_OFF) == AUTOSAVE_MAJOR_ITEMS)) && (item != ITEM_NONE)) { // Autosave for major items if (itemEntry.modIndex == 0) { switch (item) { @@ -335,7 +335,7 @@ void AutoSave(GetItemEntry itemEntry) { case ITEM_BOMBCHU: case ITEM_BOMBCHUS_5: case ITEM_BOMBCHUS_20: - if (!CVarGetInteger("gBombchuDrops", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("BombchuDrops"), 0)) { performSave = true; } break; @@ -346,9 +346,9 @@ void AutoSave(GetItemEntry itemEntry) { } else if (itemEntry.modIndex == 1 && item != RG_ICE_TRAP) { performSave = true; } - } else if (CVarGetInteger("gAutosave", AUTOSAVE_OFF) == AUTOSAVE_LOCATION_AND_MAJOR_ITEMS || - CVarGetInteger("gAutosave", AUTOSAVE_OFF) == AUTOSAVE_LOCATION_AND_ALL_ITEMS || - CVarGetInteger("gAutosave", AUTOSAVE_OFF) == AUTOSAVE_LOCATION) { + } else if (CVarGetInteger(CVAR_ENHANCEMENT("Autosave"), AUTOSAVE_OFF) == AUTOSAVE_LOCATION_AND_MAJOR_ITEMS || + CVarGetInteger(CVAR_ENHANCEMENT("Autosave"), AUTOSAVE_OFF) == AUTOSAVE_LOCATION_AND_ALL_ITEMS || + CVarGetInteger(CVAR_ENHANCEMENT("Autosave"), AUTOSAVE_OFF) == AUTOSAVE_LOCATION) { performSave = true; } if (performSave) { @@ -366,13 +366,13 @@ void RegisterAutoSave() { void RegisterRupeeDash() { GameInteractor::Instance->RegisterGameHook([]() { - if (!CVarGetInteger("gRupeeDash", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("RupeeDash"), 0)) { return; } // Initialize Timer static uint16_t rupeeDashTimer = 0; - uint16_t rdmTime = CVarGetInteger("gDashInterval", 5) * 20; + uint16_t rdmTime = CVarGetInteger(CVAR_ENHANCEMENT("RupeeDashInterval"), 5) * 20; // Did time change by DashInterval? if (rupeeDashTimer >= rdmTime) { @@ -394,7 +394,7 @@ void RegisterShadowTag() { static uint16_t delayTimer = 60; GameInteractor::Instance->RegisterGameHook([]() { - if (!CVarGetInteger("gShadowTag", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("ShadowTag"), 0)) { return; } if (gPlayState->sceneNum == SCENE_FOREST_TEMPLE && // Forest Temple Scene @@ -425,7 +425,7 @@ static bool hasAffectedHealth = false; void UpdatePermanentHeartLossState() { if (!GameInteractor::IsSaveLoaded()) return; - if (!CVarGetInteger("gPermanentHeartLoss", 0) && hasAffectedHealth) { + 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; @@ -445,7 +445,7 @@ void RegisterPermanentHeartLoss() { }); GameInteractor::Instance->RegisterGameHook([]() { - if (!CVarGetInteger("gPermanentHeartLoss", 0) || !GameInteractor::IsSaveLoaded()) return; + if (!CVarGetInteger(CVAR_ENHANCEMENT("PermanentHeartLoss"), 0) || !GameInteractor::IsSaveLoaded()) return; if (gSaveContext.healthCapacity > 16 && gSaveContext.healthCapacity - gSaveContext.health >= 16) { gSaveContext.healthCapacity -= 16; @@ -457,7 +457,7 @@ void RegisterPermanentHeartLoss() { void RegisterDeleteFileOnDeath() { GameInteractor::Instance->RegisterGameHook([]() { - if (!CVarGetInteger("gDeleteFileOnDeath", 0) || !GameInteractor::IsSaveLoaded() || &gPlayState->gameOverCtx == NULL || &gPlayState->pauseCtx == NULL) return; + if (!CVarGetInteger(CVAR_ENHANCEMENT("DeleteFileOnDeath"), 0) || !GameInteractor::IsSaveLoaded() || &gPlayState->gameOverCtx == NULL || &gPlayState->pauseCtx == NULL) return; if (gPlayState->gameOverCtx.state == GAMEOVER_DEATH_MENU && gPlayState->pauseCtx.state == 9) { SaveManager::Instance->DeleteZeldaFile(gSaveContext.fileNum); @@ -478,7 +478,7 @@ using DayTimeGoldSkulltulasList = std::vector; void RegisterDaytimeGoldSkultullas() { GameInteractor::Instance->RegisterGameHook([]() { - if (!CVarGetInteger("gNightGSAlwaysSpawn", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("NightGSAlwaysSpawn"), 0)) { return; } @@ -524,7 +524,7 @@ void RegisterDaytimeGoldSkultullas() { } bool IsHyperBossesActive() { - return CVarGetInteger("gHyperBosses", 0) || + return CVarGetInteger(CVAR_ENHANCEMENT("HyperBosses"), 0) || (IS_BOSS_RUSH && gSaveContext.bossRushOptions[BR_OPTIONS_HYPERBOSSES] == BR_CHOICE_HYPERBOSSES_YES); } @@ -592,7 +592,7 @@ void UpdateHyperEnemiesState() { actorUpdateHookId = 0; } - if (CVarGetInteger("gHyperEnemies", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("HyperEnemies"), 0)) { actorUpdateHookId = GameInteractor::Instance->RegisterGameHook([](void* refActor) { // Run the update function a second time to make enemies and minibosses move and act twice as fast. @@ -604,7 +604,7 @@ void UpdateHyperEnemiesState() { bool isExcludedEnemy = actor->id == ACTOR_EN_FIRE_ROCK || actor->id == ACTOR_EN_ENCOUNT2; // Don't apply during cutscenes because it causes weird behaviour and/or crashes on some cutscenes. - if (CVarGetInteger("gHyperEnemies", 0) && isEnemy && !isExcludedEnemy && + if (CVarGetInteger(CVAR_ENHANCEMENT("HyperEnemies"), 0) && isEnemy && !isExcludedEnemy && !Player_InBlockingCsMode(gPlayState, player)) { GameInteractor::RawAction::UpdateActor(actor); } @@ -614,7 +614,7 @@ void UpdateHyperEnemiesState() { void RegisterBonkDamage() { GameInteractor::Instance->RegisterGameHook([]() { - uint8_t bonkOption = CVarGetInteger("gBonkDamageMul", BONK_DAMAGE_NONE); + uint8_t bonkOption = CVarGetInteger(CVAR_ENHANCEMENT("BonkDamageMult"), BONK_DAMAGE_NONE); if (bonkOption == BONK_DAMAGE_NONE) { return; } @@ -660,7 +660,7 @@ void UpdateDirtPathFixState(int32_t sceneNum) { case SCENE_HYRULE_FIELD: case SCENE_KOKIRI_FOREST: case SCENE_HYRULE_CASTLE: - CVarSetInteger("gZFightingMode", CVarGetInteger("gSceneSpecificDirtPathFix", ZFIGHT_FIX_DISABLED)); + CVarSetInteger("gZFightingMode", CVarGetInteger(CVAR_ENHANCEMENT("SceneSpecificDirtPathFix"), ZFIGHT_FIX_DISABLED)); return; default: CVarClear("gZFightingMode"); @@ -677,7 +677,7 @@ void UpdateMirrorModeState(int32_t sceneNum) { static bool prevMirroredWorld = false; bool nextMirroredWorld = false; - int16_t mirroredMode = CVarGetInteger("gMirroredWorldMode", MIRRORED_WORLD_OFF); + int16_t mirroredMode = CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorldMode"), MIRRORED_WORLD_OFF); int16_t inDungeon = (sceneNum >= SCENE_DEKU_TREE && sceneNum <= SCENE_INSIDE_GANONS_CASTLE_COLLAPSE && sceneNum != SCENE_THIEVES_HIDEOUT) || (sceneNum >= SCENE_DEKU_TREE_BOSS && sceneNum <= SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR) || (sceneNum == SCENE_GANON_BOSS); @@ -718,7 +718,7 @@ void RegisterMirrorModeHandler() { } void UpdatePatchHand() { - if ((CVarGetInteger("gEnhancements.EquimentAlwaysVisible", 0)) && LINK_IS_CHILD) { + if ((CVarGetInteger(CVAR_ENHANCEMENT("EquimentAlwaysVisible"), 0)) && LINK_IS_CHILD) { ResourceMgr_PatchGfxByName(gLinkAdultLeftHandHoldingHammerNearDL, "childHammer1", 92, gsSPDisplayListOTRFilePath(gLinkChildLeftFistNearDL)); ResourceMgr_PatchGfxByName(gLinkAdultLeftHandHoldingHammerNearDL, "childHammer2", 93, gsSPEndDisplayList()); ResourceMgr_PatchGfxByName(gLinkAdultRightHandHoldingHookshotNearDL, "childHookshot1", 84, gsSPDisplayListOTRFilePath(gLinkChildRightHandClosedNearDL)); @@ -746,7 +746,7 @@ void UpdatePatchHand() { ResourceMgr_UnpatchGfxByName(gLinkAdultHandHoldingBrokenGiantsKnifeDL, "childBrokenGiantsKnife1"); ResourceMgr_UnpatchGfxByName(gLinkAdultHandHoldingBrokenGiantsKnifeDL, "childBrokenGiantsKnife2"); } - if ((CVarGetInteger("gEnhancements.EquimentAlwaysVisible", 0)) && LINK_IS_ADULT) { + if ((CVarGetInteger(CVAR_ENHANCEMENT("EquimentAlwaysVisible"), 0)) && LINK_IS_ADULT) { ResourceMgr_PatchGfxByName(gLinkChildLeftFistAndKokiriSwordNearDL, "adultKokiriSword", 13, gsSPDisplayListOTRFilePath(gLinkAdultLeftHandClosedNearDL)); ResourceMgr_PatchGfxByName(gLinkChildRightHandHoldingSlingshotNearDL, "adultSlingshot", 13, gsSPDisplayListOTRFilePath(gLinkAdultRightHandClosedNearDL)); ResourceMgr_PatchGfxByName(gLinkChildLeftFistAndBoomerangNearDL, "adultBoomerang", 50, gsSPDisplayListOTRFilePath(gLinkAdultLeftHandClosedNearDL)); @@ -767,7 +767,7 @@ void RegisterPatchHandHandler() { void RegisterResetNaviTimer() { GameInteractor::Instance->RegisterGameHook([](int32_t sceneNum) { - if (CVarGetInteger("gEnhancements.ResetNaviTimer", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("ResetNaviTimer"), 0)) { gSaveContext.naviTimer = 0; } }); @@ -1021,16 +1021,16 @@ typedef enum { } AltTrapType; const char* altTrapTypeCvars[] = { - "gAddTraps.Ice", - "gAddTraps.Burn", - "gAddTraps.Shock", - "gAddTraps.Knock", - "gAddTraps.Speed", - "gAddTraps.Bomb", - "gAddTraps.Void", - "gAddTraps.Ammo", - "gAddTraps.Kill", - "gAddTraps.Tele" + CVAR_ENHANCEMENT("ExtraTraps.Ice"), + CVAR_ENHANCEMENT("ExtraTraps.Burn"), + CVAR_ENHANCEMENT("ExtraTraps.Shock"), + CVAR_ENHANCEMENT("ExtraTraps.Knockback"), + CVAR_ENHANCEMENT("ExtraTraps.Speed"), + CVAR_ENHANCEMENT("ExtraTraps.Bomb"), + CVAR_ENHANCEMENT("ExtraTraps.Void"), + CVAR_ENHANCEMENT("ExtraTraps.Ammo"), + CVAR_ENHANCEMENT("ExtraTraps.Kill"), + CVAR_ENHANCEMENT("ExtraTraps.Teleport") }; std::vector getEnabledAddTraps () { @@ -1052,7 +1052,7 @@ void RegisterAltTrapTypes() { static int eventTimer = -1; GameInteractor::Instance->RegisterGameHook([](GetItemEntry itemEntry) { - if (!CVarGetInteger("gAddTraps.enabled", 0) || itemEntry.modIndex != MOD_RANDOMIZER || itemEntry.getItemId != RG_ICE_TRAP) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("ExtraTraps.Enabled"), 0) || itemEntry.modIndex != MOD_RANDOMIZER || itemEntry.getItemId != RG_ICE_TRAP) { return; } roll = RandomElement(getEnabledAddTraps()); @@ -1195,7 +1195,7 @@ void UpdateHurtContainerModeState(bool newState) { void RegisterHurtContainerModeHandler() { GameInteractor::Instance->RegisterGameHook([](int32_t fileNum) { - UpdateHurtContainerModeState(CVarGetInteger("gHurtContainer", 0)); + UpdateHurtContainerModeState(CVarGetInteger(CVAR_ENHANCEMENT("HurtContainer"), 0)); }); } @@ -1214,7 +1214,7 @@ void RegisterRandomizedEnemySizes() { actor->id == ACTOR_BOSS_FD2 || actor->id == ACTOR_EN_DH; // Only apply to enemies and bosses. - if (!CVarGetInteger("gRandomizedEnemySizes", 0) || (actor->category != ACTORCAT_ENEMY && actor->category != ACTORCAT_BOSS) || excludedEnemy) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemySizes"), 0) || (actor->category != ACTORCAT_ENEMY && actor->category != ACTORCAT_BOSS) || excludedEnemy) { return; } @@ -1237,7 +1237,7 @@ void RegisterRandomizedEnemySizes() { Actor_SetScale(actor, actor->scale.z * randomScale); - if (CVarGetInteger("gEnemySizeScalesHealth", 0) && (actor->category == ACTORCAT_ENEMY)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("EnemySizeScalesHealth"), 0) && (actor->category == ACTORCAT_ENEMY)) { // Scale the health based on a smaller factor than randomScale float healthScalingFactor = 0.8f; // Adjust this factor as needed float scaledHealth = actor->colChkInfo.health * (randomScale * healthScalingFactor); @@ -1254,7 +1254,7 @@ void RegisterOpenAllHours() { GameInteractor::Instance->RegisterGameHook([](void* refActor) { Actor* actor = static_cast(refActor); - if (CVarGetInteger("gEnhancements.OpenAllHours", 0) && (actor->id == ACTOR_EN_DOOR)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("OpenAllHours"), 0) && (actor->id == ACTOR_EN_DOOR)) { switch (actor->params) { case 4753: // Night Market Bazaar case 1678: // Night Potion Shop @@ -1281,7 +1281,7 @@ void RegisterOpenAllHours() { void PatchToTMedallions() { // TODO: Refactor the DemoEffect_UpdateJewelAdult and DemoEffect_UpdateJewelChild from z_demo_effect // effects to take effect in there - if (CVarGetInteger("gToTMedallionsColors", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("ToTMedallionsColors"), 0)) { ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_StartGrayscale", 7, gsSPGrayscale(true)); ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007FD0, "ToTMedallions_2_StartGrayscale", 7, gsSPGrayscale(true)); @@ -1347,13 +1347,13 @@ void PatchToTMedallions() { void RegisterToTMedallions() { GameInteractor::Instance->RegisterGameHook([](GetItemEntry _unused) { - if (!CVarGetInteger("gToTMedallionsColors", 0) || !gPlayState || gPlayState->sceneNum != SCENE_TEMPLE_OF_TIME) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("ToTMedallionsColors"), 0) || !gPlayState || gPlayState->sceneNum != SCENE_TEMPLE_OF_TIME) { return; } PatchToTMedallions(); }); GameInteractor::Instance->RegisterGameHook([](int16_t sceneNum) { - if (!CVarGetInteger("gToTMedallionsColors", 0) || sceneNum != SCENE_TEMPLE_OF_TIME) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("ToTMedallionsColors"), 0) || sceneNum != SCENE_TEMPLE_OF_TIME) { return; } PatchToTMedallions(); @@ -1364,7 +1364,7 @@ void RegisterToTMedallions() { void RegisterFloorSwitchesHook() { GameInteractor::Instance->RegisterGameHook([](void* refActor) { Actor* actor = static_cast(refActor); - if (actor->id != ACTOR_OBJ_SWITCH || !CVarGetInteger("gEnhancements.FixFloorSwitches", 0)) { + if (actor->id != ACTOR_OBJ_SWITCH || !CVarGetInteger(CVAR_ENHANCEMENT("FixFloorSwitches"), 0)) { return; } @@ -1380,7 +1380,7 @@ void RegisterFloorSwitchesHook() { void RegisterPauseMenuHooks() { static bool pauseWarpHooksRegistered = false; GameInteractor::Instance->RegisterGameHook([&]() { - if (!GameInteractor::IsSaveLoaded() || !CVarGetInteger("gPauseWarp", 0)) { + if (!GameInteractor::IsSaveLoaded() || !CVarGetInteger(CVAR_ENHANCEMENT("PauseWarp"), 0)) { pauseWarpHooksRegistered = false; return; } diff --git a/soh/soh/Enhancements/presets.h b/soh/soh/Enhancements/presets.h index fc202b94f..930b89b80 100644 --- a/soh/soh/Enhancements/presets.h +++ b/soh/soh/Enhancements/presets.h @@ -66,219 +66,219 @@ const std::vector enhancementsCvars = { "gRStickOcarina", "gDpadEquips", "gPauseAnyCursor", - "gDpadNoDropOcarinaInput", + CVAR_ENHANCEMENT("DpadNoDropOcarinaInput"), "gNaviOnL", "gInvertXAxis", "gInvertYAxis", "gRightStickAiming", "gDisableAutoCenterViewFirstPerson", - "gTextSpeed", - "gMweepSpeed", - "gForgeTime", - "gClimbSpeed", - "gFasterBlockPush", - "gCrawlSpeed", - "gFasterHeavyBlockLift", - "gNoForcedNavi", - "gSkulltulaFreeze", - "gMMBunnyHood", - "gAdultBunnyHood", - "gFastChests", - "gChestSizeAndTextureMatchesContents", - "gFastDrops", - "gBetterOwl", - "gFastOcarinaPlayback", - "gInstantPutaway", - "gFastBoomerang", - "gAskToEquip", - "gMaskSelect", - "gRememberSaveLocation", - "gDamageMul", - "gFallDamageMul", - "gVoidDamageMul", - "gBonkDamageMul", - "gNoRandomDrops", - "gNoHeartDrops", - "gBombchuDrops", - "gGoronPot", - "gFullHealthSpawn", - "gDampeWin", - "gRedPotionEffect", - "gRedPotionHealth", - "gRedPercentRestore", - "gGreenPotionEffect", - "gGreenPotionMana", - "gGreenPercentRestore", - "gBluePotionEffects", - "gBluePotionHealth", - "gBlueHealthPercentRestore", - "gBluePotionMana", - "gBlueManaPercentRestore", - "gMilkEffect", - "gMilkHealth", - "gMilkPercentRestore", - "gSeparateHalfMilkEffect", - "gHalfMilkHealth", - "gHalfMilkPercentRestore", - "gFairyEffect", - "gFairyHealth", - "gFairyPercentRestore", - "gFairyReviveEffect", - "gFairyReviveHealth", - "gFairyRevivePercentRestore", - "gCustomizeFishing", - "gInstantFishing", - "gGuaranteeFishingBite", - "gFishNeverEscape", - "gChildMinimumWeightFish", - "gAdultMinimumWeightFish", - "gLowHpAlarm", - "gMinimalUI", - "gDisableNaviCallAudio", - "gVisualAgony", - "gAssignableTunicsAndBoots", - "gEquipmentCanBeRemoved", - "gCowOfTime", - "gGuardVision", - "gTimeFlowFileSelect", - "gInjectItemCounts", - "gDayGravePull", - "gDampeAllNight", - "gQuitFishingAtDoor", - "gSkipSwimDeepEndAnim", - "gSkipScarecrow", - "gBlueFireArrows", - "gSunlightArrows", - "gPauseLiveLinkRotation", - "gPauseLiveLink", - "gMinFrameCount", + CVAR_ENHANCEMENT("TextSpeed"), + CVAR_ENHANCEMENT("MweepSpeed"), + CVAR_ENHANCEMENT("ForgeTime"), + CVAR_ENHANCEMENT("ClimbSpeed"), + CVAR_ENHANCEMENT("FasterBlockPush"), + CVAR_ENHANCEMENT("CrawlSpeed"), + CVAR_ENHANCEMENT("FasterHeavyBlockLift"), + CVAR_ENHANCEMENT("NoForcedNavi"), + CVAR_ENHANCEMENT("SkulltulaFreeze"), + CVAR_ENHANCEMENT("MMBunnyHood"), + CVAR_ENHANCEMENT("AdultBunnyHood"), + CVAR_ENHANCEMENT("FastChests"), + CVAR_ENHANCEMENT("ChestSizeAndTextureMatchContents"), + CVAR_ENHANCEMENT("FastDrops"), + CVAR_ENHANCEMENT("BetterOwl"), + CVAR_ENHANCEMENT("FastOcarinaPlayback"), + CVAR_ENHANCEMENT("InstantPutaway"), + CVAR_ENHANCEMENT("FastBoomerang"), + CVAR_ENHANCEMENT("AskToEquip"), + CVAR_ENHANCEMENT("MaskSelect"), + CVAR_ENHANCEMENT("RememberSaveLocation"), + CVAR_ENHANCEMENT("DamageMult"), + CVAR_ENHANCEMENT("FallDamageMult"), + CVAR_ENHANCEMENT("VoidDamageMult"), + CVAR_ENHANCEMENT("BonkDamageMult"), + CVAR_ENHANCEMENT("NoRandomDrops"), + CVAR_ENHANCEMENT("NoHeartDrops"), + CVAR_ENHANCEMENT("BombchuDrops"), + CVAR_ENHANCEMENT("GoronPot"), + CVAR_ENHANCEMENT("FullHealthSpawn"), + CVAR_ENHANCEMENT("DampeWin"), + CVAR_ENHANCEMENT("RedPotionEffect"), + CVAR_ENHANCEMENT("RedPotionHealth"), + CVAR_ENHANCEMENT("RedPercentRestore"), + CVAR_ENHANCEMENT("GreenPotionEffect"), + CVAR_ENHANCEMENT("GreenPotionMana"), + CVAR_ENHANCEMENT("GreenPercentRestore"), + CVAR_ENHANCEMENT("BluePotionEffects"), + CVAR_ENHANCEMENT("BluePotionHealth"), + CVAR_ENHANCEMENT("BlueHealthPercentRestore"), + CVAR_ENHANCEMENT("BluePotionMana"), + CVAR_ENHANCEMENT("BlueManaPercentRestore"), + CVAR_ENHANCEMENT("MilkEffect"), + CVAR_ENHANCEMENT("MilkHealth"), + CVAR_ENHANCEMENT("MilkPercentRestore"), + CVAR_ENHANCEMENT("SeparateHalfMilkEffect"), + CVAR_ENHANCEMENT("HalfMilkHealth"), + CVAR_ENHANCEMENT("HalfMilkPercentRestore"), + CVAR_ENHANCEMENT("FairyEffect"), + CVAR_ENHANCEMENT("FairyHealth"), + CVAR_ENHANCEMENT("FairyPercentRestore"), + CVAR_ENHANCEMENT("FairyReviveEffect"), + CVAR_ENHANCEMENT("FairyReviveHealth"), + CVAR_ENHANCEMENT("FairyRevivePercentRestore"), + CVAR_ENHANCEMENT("CustomizeFishing"), + CVAR_ENHANCEMENT("InstantFishing"), + CVAR_ENHANCEMENT("GuaranteeFishingBite"), + CVAR_ENHANCEMENT("FishNeverEscape"), + CVAR_ENHANCEMENT("MinimumFishWeightChild"), + CVAR_ENHANCEMENT("MinimumFishWeightAdult"), + CVAR_ENHANCEMENT("LowHpAlarm"), + CVAR_ENHANCEMENT("MinimalUI"), + CVAR_ENHANCEMENT("DisableNaviCallAudio"), + CVAR_ENHANCEMENT("VisualAgony"), + CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), + CVAR_ENHANCEMENT("EquipmentCanBeRemoved"), + CVAR_ENHANCEMENT("CowOfTime"), + CVAR_ENHANCEMENT("GuardVision"), + CVAR_ENHANCEMENT("TimeFlowFileSelect"), + CVAR_ENHANCEMENT("InjectItemCounts"), + CVAR_ENHANCEMENT("DayGravePull"), + CVAR_ENHANCEMENT("DampeAllNight"), + CVAR_ENHANCEMENT("QuitFishingAtDoor"), + CVAR_ENHANCEMENT("SkipSwimDeepEndAnim"), + CVAR_ENHANCEMENT("InstantScarecrow"), + CVAR_ENHANCEMENT("BlueFireArrows"), + CVAR_ENHANCEMENT("SunlightArrows"), + CVAR_ENHANCEMENT("PauseLiveLinkRotation"), + CVAR_ENHANCEMENT("PauseLiveLink"), + CVAR_ENHANCEMENT("MinFrameCount"), "gN64Mode", - "gNewDrops", - "gDisableBlackBars", - "gDynamicWalletIcon", - "gAlwaysShowDungeonMinimapIcon", - "gUniformLR", - "gNGCKaleidoSwitcher", - "gFixDungeonMinimapIcon", - "gTwoHandedIdle", - "gGravediggingTourFix", - "gDekuNutUpgradeFix", - "gNaviTextFix", - "gAnubisFix", - "gCrouchStabHammerFix", - "gCrouchStabFix", - "gGerudoWarriorClothingFix", - "gFixCameraDrift", - "gFixCameraSwing", - "gFixHangingLedgeSwingRate", - "gRedGanonBlood", - "gHoverFishing", - "gN64WeirdFrames", - "gBombchusOOB", - "gQuickPutaway", - "gGsCutscene", - "gRestoreRBAValues", - "gSkipSaveConfirmation", - "gAutosave", - "gDisableCritWiggle", - "gChestSizeDependsStoneOfAgony", - "gSkipArrowAnimation", - "gSeparateArrows", - "gCustomizeShootingGallery", - "gInstantShootingGalleryWin", - "gConstantAdultGallery", - "gChildShootingGalleryAmmunition", - "gAdultShootingGalleryAmmunition", - "gCustomizeBombchuBowling", - "gBombchuBowlingNoSmallCucco", - "gBombchuBowlingNoBigCucco", - "gBombchuBowlingAmmunition", - "gCustomizeOcarinaGame", - "gInstantOcarinaGameWin", - "gOcarinaGameNoteSpeed", - "gOcarinaUnlimitedFailTime", - "gOcarinaGameStartingNotes", - "gOcarinaGameRoundOneNotes", - "gOcarinaGameRoundTwoNotes", - "gOcarinaGameRoundThreeNotes", - "gCreditsFix", - "gSilverRupeeJingleExtend", - "gStaticExplosionRadius", - "gNoInputForCredits", - "gFastFarores", - "gNightGSAlwaysSpawn", - "gSkipText", - "gLinkDefaultName", - "gMarketSneak", - "gTimeTravel", - "gNutsExplodeBombs", - "gBowSlingShotAmmoFix", - "gBetterFW", - "gDisableFirstPersonChus", - "gHyperBosses", - "gRupeeDash", - "gDashInterval", - "gDogFollowsEverywhere", - "gDisableTunicWarningText", - "gDisableLOD", - "gDisableDrawDistance", - "gDisableKokiriDrawDistance", + CVAR_ENHANCEMENT("NewDrops"), + CVAR_ENHANCEMENT("DisableBlackBars"), + CVAR_ENHANCEMENT("DynamicWalletIcon"), + CVAR_ENHANCEMENT("AlwaysShowDungeonMinimapIcon"), + CVAR_ENHANCEMENT("FixMenuLR"), + CVAR_ENHANCEMENT("NGCKaleidoSwitcher"), + CVAR_ENHANCEMENT("FixDungeonMinimapIcon"), + CVAR_ENHANCEMENT("TwoHandedIdle"), + CVAR_ENHANCEMENT("GravediggingTourFix"), + CVAR_ENHANCEMENT("DekuNutUpgradeFix"), + CVAR_ENHANCEMENT("NaviTextFix"), + CVAR_ENHANCEMENT("AnubixFix"), + CVAR_ENHANCEMENT("CrouchStabHammerFix"), + CVAR_ENHANCEMENT("CrouchStabFix"), + CVAR_ENHANCEMENT("GerudoWarriorClothingFix"), + CVAR_ENHANCEMENT("FixCameraDrift"), + CVAR_ENHANCEMENT("FixCameraSwing"), + CVAR_ENHANCEMENT("FixHangingLedgeSwingRate"), + CVAR_ENHANCEMENT("RedGanonBlood"), + CVAR_ENHANCEMENT("HoverFishing"), + CVAR_ENHANCEMENT("N64WeirdFrames"), + CVAR_ENHANCEMENT("BombchusOOB"), + CVAR_ENHANCEMENT("QuickPutaway"), + CVAR_ENHANCEMENT("GSCutscene"), + CVAR_ENHANCEMENT("RestoreRBAValues"), + CVAR_ENHANCEMENT("SkipSaveConfirmation"), + CVAR_ENHANCEMENT("Autosave"), + CVAR_ENHANCEMENT("DisableCritWiggle"), + CVAR_ENHANCEMENT("ChestSizeDependsStoneOfAgony"), + CVAR_ENHANCEMENT("SkipArrowAnimation"), + CVAR_ENHANCEMENT("SeparateArrows"), + CVAR_ENHANCEMENT("CustomizeShootingGallery"), + CVAR_ENHANCEMENT("InstantShootingGalleryWin"), + CVAR_ENHANCEMENT("ConstantAdultGallery"), + CVAR_ENHANCEMENT("ShootingGalleryAmmoChild"), + CVAR_ENHANCEMENT("ShootingGalleryAmmoAdult"), + CVAR_ENHANCEMENT("CustomizeBombchuBowling"), + CVAR_ENHANCEMENT("BombchuBowlingNoSmallCucco"), + CVAR_ENHANCEMENT("BombchuBowlingNoBigCucco"), + CVAR_ENHANCEMENT("BombchuBowlingAmmo"), + CVAR_ENHANCEMENT("CustomizeOcarinaGame"), + CVAR_ENHANCEMENT("InstantOcarinaGameWin"), + CVAR_ENHANCEMENT("OcarinaGame.NoteSpeed"), + CVAR_ENHANCEMENT("OcarinaUnlimitedFailTime"), + CVAR_ENHANCEMENT("OcarinaGame.StartingNotes"), + CVAR_ENHANCEMENT("OcarinaGame.RoundOneNotes"), + CVAR_ENHANCEMENT("OcarinaGame.RoundTwoNotes"), + CVAR_ENHANCEMENT("OcarinaGame.RoundThreeNotes"), + CVAR_ENHANCEMENT("CreditsFix"), + CVAR_ENHANCEMENT("SilverRupeeJingleExtend"), + CVAR_ENHANCEMENT("StaticExplosionRadius"), + CVAR_ENHANCEMENT("NoInputForCredits"), + CVAR_ENHANCEMENT("FastFarores"), + CVAR_ENHANCEMENT("NightGSAlwaysSpawn"), + CVAR_ENHANCEMENT("SkipText"), + CVAR_ENHANCEMENT("LinkDefaultName"), + CVAR_ENHANCEMENT("MarketSneak"), + CVAR_ENHANCEMENT("TimeTravel"), + CVAR_ENHANCEMENT("NutsExplodeBombs"), + CVAR_ENHANCEMENT("BowSlingshotAmmoFix"), + CVAR_ENHANCEMENT("BetterFarore"), + CVAR_ENHANCEMENT("DisableFirstPersonChus"), + CVAR_ENHANCEMENT("HyperBosses"), + CVAR_ENHANCEMENT("RupeeDash"), + CVAR_ENHANCEMENT("RupeeDashInterval"), + CVAR_ENHANCEMENT("DogFollowsEverywhere"), + CVAR_ENHANCEMENT("DisableTunicWarningText"), + CVAR_ENHANCEMENT("DisableLOD"), + CVAR_ENHANCEMENT("DisableDrawDistance"), + CVAR_ENHANCEMENT("DisableKokiriDrawDistance"), "gLowResMode", - "gDrawLineupTick", - "gQuickBongoKill", - "gFPSGauntlets", - "gSceneSpecificDirtPathFix", + CVAR_ENHANCEMENT("DrawLineupTick"), + CVAR_ENHANCEMENT("QuickBongoKill"), + CVAR_ENHANCEMENT("FirstPersonGauntlets"), + CVAR_ENHANCEMENT("SceneSpecificDirtPathFix"), "gZFightingMode", - "gAuthenticLogo", - "gPauseLiveLinkRotationSpeed", - "gBowReticle", - "gFixTexturesOOB", - "gIvanCoopModeEnabled", - "gEnemySpawnsOverWaterboxes", - "gTreeStickDrops", - "gShadowTag", - "gRandomizedEnemySizes", - "gRandomizedEnemies", - "gMirroredWorldMode", + CVAR_ENHANCEMENT("AuthenticLogo"), + CVAR_ENHANCEMENT("PauseLiveLinkRotationSpeed"), + CVAR_ENHANCEMENT("BowReticle"), + CVAR_ENHANCEMENT("FixTexturesOOB"), + CVAR_ENHANCEMENT("IvanCoopModeEnabled"), + CVAR_ENHANCEMENT("EnemySpawnsOverWaterboxes"), + CVAR_ENHANCEMENT("TreesDropSticks"), + CVAR_ENHANCEMENT("ShadowTag"), + CVAR_ENHANCEMENT("RandomizedEnemySizes"), + CVAR_ENHANCEMENT("RandomizedEnemies"), + CVAR_ENHANCEMENT("MirroredWorldMode"), "gMirroredWorld", - "gHyperEnemies", - "gHookshotableReticle", - "gHideBunnyHood", - "gFixVineFall", - "gFileSelectMoreInfo", - "gEnemyHealthBar", - "gBushDropFix", - "gAllDogsRichard", - "gAddTraps.enabled", - "gAddTraps.Ammo", - "gAddTraps.Bomb", - "gAddTraps.Burn", - "gAddTraps.Ice", - "gAddTraps.Kill", - "gAddTraps.Knock", - "gAddTraps.Shock", - "gAddTraps.Speed", - "gAddTraps.Tele", - "gAddTraps.Void", - "gToTMedallionsColors", - "gCuccoStayDurationMultiplier", - "gDeleteFileOnDeath", - "gEnemySizeScalesHealth", - "gEnhancements.BetterAmmoRendering", - "gEnhancements.EquimentAlwaysVisible", - "gEnhancements.FixDaruniaDanceSpeed", - "gEnhancements.OpenAllHours", - "gEnhancements.ResetNaviTimer", - "gEnhancements.ScaleAdultEquimentAsChild", - "gEnhancements.LeeverSpawnRate", - "gEnhancements.SwordToggle", - "gEnhancements.FixFloorSwitches", - "gFixZoraHintDialogue", - "gHurtContainer", - "gPauseWarp", - "gPermanentHeartLoss", - "gRemoveExplosiveLimit", - "gToggleStrength", + CVAR_ENHANCEMENT("HyperEnemies"), + CVAR_ENHANCEMENT("HookshotableReticle"), + CVAR_ENHANCEMENT("HideBunnyHood"), + CVAR_ENHANCEMENT("FixVineFall"), + CVAR_ENHANCEMENT("FileSelectMoreInfo"), + CVAR_ENHANCEMENT("EnemyHealthBar"), + CVAR_ENHANCEMENT("BushDropFix"), + CVAR_ENHANCEMENT("AllDogsRichard"), + CVAR_ENHANCEMENT("ExtraTraps.Enabled"), + CVAR_ENHANCEMENT("ExtraTraps.Ammo"), + CVAR_ENHANCEMENT("ExtraTraps.Bomb"), + CVAR_ENHANCEMENT("ExtraTraps.Burn"), + CVAR_ENHANCEMENT("ExtraTraps.Ice"), + CVAR_ENHANCEMENT("ExtraTraps.Kill"), + CVAR_ENHANCEMENT("ExtraTraps.Knockback"), + CVAR_ENHANCEMENT("ExtraTraps.Shock"), + CVAR_ENHANCEMENT("ExtraTraps.Speed"), + CVAR_ENHANCEMENT("ExtraTraps.Teleport"), + CVAR_ENHANCEMENT("ExtraTraps.Void"), + CVAR_ENHANCEMENT("ToTMedallionsColors"), + CVAR_ENHANCEMENT("CuccoStayDurationMult"), + CVAR_ENHANCEMENT("DeleteFileOnDeath"), + CVAR_ENHANCEMENT("EnemySizeScalesHealth"), + CVAR_ENHANCEMENT("BetterAmmoRendering"), + CVAR_ENHANCEMENT("EquimentAlwaysVisible"), + CVAR_ENHANCEMENT("FixDaruniaDanceSpeed"), + CVAR_ENHANCEMENT("OpenAllHours"), + CVAR_ENHANCEMENT("ResetNaviTimer"), + CVAR_ENHANCEMENT("ScaleAdultEquimentAsChild"), + CVAR_ENHANCEMENT("LeeverSpawnRate"), + CVAR_ENHANCEMENT("SwordToggle"), + CVAR_ENHANCEMENT("FixFloorSwitches"), + CVAR_ENHANCEMENT("FixZoraHintDialogue"), + CVAR_ENHANCEMENT("HurtContainer"), + CVAR_ENHANCEMENT("PauseWarp"), + CVAR_ENHANCEMENT("PermanentHeartLoss"), + CVAR_ENHANCEMENT("RemoveExplosiveLimit"), + CVAR_ENHANCEMENT("ToggleStrength"), }; const std::vector cheatCvars = { @@ -293,11 +293,11 @@ const std::vector cheatCvars = { "gWalkModifierTwo", "gSwimModifierOne", "gSwimModifierTwo", - "gGoronPot", - "gDampeWin", - "gCustomizeShootingGallery", - "gCustomizeBombchuBowling", - "gCustomizeFishing", + CVAR_ENHANCEMENT("GoronPot"), + CVAR_ENHANCEMENT("DampeWin"), + CVAR_ENHANCEMENT("CustomizeShootingGallery"), + CVAR_ENHANCEMENT("CustomizeBombchuBowling"), + CVAR_ENHANCEMENT("CustomizeFishing"), CVAR_CHEAT("InfiniteAmmo"), CVAR_CHEAT("InfiniteEponaBoost"), CVAR_CHEAT("InfiniteHealth"), @@ -351,7 +351,7 @@ const std::vector cheatCvars = { "gCosmetics.Link_HeadScale.Value", "gCosmetics.Link_SwordScale.Changed", "gCosmetics.Link_SwordScale.Value", - "gEnhancements.RememberMapToggleState", + CVAR_ENHANCEMENT("RememberMapToggleState"), }; const std::vector randomizerCvars = { @@ -501,65 +501,65 @@ const std::vector vanillaPlusPresetEntries = { // D-pad as Equip Items PRESET_ENTRY_S32("gDpadEquips", 1), // Prevent Dropped Ocarina Inputs - PRESET_ENTRY_S32("gDpadNoDropOcarinaInput", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadNoDropOcarinaInput"), 1), // Right Stick Aiming PRESET_ENTRY_S32("gRightStickAiming", 1), // Text Speed (1 to 5) - PRESET_ENTRY_S32("gTextSpeed", 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TextSpeed"), 5), // Skip Text - PRESET_ENTRY_S32("gSkipText", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipText"), 1), // King Zora Speed (1 to 5) - PRESET_ENTRY_S32("gMweepSpeed", 2), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MweepSpeed"), 2), // Faster Block Push (+0 to +5) - PRESET_ENTRY_S32("gFasterBlockPush", 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterBlockPush"), 5), // Better Owl - PRESET_ENTRY_S32("gBetterOwl", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterOwl"), 1), // Assignable Tunics and Boots - PRESET_ENTRY_S32("gAssignableTunicsAndBoots", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 1), // Enable passage of time on file select - PRESET_ENTRY_S32("gTimeFlowFileSelect", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeFlowFileSelect"), 1), // Inject Item Counts in messages - PRESET_ENTRY_S32("gInjectItemCounts", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts"), 1), // Pause link animation (0 to 16) - PRESET_ENTRY_S32("gPauseLiveLink", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PauseLiveLink"), 1), // Dynamic Wallet Icon - PRESET_ENTRY_S32("gDynamicWalletIcon", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DynamicWalletIcon"), 1), // Always show dungeon entrances - PRESET_ENTRY_S32("gAlwaysShowDungeonMinimapIcon", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AlwaysShowDungeonMinimapIcon"), 1), // Fix L&R Pause menu - PRESET_ENTRY_S32("gUniformLR", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixMenuLR"), 1), // Fix Dungeon entrances - PRESET_ENTRY_S32("gFixDungeonMinimapIcon", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixDungeonMinimapIcon"), 1), // Fix Two Handed idle animations - PRESET_ENTRY_S32("gTwoHandedIdle", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TwoHandedIdle"), 1), // Fix the Gravedigging Tour Glitch - PRESET_ENTRY_S32("gGravediggingTourFix", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GravediggingTourFix"), 1), // Fix Deku Nut upgrade - PRESET_ENTRY_S32("gDekuNutUpgradeFix", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DekuNutUpgradeFix"), 1), // Fix Navi text HUD position - PRESET_ENTRY_S32("gNaviTextFix", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NaviTextFix"), 1), // Extend Silver Rupee Jingle - PRESET_ENTRY_S32("gSilverRupeeJingleExtend", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SilverRupeeJingleExtend"), 1), // Fix some Floor Switches - PRESET_ENTRY_S32("gEnhancements.FixFloorSwitches", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixFloorSwitches"), 1), // Red Ganon blood - PRESET_ENTRY_S32("gRedGanonBlood", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("RedGanonBlood"), 1), // Fish while hovering - PRESET_ENTRY_S32("gHoverFishing", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("HoverFishing"), 1), // N64 Weird Frames - PRESET_ENTRY_S32("gN64WeirdFrames", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("N64WeirdFrames"), 1), // Bombchus out of bounds - PRESET_ENTRY_S32("gBombchusOOB", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BombchusOOB"), 1), // Quick Putaway - PRESET_ENTRY_S32("gQuickPutaway", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("QuickPutaway"), 1), // Skip save confirmation - PRESET_ENTRY_S32("gSkipSaveConfirmation", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipSaveConfirmation"), 1), }; const std::vector enhancedPresetEntries = { @@ -572,123 +572,123 @@ const std::vector enhancedPresetEntries = { // D-pad as Equip Items PRESET_ENTRY_S32("gDpadEquips", 1), // Prevent Dropped Ocarina Inputs - PRESET_ENTRY_S32("gDpadNoDropOcarinaInput", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadNoDropOcarinaInput"), 1), // Right Stick Aiming PRESET_ENTRY_S32("gRightStickAiming", 1), // Text Speed (1 to 5) - PRESET_ENTRY_S32("gTextSpeed", 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TextSpeed"), 5), // Skip Text - PRESET_ENTRY_S32("gSkipText", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipText"), 1), // King Zora Speed (1 to 5) - PRESET_ENTRY_S32("gMweepSpeed", 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MweepSpeed"), 5), // Faster Block Push (+0 to +5) - PRESET_ENTRY_S32("gFasterBlockPush", 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterBlockPush"), 5), // Better Owl - PRESET_ENTRY_S32("gBetterOwl", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterOwl"), 1), // Assignable Tunics and Boots - PRESET_ENTRY_S32("gAssignableTunicsAndBoots", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 1), // Enable passage of time on file select - PRESET_ENTRY_S32("gTimeFlowFileSelect", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeFlowFileSelect"), 1), // Inject Item Counts in messages - PRESET_ENTRY_S32("gInjectItemCounts", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts"), 1), // Pause link animation (0 to 16) - PRESET_ENTRY_S32("gPauseLiveLink", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PauseLiveLink"), 1), // Dynamic Wallet Icon - PRESET_ENTRY_S32("gDynamicWalletIcon", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DynamicWalletIcon"), 1), // Always show dungeon entrances - PRESET_ENTRY_S32("gAlwaysShowDungeonMinimapIcon", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AlwaysShowDungeonMinimapIcon"), 1), // Fix L&R Pause menu - PRESET_ENTRY_S32("gUniformLR", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixMenuLR"), 1), // Fix Dungeon entrances - PRESET_ENTRY_S32("gFixDungeonMinimapIcon", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixDungeonMinimapIcon"), 1), // Fix Two Handed idle animations - PRESET_ENTRY_S32("gTwoHandedIdle", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TwoHandedIdle"), 1), // Fix the Gravedigging Tour Glitch - PRESET_ENTRY_S32("gGravediggingTourFix", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GravediggingTourFix"), 1), // Fix Deku Nut upgrade - PRESET_ENTRY_S32("gDekuNutUpgradeFix", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DekuNutUpgradeFix"), 1), // Fix Navi text HUD position - PRESET_ENTRY_S32("gNaviTextFix", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NaviTextFix"), 1), // Extend Silver Rupee Jingle - PRESET_ENTRY_S32("gSilverRupeeJingleExtend", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SilverRupeeJingleExtend"), 1), // Fix enemies not spawning on ground over water - PRESET_ENTRY_S32("gEnemySpawnsOverWaterboxes", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EnemySpawnsOverWaterboxes"), 1), // Fix some Floor Switches - PRESET_ENTRY_S32("gEnhancements.FixFloorSwitches", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixFloorSwitches"), 1), // Red Ganon blood - PRESET_ENTRY_S32("gRedGanonBlood", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("RedGanonBlood"), 1), // Fish while hovering - PRESET_ENTRY_S32("gHoverFishing", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("HoverFishing"), 1), // N64 Weird Frames - PRESET_ENTRY_S32("gN64WeirdFrames", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("N64WeirdFrames"), 1), // Bombchus out of bounds - PRESET_ENTRY_S32("gBombchusOOB", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BombchusOOB"), 1), // Quick Putaway - PRESET_ENTRY_S32("gQuickPutaway", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("QuickPutaway"), 1), // Skip save confirmation - PRESET_ENTRY_S32("gSkipSaveConfirmation", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipSaveConfirmation"), 1), // Biggoron Forge Time (0 to 3) - PRESET_ENTRY_S32("gForgeTime", 0), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ForgeTime"), 0), // Vine/Ladder Climb speed (+0 to +12) - PRESET_ENTRY_S32("gClimbSpeed", 3), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ClimbSpeed"), 3), // Faster Heavy Block Lift - PRESET_ENTRY_S32("gFasterHeavyBlockLift", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 1), // No Forced Navi - PRESET_ENTRY_S32("gNoForcedNavi", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoForcedNavi"), 1), // No Skulltula Freeze - PRESET_ENTRY_S32("gSkulltulaFreeze", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkulltulaFreeze"), 1), // MM Bunny Hood - PRESET_ENTRY_S32("gMMBunnyHood", BUNNY_HOOD_FAST_AND_JUMP), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_FAST_AND_JUMP), // Adult Bunny Hood - PRESET_ENTRY_S32("gAdultBunnyHood", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AdultBunnyHood"), 1), // Fast Chests - PRESET_ENTRY_S32("gFastChests", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastChests"), 1), // Fast Drops - PRESET_ENTRY_S32("gFastDrops", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastDrops"), 1), // Fast Ocarina Playback - PRESET_ENTRY_S32("gFastOcarinaPlayback", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastOcarinaPlayback"), 1), // Instant Putaway - PRESET_ENTRY_S32("gInstantPutaway", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantPutaway"), 1), // Instant Boomerang Recall - PRESET_ENTRY_S32("gFastBoomerang", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastBoomerang"), 1), // Nuts Explode Bombs - PRESET_ENTRY_S32("gNutsExplodeBombs", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NutsExplodeBombs"), 1), // Ask to Equip New Items - PRESET_ENTRY_S32("gAskToEquip", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AskToEquip"), 1), // Mask Select in Inventory - PRESET_ENTRY_S32("gMaskSelect", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MaskSelect"), 1), // Always Win Goron Pot - PRESET_ENTRY_S32("gGoronPot", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GoronPot"), 1), // Always Win Dampe Digging - PRESET_ENTRY_S32("gDampeWin", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DampeWin"), 1), // Skip Magic Arrow Equip Animation - PRESET_ENTRY_S32("gSkipArrowAnimation", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipArrowAnimation"), 1), // Equip arrows on multiple slots - PRESET_ENTRY_S32("gSeparateArrows", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SeparateArrows"), 1), // Disable Navi Call Audio - PRESET_ENTRY_S32("gDisableNaviCallAudio", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DisableNaviCallAudio"), 1), // Equipment Toggle - PRESET_ENTRY_S32("gEquipmentCanBeRemoved", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EquipmentCanBeRemoved"), 1), // Link's Cow in Both Time Periods - PRESET_ENTRY_S32("gCowOfTime", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CowOfTime"), 1), // Enable 3D Dropped items/projectiles - PRESET_ENTRY_S32("gNewDrops", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NewDrops"), 1), // Fix Anubis fireballs - PRESET_ENTRY_S32("gAnubisFix", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AnubixFix"), 1), // Autosave - PRESET_ENTRY_S32("gAutosave", AUTOSAVE_LOCATION_AND_MAJOR_ITEMS), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("Autosave"), AUTOSAVE_LOCATION_AND_MAJOR_ITEMS), }; const std::vector randomizerPresetEntries = { @@ -701,206 +701,206 @@ const std::vector randomizerPresetEntries = { // D-pad as Equip Items PRESET_ENTRY_S32("gDpadEquips", 1), // Prevent Dropped Ocarina Inputs - PRESET_ENTRY_S32("gDpadNoDropOcarinaInput", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadNoDropOcarinaInput"), 1), // Right Stick Aiming PRESET_ENTRY_S32("gRightStickAiming", 1), // Text Speed (1 to 5) - PRESET_ENTRY_S32("gTextSpeed", 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TextSpeed"), 5), // Skip Text - PRESET_ENTRY_S32("gSkipText", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipText"), 1), // King Zora Speed (1 to 5) - PRESET_ENTRY_S32("gMweepSpeed", 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MweepSpeed"), 5), // Faster Block Push (+0 to +5) - PRESET_ENTRY_S32("gFasterBlockPush", 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterBlockPush"), 5), // Better Owl - PRESET_ENTRY_S32("gBetterOwl", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterOwl"), 1), // Assignable Tunics and Boots - PRESET_ENTRY_S32("gAssignableTunicsAndBoots", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 1), // Enable passage of time on file select - PRESET_ENTRY_S32("gTimeFlowFileSelect", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeFlowFileSelect"), 1), // Inject Item Counts in messages - PRESET_ENTRY_S32("gInjectItemCounts", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts"), 1), // Dynamic Wallet Icon - PRESET_ENTRY_S32("gDynamicWalletIcon", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DynamicWalletIcon"), 1), // Always show dungeon entrances - PRESET_ENTRY_S32("gAlwaysShowDungeonMinimapIcon", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AlwaysShowDungeonMinimapIcon"), 1), // Fix L&R Pause menu - PRESET_ENTRY_S32("gUniformLR", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixMenuLR"), 1), // Fix Dungeon entrances - PRESET_ENTRY_S32("gFixDungeonMinimapIcon", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixDungeonMinimapIcon"), 1), // Fix Two Handed idle animations - PRESET_ENTRY_S32("gTwoHandedIdle", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TwoHandedIdle"), 1), // Fix the Gravedigging Tour Glitch - PRESET_ENTRY_S32("gGravediggingTourFix", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GravediggingTourFix"), 1), // Fix Deku Nut upgrade - PRESET_ENTRY_S32("gDekuNutUpgradeFix", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DekuNutUpgradeFix"), 1), // Fix Navi text HUD position - PRESET_ENTRY_S32("gNaviTextFix", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NaviTextFix"), 1), // Extend Silver Rupee Jingle - PRESET_ENTRY_S32("gSilverRupeeJingleExtend", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SilverRupeeJingleExtend"), 1), // Fix some Floor Switches - PRESET_ENTRY_S32("gEnhancements.FixFloorSwitches", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixFloorSwitches"), 1), // Red Ganon blood - PRESET_ENTRY_S32("gRedGanonBlood", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("RedGanonBlood"), 1), // Fish while hovering - PRESET_ENTRY_S32("gHoverFishing", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("HoverFishing"), 1), // N64 Weird Frames - PRESET_ENTRY_S32("gN64WeirdFrames", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("N64WeirdFrames"), 1), // Bombchus out of bounds - PRESET_ENTRY_S32("gBombchusOOB", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BombchusOOB"), 1), // Quick Putaway - PRESET_ENTRY_S32("gQuickPutaway", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("QuickPutaway"), 1), // Skip save confirmation - PRESET_ENTRY_S32("gSkipSaveConfirmation", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipSaveConfirmation"), 1), // Biggoron Forge Time (0 to 3) - PRESET_ENTRY_S32("gForgeTime", 0), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ForgeTime"), 0), // Vine/Ladder Climb speed (+0 to +12) - PRESET_ENTRY_S32("gClimbSpeed", 3), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ClimbSpeed"), 3), // Faster Heavy Block Lift - PRESET_ENTRY_S32("gFasterHeavyBlockLift", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 1), // No Forced Navi - PRESET_ENTRY_S32("gNoForcedNavi", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoForcedNavi"), 1), // No Skulltula Freeze - PRESET_ENTRY_S32("gSkulltulaFreeze", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkulltulaFreeze"), 1), // MM Bunny Hood - PRESET_ENTRY_S32("gMMBunnyHood", BUNNY_HOOD_FAST_AND_JUMP), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_FAST_AND_JUMP), // Adult Bunny Hood - PRESET_ENTRY_S32("gAdultBunnyHood", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AdultBunnyHood"), 1), // Fast Chests - PRESET_ENTRY_S32("gFastChests", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastChests"), 1), // Fast Drops - PRESET_ENTRY_S32("gFastDrops", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastDrops"), 1), // Fast Ocarina Playback - PRESET_ENTRY_S32("gFastOcarinaPlayback", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastOcarinaPlayback"), 1), // Instant Putaway - PRESET_ENTRY_S32("gInstantPutaway", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantPutaway"), 1), // Instant Boomerang Recall - PRESET_ENTRY_S32("gFastBoomerang", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastBoomerang"), 1), // Nuts Explode Bombs - PRESET_ENTRY_S32("gNutsExplodeBombs", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NutsExplodeBombs"), 1), // Ask to Equip New Items - PRESET_ENTRY_S32("gAskToEquip", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AskToEquip"), 1), // Mask Select in Inventory - PRESET_ENTRY_S32("gMaskSelect", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MaskSelect"), 1), // Always Win Goron Pot - PRESET_ENTRY_S32("gGoronPot", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GoronPot"), 1), // Always Win Dampe Digging - PRESET_ENTRY_S32("gDampeWin", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DampeWin"), 1), // Skip Magic Arrow Equip Animation - PRESET_ENTRY_S32("gSkipArrowAnimation", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipArrowAnimation"), 1), // Exit Market at Night - PRESET_ENTRY_S32("gMarketSneak", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MarketSneak"), 1), // Equip arrows on multiple slots - PRESET_ENTRY_S32("gSeparateArrows", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SeparateArrows"), 1), // Disable Navi Call Audio - PRESET_ENTRY_S32("gDisableNaviCallAudio", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DisableNaviCallAudio"), 1), // Equipment Toggle - PRESET_ENTRY_S32("gEquipmentCanBeRemoved", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EquipmentCanBeRemoved"), 1), // Link's Cow in Both Time Periods - PRESET_ENTRY_S32("gCowOfTime", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CowOfTime"), 1), // Enable 3D Dropped items/projectiles - PRESET_ENTRY_S32("gNewDrops", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NewDrops"), 1), // Fix Anubis fireballs - PRESET_ENTRY_S32("gAnubisFix", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AnubixFix"), 1), // Autosave - PRESET_ENTRY_S32("gAutosave", AUTOSAVE_LOCATION_AND_MAJOR_ITEMS), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("Autosave"), AUTOSAVE_LOCATION_AND_MAJOR_ITEMS), // Customize Fishing Behaviour - PRESET_ENTRY_S32("gCustomizeFishing", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeFishing"), 1), // Guarantee Bite - PRESET_ENTRY_S32("gGuaranteeFishingBite", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GuaranteeFishingBite"), 1), // Fish Never Escape - PRESET_ENTRY_S32("gFishNeverEscape", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FishNeverEscape"), 1), // Child Minimum Weight (6 to 10) - PRESET_ENTRY_S32("gChildMinimumWeightFish", 3), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MinimumFishWeightChild"), 3), // Adult Minimum Weight (8 to 13) - PRESET_ENTRY_S32("gAdultMinimumWeightFish", 6), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MinimumFishWeightAdult"), 6), // Customize Lost Woods Ocarina Game Behavior - PRESET_ENTRY_S32("gCustomizeOcarinaGame", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeOcarinaGame"), 1), // Start With Five Notes - PRESET_ENTRY_S32("gOcarinaGameStartingNotes", 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("OcarinaGame.StartingNotes"), 5), // Round One Notes - PRESET_ENTRY_S32("gOcarinaGameRoundOneNotes", 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("OcarinaGame.RoundOneNotes"), 5), // Visual Stone of Agony - PRESET_ENTRY_S32("gVisualAgony", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("VisualAgony"), 1), // Pull grave during the day - PRESET_ENTRY_S32("gDayGravePull", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DayGravePull"), 1), // Pull out Ocarina to Summon Scarecrow - PRESET_ENTRY_S32("gSkipScarecrow", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantScarecrow"), 1), // Chest size & texture matches contents - PRESET_ENTRY_S32("gChestSizeAndTextureMatchesContents", CSMC_BOTH), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ChestSizeAndTextureMatchContents"), CSMC_BOTH), // Color Temple of Time's Medallions - PRESET_ENTRY_S32("gToTMedallionsColors", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ToTMedallionsColors"), 1), // Pause link animation (0 to 16) - PRESET_ENTRY_S32("gPauseLiveLink", 16), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PauseLiveLink"), 16), // Frames to wait - PRESET_ENTRY_S32("gMinFrameCount", 200), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MinFrameCount"), 200), - PRESET_ENTRY_S32("gNoInputForCredits", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoInputForCredits"), 1), - PRESET_ENTRY_S32("gFastFarores", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastFarores"), 1), }; const std::vector spockRacePresetEntries = { PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LogicRules"), 0), - PRESET_ENTRY_S32("gTextSpeed", 5), - PRESET_ENTRY_S32("gMweepSpeed", 5), - PRESET_ENTRY_S32("gClimbSpeed", 4), - PRESET_ENTRY_S32("gFasterBlockPush", 5), - PRESET_ENTRY_S32("gFasterHeavyBlockLift", 1), - PRESET_ENTRY_S32("gNoForcedNavi", 1), - PRESET_ENTRY_S32("gDisableNaviCallAudio", 1), - PRESET_ENTRY_S32("gFastChests", 1), - PRESET_ENTRY_S32("gFastDrops", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TextSpeed"), 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MweepSpeed"), 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ClimbSpeed"), 4), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterBlockPush"), 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoForcedNavi"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DisableNaviCallAudio"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastChests"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastDrops"), 1), PRESET_ENTRY_S32("gDpadText", 1), PRESET_ENTRY_S32("gDpadOcarina", 1), PRESET_ENTRY_S32("gRStickOcarina", 1), PRESET_ENTRY_S32("gDpadEquips", 1), - PRESET_ENTRY_S32("gFastOcarinaPlayback", 1), - PRESET_ENTRY_S32("gSkipScarecrow", 1), - PRESET_ENTRY_S32("gMarketSneak", 1), - PRESET_ENTRY_S32("gInstantPutaway", 1), - PRESET_ENTRY_S32("gFastBoomerang", 1), - PRESET_ENTRY_S32("gAdultBunnyHood", 1), - PRESET_ENTRY_S32("gMMBunnyHood", BUNNY_HOOD_FAST), - PRESET_ENTRY_S32("gSeparateArrows", 1), - PRESET_ENTRY_S32("gAssignableTunicsAndBoots", 1), - PRESET_ENTRY_S32("gEquipmentCanBeRemoved", 1), - PRESET_ENTRY_S32("gDayGravePull", 1), - PRESET_ENTRY_S32("gNewDrops", 1), - PRESET_ENTRY_S32("gCreditsFix", 1), - PRESET_ENTRY_S32("gSkipText", 1), - PRESET_ENTRY_S32("gSkulltulaFreeze", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastOcarinaPlayback"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantScarecrow"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MarketSneak"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantPutaway"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastBoomerang"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AdultBunnyHood"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_FAST), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SeparateArrows"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EquipmentCanBeRemoved"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DayGravePull"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NewDrops"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CreditsFix"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipText"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkulltulaFreeze"), 1), PRESET_ENTRY_S32("gPauseAnyCursor", 1), - PRESET_ENTRY_S32("gFastFarores", 1), - PRESET_ENTRY_S32("gNoInputForCredits", 1), - PRESET_ENTRY_S32("gMaskSelect", 1), - PRESET_ENTRY_S32("gInjectItemCounts", 1), - PRESET_ENTRY_S32("gCustomizeFishing", 1), - PRESET_ENTRY_S32("gFishNeverEscape", 1), - PRESET_ENTRY_S32("gInstantFishing", 1), - PRESET_ENTRY_S32("gGuaranteeFishingBite", 1), - PRESET_ENTRY_S32("gAdultMinimumWeightFish", 6), - PRESET_ENTRY_S32("gChildMinimumWeightFish", 3), - PRESET_ENTRY_S32("gGoronPot", 1), - PRESET_ENTRY_S32("gForgeTime", 0), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastFarores"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoInputForCredits"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MaskSelect"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeFishing"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FishNeverEscape"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantFishing"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GuaranteeFishingBite"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MinimumFishWeightAdult"), 6), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MinimumFishWeightChild"), 3), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GoronPot"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ForgeTime"), 0), PRESET_ENTRY_S32(CVAR_CHEAT("EasyPauseBuffer"), 1), - PRESET_ENTRY_S32("gDampeAllNight", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DampeAllNight"), 1), PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("10GSHint"), 1), PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("20GSHint"), 1), PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("30GSHint"), 1), @@ -944,41 +944,41 @@ const std::vector spockRacePresetEntries = { }; const std::vector spockRaceNoLogicPresetEntries = { - PRESET_ENTRY_S32("gAdultBunnyHood", 1), - PRESET_ENTRY_S32("gAdultMinimumWeightFish", 6), - PRESET_ENTRY_S32("gAssignableTunicsAndBoots", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AdultBunnyHood"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MinimumFishWeightAdult"), 6), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 1), PRESET_ENTRY_S32(CVAR_CHEAT("EasyPauseBuffer"), 1), - PRESET_ENTRY_S32("gChildMinimumWeightFish", 3), - PRESET_ENTRY_S32("gClimbSpeed", 4), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MinimumFishWeightChild"), 3), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ClimbSpeed"), 4), PRESET_ENTRY_S32("gCosmetics.Goron_NeckLength", 1000), - PRESET_ENTRY_S32("gCreditsFix", 1), - PRESET_ENTRY_S32("gCustomizeFishing", 1), - PRESET_ENTRY_S32("gDampeAllNight", 1), - PRESET_ENTRY_S32("gDayGravePull", 1), - PRESET_ENTRY_S32("gDisableNaviCallAudio", 1), - PRESET_ENTRY_S32("gDpadNoDropOcarinaInput", 1), - PRESET_ENTRY_S32("gEquipmentCanBeRemoved", 1), - PRESET_ENTRY_S32("gFastBoomerang", 1), - PRESET_ENTRY_S32("gFastChests", 1), - PRESET_ENTRY_S32("gFastDrops", 1), - PRESET_ENTRY_S32("gFastFarores", 1), - PRESET_ENTRY_S32("gFastOcarinaPlayback", 1), - PRESET_ENTRY_S32("gFasterBlockPush", 5), - PRESET_ENTRY_S32("gFasterHeavyBlockLift", 1), - PRESET_ENTRY_S32("gFishNeverEscape", 1), - PRESET_ENTRY_S32("gForgeTime", 0), - PRESET_ENTRY_S32("gGoronPot", 1), - PRESET_ENTRY_S32("gGuaranteeFishingBite", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CreditsFix"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeFishing"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DampeAllNight"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DayGravePull"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DisableNaviCallAudio"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadNoDropOcarinaInput"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EquipmentCanBeRemoved"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastBoomerang"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastChests"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastDrops"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastFarores"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastOcarinaPlayback"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterBlockPush"), 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FishNeverEscape"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ForgeTime"), 0), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GoronPot"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GuaranteeFishingBite"), 1), PRESET_ENTRY_S32("gHideBuildInfo", 1), - PRESET_ENTRY_S32("gInjectItemCounts", 1), - PRESET_ENTRY_S32("gInstantFishing", 1), - PRESET_ENTRY_S32("gInstantPutaway", 1), - PRESET_ENTRY_S32("gMMBunnyHood", BUNNY_HOOD_FAST), - PRESET_ENTRY_S32("gMarketSneak", 1), - PRESET_ENTRY_S32("gMaskSelect", 1), - PRESET_ENTRY_S32("gMweepSpeed", 5), - PRESET_ENTRY_S32("gNoForcedNavi", 1), - PRESET_ENTRY_S32("gNoInputForCredits", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantFishing"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantPutaway"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_FAST), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MarketSneak"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MaskSelect"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MweepSpeed"), 5), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoForcedNavi"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoInputForCredits"), 1), PRESET_ENTRY_S32("gPauseAnyCursor", 1), PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("10GSHint"), 1), PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("20GSHint"), 1), @@ -1029,16 +1029,16 @@ const std::vector spockRaceNoLogicPresetEntries = { PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingMapsCompasses"), RO_DUNGEON_ITEM_LOC_STARTWITH), PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingOcarina"), 1), PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SunlightArrows"), 1), - PRESET_ENTRY_S32("gSeparateArrows", 1), - PRESET_ENTRY_S32("gSkipScarecrow", 1), - PRESET_ENTRY_S32("gSkulltulaFreeze", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SeparateArrows"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantScarecrow"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkulltulaFreeze"), 1), }; const std::vector s6PresetEntries = { - PRESET_ENTRY_S32("gChestSizeAndTextureMatchesContents", CSMC_BOTH), - PRESET_ENTRY_S32("gFastChests", 1), - PRESET_ENTRY_S32("gMMBunnyHood", BUNNY_HOOD_FAST), - PRESET_ENTRY_S32("gAdultBunnyHood", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ChestSizeAndTextureMatchContents"), CSMC_BOTH), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastChests"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_FAST), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AdultBunnyHood"), 1), PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BigPoeTargetCount"), 1), PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CuccosToReturn"), 4), PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DoorOfTime"), RO_DOOROFTIME_OPEN), @@ -1069,10 +1069,10 @@ const std::vector s6PresetEntries = { }; const std::vector hellModePresetEntries = { - PRESET_ENTRY_S32("gChestSizeAndTextureMatchesContents", CSMC_BOTH), - PRESET_ENTRY_S32("gFastChests", 1), - PRESET_ENTRY_S32("gMMBunnyHood", BUNNY_HOOD_FAST), - PRESET_ENTRY_S32("gAdultBunnyHood", 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ChestSizeAndTextureMatchContents"), CSMC_BOTH), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastChests"), 1), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_FAST), + PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AdultBunnyHood"), 1), PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BigPoeTargetCount"), 1), PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BlueFireArrows"), 1), PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BossKeysanity"), RO_DUNGEON_ITEM_LOC_ANYWHERE), diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp index 9d747c063..ba8aab9fb 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp @@ -459,7 +459,7 @@ bool HasItemBeenCollected(RandomizerCheck rc) { case SpoilerCollectionCheckType::SPOILER_CHK_GRAVEDIGGER: // Gravedigger has a fix in place that means one of two save locations. Check both. return (gSaveContext.itemGetInf[1] & 0x1000) || // vanilla flag - ((IS_RANDO || CVarGetInteger("gGravediggingTourFix", 0)) && + ((IS_RANDO || CVarGetInteger(CVAR_ENHANCEMENT("GravediggingTourFix"), 0)) && gSaveContext.sceneFlags[scene].collect & (1 << flag) || (gPlayState->actorCtx.flags.collect & (1 << flag))); // rando/fix flag default: return false; diff --git a/soh/soh/Enhancements/randomizer/randomizer_entrance.c b/soh/soh/Enhancements/randomizer/randomizer_entrance.c index bf1eaa8e1..d5a23b7ff 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_entrance.c +++ b/soh/soh/Enhancements/randomizer/randomizer_entrance.c @@ -394,7 +394,7 @@ void Entrance_SetSavewarpEntrance(void) { gSaveContext.entranceIndex = ENTR_THIEVES_HIDEOUT_0; // Gerudo Fortress -> Thieve's Hideout spawn 0 } else if (scene == SCENE_LINKS_HOUSE) { gSaveContext.entranceIndex = Entrance_OverrideNextIndex(ENTR_LINKS_HOUSE_0); - } else if (CVarGetInteger("gRememberSaveLocation", 0) && scene != SCENE_FAIRYS_FOUNTAIN && scene != SCENE_GROTTOS && + } else if (CVarGetInteger(CVAR_ENHANCEMENT("RememberSaveLocation"), 0) && scene != SCENE_FAIRYS_FOUNTAIN && scene != SCENE_GROTTOS && gSaveContext.entranceIndex != ENTR_LOAD_OPENING) { // Use the saved entrance value with remember save location, except when in grottos/fairy fountains or if // the entrance index is -1 (new save) diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index f5d504afa..5b0ef431d 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -2597,7 +2597,7 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) { } } if (textId == TEXT_GS_NO_FREEZE || textId == TEXT_GS_FREEZE) { - if (CVarGetInteger("gInjectItemCounts", 0) != 0) { + if (CVarGetInteger(CVAR_ENHANCEMENT("InjectItemCounts"), 0) != 0) { // The freeze text cannot be manually dismissed and must be auto-dismissed. // This is fine and even wanted when skull tokens are not shuffled, but when // when they are shuffled we don't want to be able to manually dismiss the box. @@ -2605,7 +2605,7 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) { // animation until the text box auto-dismisses. // RANDOTODO: Implement a way to determine if an item came from a skulltula and // inject the auto-dismiss control code if it did. - if (CVarGetInteger("gSkulltulaFreeze", 0) != 0 && + if (CVarGetInteger(CVAR_ENHANCEMENT("SkulltulaFreeze"), 0) != 0 && !(IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_TOKENS) != RO_TOKENSANITY_OFF)) { textId = TEXT_GS_NO_FREEZE; } else { @@ -2618,18 +2618,18 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) { messageEntry.Replace("{{gsCount}}", std::to_string(gsCount)); } } - if (textId == TEXT_HEART_CONTAINER && CVarGetInteger("gInjectItemCounts", 0)) { + if (textId == TEXT_HEART_CONTAINER && CVarGetInteger(CVAR_ENHANCEMENT("InjectItemCounts"), 0)) { messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, TEXT_HEART_CONTAINER); messageEntry.Replace("{{heartContainerCount}}", std::to_string(gSaveContext.sohStats.heartContainers + 1)); } - if (textId == TEXT_HEART_PIECE && CVarGetInteger("gInjectItemCounts", 0)) { + if (textId == TEXT_HEART_PIECE && CVarGetInteger(CVAR_ENHANCEMENT("InjectItemCounts"), 0)) { messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, TEXT_HEART_PIECE); messageEntry.Replace("{{heartPieceCount}}", std::to_string(gSaveContext.sohStats.heartPieces + 1)); } - if (textId == TEXT_MARKET_GUARD_NIGHT && CVarGetInteger("gMarketSneak", 0) && play->sceneNum == SCENE_MARKET_ENTRANCE_NIGHT) { + if (textId == TEXT_MARKET_GUARD_NIGHT && CVarGetInteger(CVAR_ENHANCEMENT("MarketSneak"), 0) && play->sceneNum == SCENE_MARKET_ENTRANCE_NIGHT) { messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, TEXT_MARKET_GUARD_NIGHT); } - if (textId == TEXT_FISHERMAN_LEAVE && CVarGetInteger("gQuitFishingAtDoor", 0)) { + if (textId == TEXT_FISHERMAN_LEAVE && CVarGetInteger(CVAR_ENHANCEMENT("QuitFishingAtDoor"), 0)) { messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, TEXT_FISHERMAN_LEAVE); } font->charTexBuf[0] = (messageEntry.GetTextBoxType() << 4) | messageEntry.GetTextBoxPosition(); diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index 2169e3d02..b577caee5 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -566,30 +566,30 @@ void DrawEnhancementsMenu() { ImGui::Text("Speed-ups:"); UIWidgets::PaddedSeparator(); - UIWidgets::PaddedEnhancementSliderInt("Text Speed: %dx", "##TEXTSPEED", "gTextSpeed", 1, 5, "", 1, true, false, true); - UIWidgets::PaddedEnhancementCheckbox("Skip Text", "gSkipText", false, true); + UIWidgets::PaddedEnhancementSliderInt("Text Speed: %dx", "##TEXTSPEED", CVAR_ENHANCEMENT("TextSpeed"), 1, 5, "", 1, true, false, true); + UIWidgets::PaddedEnhancementCheckbox("Skip Text", CVAR_ENHANCEMENT("SkipText"), false, true); UIWidgets::Tooltip("Holding down B skips text"); - UIWidgets::PaddedEnhancementSliderInt("King Zora Speed: %dx", "##MWEEPSPEED", "gMweepSpeed", 1, 5, "", 1, true, false, true); - UIWidgets::PaddedEnhancementSliderInt("Vine/Ladder Climb speed +%d", "##CLIMBSPEED", "gClimbSpeed", 0, 12, "", 0, true, false, true); - UIWidgets::PaddedEnhancementSliderInt("Block pushing speed +%d", "##BLOCKSPEED", "gFasterBlockPush", 0, 5, "", 0, true, false, true); - UIWidgets::PaddedEnhancementSliderInt("Crawl speed %dx", "##CRAWLSPEED", "gCrawlSpeed", 1, 5, "", 1, true, false, true); - UIWidgets::PaddedEnhancementCheckbox("Faster Heavy Block Lift", "gFasterHeavyBlockLift", false, false); + UIWidgets::PaddedEnhancementSliderInt("King Zora Speed: %dx", "##MWEEPSPEED", CVAR_ENHANCEMENT("MweepSpeed"), 1, 5, "", 1, true, false, true); + UIWidgets::PaddedEnhancementSliderInt("Vine/Ladder Climb speed +%d", "##CLIMBSPEED", CVAR_ENHANCEMENT("ClimbSpeed"), 0, 12, "", 0, true, false, true); + UIWidgets::PaddedEnhancementSliderInt("Block pushing speed +%d", "##BLOCKSPEED", CVAR_ENHANCEMENT("FasterBlockPush"), 0, 5, "", 0, true, false, true); + UIWidgets::PaddedEnhancementSliderInt("Crawl speed %dx", "##CRAWLSPEED", CVAR_ENHANCEMENT("CrawlSpeed"), 1, 5, "", 1, true, false, true); + UIWidgets::PaddedEnhancementCheckbox("Faster Heavy Block Lift", CVAR_ENHANCEMENT("FasterHeavyBlockLift"), false, false); UIWidgets::Tooltip("Speeds up lifting silver rocks and obelisks"); - UIWidgets::PaddedEnhancementCheckbox("Skip Pickup Messages", "gFastDrops", true, false); + UIWidgets::PaddedEnhancementCheckbox("Skip Pickup Messages", CVAR_ENHANCEMENT("FastDrops"), true, false); UIWidgets::Tooltip("Skip pickup messages for new consumable items and bottle swipes"); - UIWidgets::PaddedEnhancementCheckbox("Fast Ocarina Playback", "gFastOcarinaPlayback", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fast Ocarina Playback", CVAR_ENHANCEMENT("FastOcarinaPlayback"), true, false); UIWidgets::Tooltip("Skip the part where the Ocarina playback is called when you play a song"); bool forceSkipScarecrow = IS_RANDO && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SKIP_SCARECROWS_SONG); static const char* forceSkipScarecrowText = "This setting is forcefully enabled because a savefile\nwith \"Skip Scarecrow Song\" is loaded"; - UIWidgets::PaddedEnhancementCheckbox("Skip Scarecrow Song", "gSkipScarecrow", true, false, + UIWidgets::PaddedEnhancementCheckbox("Skip Scarecrow Song", CVAR_ENHANCEMENT("InstantScarecrow"), true, false, forceSkipScarecrow, forceSkipScarecrowText, UIWidgets::CheckboxGraphics::Checkmark); UIWidgets::Tooltip("Pierre appears when Ocarina is pulled out. Requires learning scarecrow song."); - UIWidgets::PaddedEnhancementCheckbox("Skip Magic Arrow Equip Animation", "gSkipArrowAnimation", true, false); - UIWidgets::PaddedEnhancementCheckbox("Skip save confirmation", "gSkipSaveConfirmation", true, false); + UIWidgets::PaddedEnhancementCheckbox("Skip Magic Arrow Equip Animation", CVAR_ENHANCEMENT("SkipArrowAnimation"), true, false); + UIWidgets::PaddedEnhancementCheckbox("Skip save confirmation", CVAR_ENHANCEMENT("SkipSaveConfirmation"), true, false); UIWidgets::Tooltip("Skip the \"Game saved.\" confirmation screen"); - UIWidgets::PaddedEnhancementCheckbox("Faster Farore's Wind", "gFastFarores", true, false); + UIWidgets::PaddedEnhancementCheckbox("Faster Farore's Wind", CVAR_ENHANCEMENT("FastFarores"), true, false); UIWidgets::Tooltip("Greatly decreases cast time of Farore's Wind magic spell."); - UIWidgets::PaddedEnhancementCheckbox("Skip water take breath animation", "gSkipSwimDeepEndAnim", true, false); + UIWidgets::PaddedEnhancementCheckbox("Skip water take breath animation", CVAR_ENHANCEMENT("SkipSwimDeepEndAnim"), true, false); UIWidgets::Tooltip("Skips Link's taking breath animation after coming up from water. This setting does not interfere with getting items from underwater."); ImGui::TableNextColumn(); @@ -597,27 +597,27 @@ void DrawEnhancementsMenu() { ImGui::Text("Changes:"); UIWidgets::PaddedSeparator(); - UIWidgets::PaddedEnhancementSliderInt("Biggoron Forge Time: %d days", "##FORGETIME", "gForgeTime", 0, 3, "", 3, true, false, true); + UIWidgets::PaddedEnhancementSliderInt("Biggoron Forge Time: %d days", "##FORGETIME", CVAR_ENHANCEMENT("ForgeTime"), 0, 3, "", 3, true, false, true); UIWidgets::Tooltip("Allows you to change the number of days it takes for Biggoron to forge the Biggoron Sword"); - UIWidgets::PaddedEnhancementCheckbox("Remember Save Location", "gRememberSaveLocation", false, false); + UIWidgets::PaddedEnhancementCheckbox("Remember Save Location", CVAR_ENHANCEMENT("RememberSaveLocation"), false, false); UIWidgets::Tooltip("When loading a save, places Link at the last entrance he went through.\n" "This doesn't work if the save was made in grottos/fairy fountains or dungeons."); - UIWidgets::PaddedEnhancementCheckbox("No Forced Navi", "gNoForcedNavi", true, false); + UIWidgets::PaddedEnhancementCheckbox("No Forced Navi", CVAR_ENHANCEMENT("NoForcedNavi"), true, false); UIWidgets::Tooltip("Prevent forced Navi conversations"); - UIWidgets::PaddedEnhancementCheckbox("Navi Timer Resets", "gEnhancements.ResetNaviTimer", true, false); + UIWidgets::PaddedEnhancementCheckbox("Navi Timer Resets", CVAR_ENHANCEMENT("ResetNaviTimer"), true, false); UIWidgets::Tooltip("Resets the Navi timer on scene change. If you have already talked to her, she will try and talk to you again, instead of needing a save warp or death. "); - UIWidgets::PaddedEnhancementCheckbox("No Skulltula Freeze", "gSkulltulaFreeze", true, false); + UIWidgets::PaddedEnhancementCheckbox("No Skulltula Freeze", CVAR_ENHANCEMENT("SkulltulaFreeze"), true, false); UIWidgets::Tooltip("Stops the game from freezing the player when picking up Gold Skulltulas"); - UIWidgets::PaddedEnhancementCheckbox("Nighttime GS Always Spawn", "gNightGSAlwaysSpawn", true, false); + UIWidgets::PaddedEnhancementCheckbox("Nighttime GS Always Spawn", CVAR_ENHANCEMENT("NightGSAlwaysSpawn"), true, false); UIWidgets::Tooltip("Nighttime Skulltulas will spawn during both day and night."); - UIWidgets::PaddedEnhancementCheckbox("Dampe Appears All Night", "gDampeAllNight", true, false); + UIWidgets::PaddedEnhancementCheckbox("Dampe Appears All Night", CVAR_ENHANCEMENT("DampeAllNight"), true, false); UIWidgets::Tooltip("Makes Dampe appear anytime during the night, not just his usual working hours."); - UIWidgets::PaddedEnhancementCheckbox("Fast Chests", "gFastChests", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fast Chests", CVAR_ENHANCEMENT("FastChests"), true, false); UIWidgets::Tooltip("Kick open every chest"); UIWidgets::PaddedText("Chest size & texture matches contents", true, false); - if (UIWidgets::EnhancementCombobox("gChestSizeAndTextureMatchesContents", chestStyleMatchesContentsOptions, CSMC_DISABLED)) { - if (CVarGetInteger("gChestSizeAndTextureMatchesContents", CSMC_DISABLED) == CSMC_DISABLED) { - CVarSetInteger("gChestSizeDependsStoneOfAgony", 0); + if (UIWidgets::EnhancementCombobox(CVAR_ENHANCEMENT("ChestSizeAndTextureMatchContents"), chestStyleMatchesContentsOptions, CSMC_DISABLED)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("ChestSizeAndTextureMatchContents"), CSMC_DISABLED) == CSMC_DISABLED) { + CVarSetInteger(CVAR_ENHANCEMENT("ChestSizeDependsStoneOfAgony"), 0); } } UIWidgets::Tooltip( @@ -631,24 +631,24 @@ void DrawEnhancementsMenu() { "\n" "NOTE: Textures will not apply if you are using a mod pack with a custom chest model." ); - if (CVarGetInteger("gChestSizeAndTextureMatchesContents", CSMC_DISABLED) != CSMC_DISABLED) { - UIWidgets::PaddedEnhancementCheckbox("Chests of Agony", "gChestSizeDependsStoneOfAgony", true, false); + if (CVarGetInteger(CVAR_ENHANCEMENT("ChestSizeAndTextureMatchContents"), CSMC_DISABLED) != CSMC_DISABLED) { + UIWidgets::PaddedEnhancementCheckbox("Chests of Agony", CVAR_ENHANCEMENT("ChestSizeDependsStoneOfAgony"), true, false); UIWidgets::Tooltip("Only change the size/texture of chests if you have the Stone of Agony."); } - UIWidgets::PaddedEnhancementCheckbox("Ask to Equip New Items", "gAskToEquip", true, false); + UIWidgets::PaddedEnhancementCheckbox("Ask to Equip New Items", CVAR_ENHANCEMENT("AskToEquip"), true, false); UIWidgets::Tooltip("Adds a prompt to equip newly-obtained swords, shields and tunics"); - UIWidgets::PaddedEnhancementCheckbox("Better Owl", "gBetterOwl", true, false); + UIWidgets::PaddedEnhancementCheckbox("Better Owl", CVAR_ENHANCEMENT("BetterOwl"), true, false); UIWidgets::Tooltip("The default response to Kaepora Gaebora is always that you understood what he said"); - UIWidgets::PaddedEnhancementCheckbox("Exit Market at Night", "gMarketSneak", true, false); + UIWidgets::PaddedEnhancementCheckbox("Exit Market at Night", CVAR_ENHANCEMENT("MarketSneak"), true, false); UIWidgets::Tooltip("Allows exiting Hyrule Castle Market Town to Hyrule Field at night by speaking to the guard next to the gate."); - UIWidgets::PaddedEnhancementCheckbox("Shops and Games Always Open", "gEnhancements.OpenAllHours", true, false); + UIWidgets::PaddedEnhancementCheckbox("Shops and Games Always Open", CVAR_ENHANCEMENT("OpenAllHours"), true, false); UIWidgets::Tooltip("Shops and minigames are open both day and night. Requires scene reload to take effect."); - UIWidgets::PaddedEnhancementCheckbox("Link as default file name", "gLinkDefaultName", true, false); + UIWidgets::PaddedEnhancementCheckbox("Link as default file name", CVAR_ENHANCEMENT("LinkDefaultName"), true, false); UIWidgets::Tooltip("Allows you to have \"Link\" as a premade file name"); - UIWidgets::PaddedEnhancementCheckbox("Quit Fishing At Door", "gQuitFishingAtDoor", true, false); + UIWidgets::PaddedEnhancementCheckbox("Quit Fishing At Door", CVAR_ENHANCEMENT("QuitFishingAtDoor"), true, false); UIWidgets::Tooltip("Fisherman asks if you want to quit at the door when you still have the rod"); UIWidgets::PaddedText("Time Travel with the Song of Time", true, false); - UIWidgets::EnhancementCombobox("gTimeTravel", timeTravelOptions, 0); + UIWidgets::EnhancementCombobox(CVAR_ENHANCEMENT("TimeTravel"), timeTravelOptions, 0); UIWidgets::Tooltip("Allows Link to freely change age by playing the Song of Time.\n" "Time Blocks can still be used properly.\n\n" "Requirements:\n" @@ -657,7 +657,7 @@ void DrawEnhancementsMenu() { "- Obtained the Master Sword\n" "- Not within range of Time Block\n" "- Not within range of Ocarina playing spots"); - UIWidgets::PaddedEnhancementCheckbox("Pause Warp", "gPauseWarp", true, false); + UIWidgets::PaddedEnhancementCheckbox("Pause Warp", CVAR_ENHANCEMENT("PauseWarp"), true, false); UIWidgets::Tooltip("Selection of warp song in pause menu initiates warp. Disables song playback."); ImGui::EndTable(); @@ -668,41 +668,41 @@ void DrawEnhancementsMenu() { if (ImGui::BeginMenu("Items")) { - UIWidgets::PaddedEnhancementCheckbox("Instant Putaway", "gInstantPutaway", true, false); + UIWidgets::PaddedEnhancementCheckbox("Instant Putaway", CVAR_ENHANCEMENT("InstantPutaway"), true, false); UIWidgets::Tooltip("Allow Link to put items away without having to wait around"); - UIWidgets::PaddedEnhancementCheckbox("Instant Boomerang Recall", "gFastBoomerang", true, false); + UIWidgets::PaddedEnhancementCheckbox("Instant Boomerang Recall", CVAR_ENHANCEMENT("FastBoomerang"), true, false); UIWidgets::Tooltip("Instantly return the boomerang to Link by pressing its item button while it's in the air"); - UIWidgets::PaddedEnhancementCheckbox("Prevent Dropped Ocarina Inputs", "gDpadNoDropOcarinaInput", true, false); + UIWidgets::PaddedEnhancementCheckbox("Prevent Dropped Ocarina Inputs", CVAR_ENHANCEMENT("DpadNoDropOcarinaInput"), true, false); UIWidgets::Tooltip("Prevent dropping inputs when playing the ocarina quickly"); UIWidgets::PaddedText("Bunny Hood Effect", true, false); - UIWidgets::EnhancementCombobox("gMMBunnyHood", bunnyHoodOptions, BUNNY_HOOD_VANILLA); + UIWidgets::EnhancementCombobox(CVAR_ENHANCEMENT("MMBunnyHood"), bunnyHoodOptions, BUNNY_HOOD_VANILLA); UIWidgets::Tooltip( "Wearing the Bunny Hood grants a speed increase like in Majora's Mask. The longer jump option is not accounted for in randomizer logic.\n\n" "Also disables NPC's reactions to wearing the Bunny Hood." ); - UIWidgets::PaddedEnhancementCheckbox("Bunny Hood Equippable as Adult", "gAdultBunnyHood", true, false, (CVarGetInteger("gMMBunnyHood", BUNNY_HOOD_VANILLA) == BUNNY_HOOD_VANILLA), "Only available with increased bunny hood speed", UIWidgets::CheckboxGraphics::Cross, false); + UIWidgets::PaddedEnhancementCheckbox("Bunny Hood Equippable as Adult", CVAR_ENHANCEMENT("AdultBunnyHood"), true, false, (CVarGetInteger(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_VANILLA) == BUNNY_HOOD_VANILLA), "Only available with increased bunny hood speed", UIWidgets::CheckboxGraphics::Cross, false); UIWidgets::Tooltip("Allows the bunny hood to be equipped normally from the pause menu as adult."); - UIWidgets::PaddedEnhancementCheckbox("Mask Select in Inventory", "gMaskSelect", true, false); + UIWidgets::PaddedEnhancementCheckbox("Mask Select in Inventory", CVAR_ENHANCEMENT("MaskSelect"), true, false); UIWidgets::Tooltip("After completing the mask trading sub-quest, press A and any direction on the mask slot to change masks"); - UIWidgets::PaddedEnhancementCheckbox("Nuts explode bombs", "gNutsExplodeBombs", true, false); + UIWidgets::PaddedEnhancementCheckbox("Nuts explode bombs", CVAR_ENHANCEMENT("NutsExplodeBombs"), true, false); UIWidgets::Tooltip("Makes nuts explode bombs, similar to how they interact with bombchus. This does not affect bombflowers."); - UIWidgets::PaddedEnhancementCheckbox("Equip Multiple Arrows at Once", "gSeparateArrows", true, false); + UIWidgets::PaddedEnhancementCheckbox("Equip Multiple Arrows at Once", CVAR_ENHANCEMENT("SeparateArrows"), true, false); UIWidgets::Tooltip("Allow the bow and magic arrows to be equipped at the same time on different slots. (Note this will disable the behaviour of the 'Equip Dupe' glitch)"); - UIWidgets::PaddedEnhancementCheckbox("Bow as Child/Slingshot as Adult", "gBowSlingShotAmmoFix", true, false); + UIWidgets::PaddedEnhancementCheckbox("Bow as Child/Slingshot as Adult", CVAR_ENHANCEMENT("BowSlingshotAmmoFix"), true, false); UIWidgets::Tooltip("Allows child to use bow with arrows.\nAllows adult to use slingshot with seeds.\n\nRequires glitches or 'Timeless Equipment' cheat to equip."); - UIWidgets::PaddedEnhancementCheckbox("Better Farore's Wind", "gBetterFW", true, false); + UIWidgets::PaddedEnhancementCheckbox("Better Farore's Wind", CVAR_ENHANCEMENT("BetterFarore"), true, false); UIWidgets::Tooltip("Helps FW persist between ages, gives child and adult separate FW points, and can be used in more places."); - UIWidgets::PaddedEnhancementCheckbox("Remove Explosive Limit", "gRemoveExplosiveLimit", true, false); + UIWidgets::PaddedEnhancementCheckbox("Remove Explosive Limit", CVAR_ENHANCEMENT("RemoveExplosiveLimit"), true, false); UIWidgets::Tooltip("Removes the cap of 3 active explosives being deployed at once."); - UIWidgets::PaddedEnhancementCheckbox("Static Explosion Radius", "gStaticExplosionRadius", true, false); + UIWidgets::PaddedEnhancementCheckbox("Static Explosion Radius", CVAR_ENHANCEMENT("StaticExplosionRadius"), true, false); UIWidgets::Tooltip("Explosions are now a static size, like in Majora's Mask and OoT3D. Makes bombchu hovering much easier."); - UIWidgets::PaddedEnhancementCheckbox("Prevent Bombchus Forcing First-Person", "gDisableFirstPersonChus", true, false); + UIWidgets::PaddedEnhancementCheckbox("Prevent Bombchus Forcing First-Person", CVAR_ENHANCEMENT("DisableFirstPersonChus"), true, false); UIWidgets::Tooltip("Prevent bombchus from forcing the camera into first-person mode when released."); - UIWidgets::PaddedEnhancementCheckbox("Aiming reticle for the bow/slingshot", "gBowReticle", true, false); + UIWidgets::PaddedEnhancementCheckbox("Aiming reticle for the bow/slingshot", CVAR_ENHANCEMENT("BowReticle"), true, false); UIWidgets::Tooltip("Aiming with a bow or slingshot will display a reticle as with the hookshot when the projectile is ready to fire."); - if (UIWidgets::PaddedEnhancementCheckbox("Allow strength equipment to be toggled", "gToggleStrength", true, false)) { - if (!CVarGetInteger("gToggleStrength", 0)) { - CVarSetInteger("gStrengthDisabled", 0); + if (UIWidgets::PaddedEnhancementCheckbox("Allow strength equipment to be toggled", CVAR_ENHANCEMENT("ToggleStrength"), true, false)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("ToggleStrength"), 0)) { + CVarSetInteger(CVAR_ENHANCEMENT("StrengthDisabled"), 0); } } UIWidgets::Tooltip("Allows strength to be toggled on and off by pressing A on the strength upgrade in the equipment subscreen of the pause menu (This allows performing some glitches that require the player to not have strength)."); @@ -715,86 +715,86 @@ void DrawEnhancementsMenu() { { if (ImGui::BeginMenu("Potion Values")) { - UIWidgets::EnhancementCheckbox("Change Red Potion Effect", "gRedPotionEffect"); + UIWidgets::EnhancementCheckbox("Change Red Potion Effect", CVAR_ENHANCEMENT("RedPotionEffect")); UIWidgets::Tooltip("Enable the following changes to the amount of health restored by Red Potions"); - bool disabledRedPotion = !CVarGetInteger("gRedPotionEffect", 0); + bool disabledRedPotion = !CVarGetInteger(CVAR_ENHANCEMENT("RedPotionEffect"), 0); static const char* disabledTooltipRedPotion = "This option is disabled because \"Change Red Potion Effect\" is turned off"; - UIWidgets::EnhancementSliderInt("Red Potion Health: %d", "##REDPOTIONHEALTH", "gRedPotionHealth", 1, 100, "", 0, true, disabledRedPotion, disabledTooltipRedPotion); + UIWidgets::EnhancementSliderInt("Red Potion Health: %d", "##REDPOTIONHEALTH", CVAR_ENHANCEMENT("RedPotionHealth"), 1, 100, "", 0, true, disabledRedPotion, disabledTooltipRedPotion); UIWidgets::Tooltip("Changes the amount of health restored by Red Potions"); - UIWidgets::EnhancementCheckbox("Red Potion Percent Restore", "gRedPercentRestore", disabledRedPotion, disabledTooltipRedPotion); + UIWidgets::EnhancementCheckbox("Red Potion Percent Restore", CVAR_ENHANCEMENT("RedPercentRestore"), disabledRedPotion, disabledTooltipRedPotion); UIWidgets::Tooltip("Toggles from Red Potions restoring a fixed amount of health to a percent of the player's current max health"); ImGui::Separator(); - UIWidgets::EnhancementCheckbox("Change Green Potion Effect", "gGreenPotionEffect"); + UIWidgets::EnhancementCheckbox("Change Green Potion Effect", CVAR_ENHANCEMENT("GreenPotionEffect")); UIWidgets::Tooltip("Enable the following changes to the amount of mana restored by Green Potions"); - bool disabledGreenPotion = !CVarGetInteger("gGreenPotionEffect", 0); + bool disabledGreenPotion = !CVarGetInteger(CVAR_ENHANCEMENT("GreenPotionEffect"), 0); static const char* disabledTooltipGreenPotion = "This option is disabled because \"Change Green Potion Effect\" is turned off"; - UIWidgets::EnhancementSliderInt("Green Potion Mana: %d", "##GREENPOTIONMANA", "gGreenPotionMana", 1, 100, "", 0, true, disabledGreenPotion, disabledTooltipGreenPotion); + UIWidgets::EnhancementSliderInt("Green Potion Mana: %d", "##GREENPOTIONMANA", CVAR_ENHANCEMENT("GreenPotionMana"), 1, 100, "", 0, true, disabledGreenPotion, disabledTooltipGreenPotion); UIWidgets::Tooltip("Changes the amount of mana restored by Green Potions, base max mana is 48, max upgraded mana is 96"); - UIWidgets::EnhancementCheckbox("Green Potion Percent Restore", "gGreenPercentRestore", disabledGreenPotion, disabledTooltipGreenPotion); + UIWidgets::EnhancementCheckbox("Green Potion Percent Restore", CVAR_ENHANCEMENT("GreenPercentRestore"), disabledGreenPotion, disabledTooltipGreenPotion); UIWidgets::Tooltip("Toggles from Green Potions restoring a fixed amount of mana to a percent of the player's current max mana"); ImGui::Separator(); - UIWidgets::EnhancementCheckbox("Change Blue Potion Effects", "gBluePotionEffects"); + UIWidgets::EnhancementCheckbox("Change Blue Potion Effects", CVAR_ENHANCEMENT("BluePotionEffects")); UIWidgets::Tooltip("Enable the following changes to the amount of health and mana restored by Blue Potions"); - bool disabledBluePotion = !CVarGetInteger("gBluePotionEffects", 0); + bool disabledBluePotion = !CVarGetInteger(CVAR_ENHANCEMENT("BluePotionEffects"), 0); static const char* disabledTooltipBluePotion = "This option is disabled because \"Change Blue Potion Effects\" is turned off"; - UIWidgets::EnhancementSliderInt("Blue Potion Health: %d", "##BLUEPOTIONHEALTH", "gBluePotionHealth", 1, 100, "", 0, true, disabledBluePotion, disabledTooltipBluePotion); + UIWidgets::EnhancementSliderInt("Blue Potion Health: %d", "##BLUEPOTIONHEALTH", CVAR_ENHANCEMENT("BluePotionHealth"), 1, 100, "", 0, true, disabledBluePotion, disabledTooltipBluePotion); UIWidgets::Tooltip("Changes the amount of health restored by Blue Potions"); - UIWidgets::EnhancementCheckbox("Blue Potion Health Percent Restore", "gBlueHealthPercentRestore", disabledBluePotion, disabledTooltipBluePotion); + UIWidgets::EnhancementCheckbox("Blue Potion Health Percent Restore", CVAR_ENHANCEMENT("BlueHealthPercentRestore"), disabledBluePotion, disabledTooltipBluePotion); UIWidgets::Tooltip("Toggles from Blue Potions restoring a fixed amount of health to a percent of the player's current max health"); ImGui::Separator(); - UIWidgets::EnhancementSliderInt("Blue Potion Mana: %d", "##BLUEPOTIONMANA", "gBluePotionMana", 1, 100, "", 0, true, disabledBluePotion, disabledTooltipBluePotion); + UIWidgets::EnhancementSliderInt("Blue Potion Mana: %d", "##BLUEPOTIONMANA", CVAR_ENHANCEMENT("BluePotionMana"), 1, 100, "", 0, true, disabledBluePotion, disabledTooltipBluePotion); UIWidgets::Tooltip("Changes the amount of mana restored by Blue Potions, base max mana is 48, max upgraded mana is 96"); - UIWidgets::EnhancementCheckbox("Blue Potion Mana Percent Restore", "gBlueManaPercentRestore", disabledBluePotion, disabledTooltipBluePotion); + UIWidgets::EnhancementCheckbox("Blue Potion Mana Percent Restore", CVAR_ENHANCEMENT("BlueManaPercentRestore"), disabledBluePotion, disabledTooltipBluePotion); UIWidgets::Tooltip("Toggles from Blue Potions restoring a fixed amount of mana to a percent of the player's current max mana"); ImGui::Separator(); - UIWidgets::EnhancementCheckbox("Change Milk Effect", "gMilkEffect"); + UIWidgets::EnhancementCheckbox("Change Milk Effect", CVAR_ENHANCEMENT("MilkEffect")); UIWidgets::Tooltip("Enable the following changes to the amount of health restored by Milk"); - bool disabledMilk = !CVarGetInteger("gMilkEffect", 0); + bool disabledMilk = !CVarGetInteger(CVAR_ENHANCEMENT("MilkEffect"), 0); static const char* disabledTooltipMilk = "This option is disabled because \"Change Milk Effect\" is turned off"; - UIWidgets::EnhancementSliderInt("Milk Health: %d", "##MILKHEALTH", "gMilkHealth", 1, 100, "", 0, true, disabledMilk, disabledTooltipMilk); + UIWidgets::EnhancementSliderInt("Milk Health: %d", "##MILKHEALTH", CVAR_ENHANCEMENT("MilkHealth"), 1, 100, "", 0, true, disabledMilk, disabledTooltipMilk); UIWidgets::Tooltip("Changes the amount of health restored by Milk"); - UIWidgets::EnhancementCheckbox("Milk Percent Restore", "gMilkPercentRestore", disabledMilk, disabledTooltipMilk); + UIWidgets::EnhancementCheckbox("Milk Percent Restore", CVAR_ENHANCEMENT("MilkPercentRestore"), disabledMilk, disabledTooltipMilk); UIWidgets::Tooltip("Toggles from Milk restoring a fixed amount of health to a percent of the player's current max health"); ImGui::Separator(); - UIWidgets::EnhancementCheckbox("Separate Half Milk Effect", "gSeparateHalfMilkEffect", disabledMilk, disabledTooltipMilk); + UIWidgets::EnhancementCheckbox("Separate Half Milk Effect", CVAR_ENHANCEMENT("SeparateHalfMilkEffect"), disabledMilk, disabledTooltipMilk); UIWidgets::Tooltip("Enable the following changes to the amount of health restored by Half Milk\nIf this is disabled, Half Milk will behave the same as Full Milk."); - bool disabledHalfMilk = disabledMilk || !CVarGetInteger("gSeparateHalfMilkEffect", 0); + bool disabledHalfMilk = disabledMilk || !CVarGetInteger(CVAR_ENHANCEMENT("SeparateHalfMilkEffect"), 0); static const char* disabledTooltipHalfMilk = "This option is disabled because \"Separate Half Milk Effect\" is turned off"; - UIWidgets::EnhancementSliderInt("Half Milk Health: %d", "##HALFMILKHEALTH", "gHalfMilkHealth", 1, 100, "", 0, true, disabledHalfMilk, disabledTooltipHalfMilk); + UIWidgets::EnhancementSliderInt("Half Milk Health: %d", "##HALFMILKHEALTH", CVAR_ENHANCEMENT("HalfMilkHealth"), 1, 100, "", 0, true, disabledHalfMilk, disabledTooltipHalfMilk); UIWidgets::Tooltip("Changes the amount of health restored by Half Milk"); - UIWidgets::EnhancementCheckbox("Half Milk Percent Restore", "gHalfMilkPercentRestore", disabledHalfMilk, disabledTooltipHalfMilk); + UIWidgets::EnhancementCheckbox("Half Milk Percent Restore", CVAR_ENHANCEMENT("HalfMilkPercentRestore"), disabledHalfMilk, disabledTooltipHalfMilk); UIWidgets::Tooltip("Toggles from Half Milk restoring a fixed amount of health to a percent of the player's current max health"); ImGui::Separator(); - UIWidgets::EnhancementCheckbox("Change Fairy Effect", "gFairyEffect"); + UIWidgets::EnhancementCheckbox("Change Fairy Effect", CVAR_ENHANCEMENT("FairyEffect")); UIWidgets::Tooltip("Enable the following changes to the amount of health restored by Fairies"); - bool disabledFairy = !CVarGetInteger("gFairyEffect", 0); + bool disabledFairy = !CVarGetInteger(CVAR_ENHANCEMENT("FairyEffect"), 0); static const char* disabledTooltipFairy = "This option is disabled because \"Change Fairy Effect\" is turned off"; - UIWidgets::EnhancementSliderInt("Fairy: %d", "##FAIRYHEALTH", "gFairyHealth", 1, 100, "", 0, true, disabledFairy, disabledTooltipFairy); + UIWidgets::EnhancementSliderInt("Fairy: %d", "##FAIRYHEALTH", CVAR_ENHANCEMENT("FairyHealth"), 1, 100, "", 0, true, disabledFairy, disabledTooltipFairy); UIWidgets::Tooltip("Changes the amount of health restored by Fairies"); - UIWidgets::EnhancementCheckbox("Fairy Percent Restore", "gFairyPercentRestore", disabledFairy, disabledTooltipFairy); + UIWidgets::EnhancementCheckbox("Fairy Percent Restore", CVAR_ENHANCEMENT("FairyPercentRestore"), disabledFairy, disabledTooltipFairy); UIWidgets::Tooltip("Toggles from Fairies restoring a fixed amount of health to a percent of the player's current max health"); ImGui::Separator(); - UIWidgets::EnhancementCheckbox("Change Fairy Revive Effect", "gFairyReviveEffect"); + UIWidgets::EnhancementCheckbox("Change Fairy Revive Effect", CVAR_ENHANCEMENT("FairyReviveEffect")); UIWidgets::Tooltip("Enable the following changes to the amount of health restored by Fairy Revivals"); - bool disabledFairyRevive = !CVarGetInteger("gFairyReviveEffect", 0); + bool disabledFairyRevive = !CVarGetInteger(CVAR_ENHANCEMENT("FairyReviveEffect"), 0); static const char* disabledTooltipFairyRevive = "This option is disabled because \"Change Fairy Revive Effect\" is turned off"; - UIWidgets::EnhancementSliderInt("Fairy Revival: %d", "##FAIRYREVIVEHEALTH", "gFairyReviveHealth", 1, 100, "", 0, true, disabledFairyRevive, disabledTooltipFairyRevive); + UIWidgets::EnhancementSliderInt("Fairy Revival: %d", "##FAIRYREVIVEHEALTH", CVAR_ENHANCEMENT("FairyReviveHealth"), 1, 100, "", 0, true, disabledFairyRevive, disabledTooltipFairyRevive); UIWidgets::Tooltip("Changes the amount of health restored by Fairy Revivals"); - UIWidgets::EnhancementCheckbox("Fairy Revive Percent Restore", "gFairyRevivePercentRestore", disabledFairyRevive, disabledTooltipFairyRevive); + UIWidgets::EnhancementCheckbox("Fairy Revive Percent Restore", CVAR_ENHANCEMENT("FairyRevivePercentRestore"), disabledFairyRevive, disabledTooltipFairyRevive); UIWidgets::Tooltip("Toggles from Fairy Revivals restoring a fixed amount of health to a percent of the player's current max health"); ImGui::EndMenu(); @@ -803,17 +803,17 @@ void DrawEnhancementsMenu() { UIWidgets::Spacer(0); if (ImGui::BeginMenu("Shooting Gallery")) { - UIWidgets::EnhancementCheckbox("Customize Behavior", "gCustomizeShootingGallery"); + UIWidgets::EnhancementCheckbox("Customize Behavior", CVAR_ENHANCEMENT("CustomizeShootingGallery")); UIWidgets::Tooltip("Turn on/off changes to the shooting gallery behavior"); - bool disabled = !CVarGetInteger("gCustomizeShootingGallery", 0); + bool disabled = !CVarGetInteger(CVAR_ENHANCEMENT("CustomizeShootingGallery"), 0); static const char* disabledTooltip = "This option is disabled because \"Customize Behavior\" is turned off"; - UIWidgets::PaddedEnhancementCheckbox("Instant Win", "gInstantShootingGalleryWin", true, false, disabled, disabledTooltip); + UIWidgets::PaddedEnhancementCheckbox("Instant Win", CVAR_ENHANCEMENT("InstantShootingGalleryWin"), true, false, disabled, disabledTooltip); UIWidgets::Tooltip("Skips the shooting gallery minigame"); - UIWidgets::PaddedEnhancementCheckbox("No Rupee Randomization", "gConstantAdultGallery", true, false, disabled, disabledTooltip); + UIWidgets::PaddedEnhancementCheckbox("No Rupee Randomization", CVAR_ENHANCEMENT("ConstantAdultGallery"), true, false, disabled, disabledTooltip); UIWidgets::Tooltip("Forces the rupee order to not be randomized as adult, making it the same as chlid"); - UIWidgets::PaddedEnhancementSliderInt("Child Starting Ammunition: %d", "##cShootingGalleryAmmunition", "gChildShootingGalleryAmmunition", 10, 30, "", 15, true, true, false, disabled, disabledTooltip); + UIWidgets::PaddedEnhancementSliderInt("Child Starting Ammunition: %d", "##cShootingGalleryAmmunition", CVAR_ENHANCEMENT("ShootingGalleryAmmoChild"), 10, 30, "", 15, true, true, false, disabled, disabledTooltip); UIWidgets::Tooltip("The ammunition at the start of the shooting gallery minigame as a child"); - UIWidgets::PaddedEnhancementSliderInt("Adult Starting Ammunition: %d", "##aShootingGalleryAmmunition", "gAdultShootingGalleryAmmunition", 10, 30, "", 15, true, true, false, disabled, disabledTooltip); + UIWidgets::PaddedEnhancementSliderInt("Adult Starting Ammunition: %d", "##aShootingGalleryAmmunition", CVAR_ENHANCEMENT("ShootingGalleryAmmoAdult"), 10, 30, "", 15, true, true, false, disabled, disabledTooltip); UIWidgets::Tooltip("The ammunition at the start of the shooting gallery minigame as an adult"); ImGui::EndMenu(); } @@ -821,15 +821,15 @@ void DrawEnhancementsMenu() { UIWidgets::Spacer(0); if (ImGui::BeginMenu("Bombchu Bowling")) { - UIWidgets::EnhancementCheckbox("Customize Behavior", "gCustomizeBombchuBowling"); + UIWidgets::EnhancementCheckbox("Customize Behavior", CVAR_ENHANCEMENT("CustomizeBombchuBowling")); UIWidgets::Tooltip("Turn on/off changes to the bombchu bowling behavior"); - bool disabled = CVarGetInteger("gCustomizeBombchuBowling", 0) == 0; + bool disabled = CVarGetInteger(CVAR_ENHANCEMENT("CustomizeBombchuBowling"), 0) == 0; static const char* disabledTooltip = "This option is disabled because \"Customize Behavior\" is turned off"; - UIWidgets::PaddedEnhancementCheckbox("Remove Small Cucco", "gBombchuBowlingNoSmallCucco", true, false, disabled, disabledTooltip); + UIWidgets::PaddedEnhancementCheckbox("Remove Small Cucco", CVAR_ENHANCEMENT("BombchuBowlingNoSmallCucco"), true, false, disabled, disabledTooltip); UIWidgets::Tooltip("Prevents the small cucco from appearing in the bombchu bowling minigame"); - UIWidgets::PaddedEnhancementCheckbox("Remove Big Cucco", "gBombchuBowlingNoBigCucco", true, false, disabled, disabledTooltip); + UIWidgets::PaddedEnhancementCheckbox("Remove Big Cucco", CVAR_ENHANCEMENT("BombchuBowlingNoBigCucco"), true, false, disabled, disabledTooltip); UIWidgets::Tooltip("Prevents the big cucco from appearing in the bombchu bowling minigame"); - UIWidgets::PaddedEnhancementSliderInt("Bombchu Count: %d", "##cBombchuBowlingAmmunition", "gBombchuBowlingAmmunition", 3, 20, "", 10, true, true, false, disabled, disabledTooltip); + UIWidgets::PaddedEnhancementSliderInt("Bombchu Count: %d", "##cBombchuBowlingAmmunition", CVAR_ENHANCEMENT("BombchuBowlingAmmo"), 3, 20, "", 10, true, true, false, disabled, disabledTooltip); UIWidgets::Tooltip("The number of bombchus available at the start of the bombchu bowling minigame"); ImGui::EndMenu(); } @@ -837,51 +837,51 @@ void DrawEnhancementsMenu() { UIWidgets::Spacer(0); if (ImGui::BeginMenu("Fishing")) { - UIWidgets::EnhancementCheckbox("Customize Behavior", "gCustomizeFishing"); + UIWidgets::EnhancementCheckbox("Customize Behavior", CVAR_ENHANCEMENT("CustomizeFishing")); UIWidgets::Tooltip("Turn on/off changes to the fishing behavior"); - bool disabled = !CVarGetInteger("gCustomizeFishing", 0); + bool disabled = !CVarGetInteger(CVAR_ENHANCEMENT("CustomizeFishing"), 0); static const char* disabledTooltip = "This option is disabled because \"Customize Behavior\" is turned off"; - UIWidgets::PaddedEnhancementCheckbox("Instant Fishing", "gInstantFishing", true, false, disabled, disabledTooltip); + UIWidgets::PaddedEnhancementCheckbox("Instant Fishing", CVAR_ENHANCEMENT("InstantFishing"), true, false, disabled, disabledTooltip); UIWidgets::Tooltip("All fish will be caught instantly"); - UIWidgets::PaddedEnhancementCheckbox("Guarantee Bite", "gGuaranteeFishingBite", true, false, disabled, disabledTooltip); + UIWidgets::PaddedEnhancementCheckbox("Guarantee Bite", CVAR_ENHANCEMENT("GuaranteeFishingBite"), true, false, disabled, disabledTooltip); UIWidgets::Tooltip("When a line is stable, guarantee bite. Otherwise use default logic"); - UIWidgets::PaddedEnhancementCheckbox("Fish Never Escape", "gFishNeverEscape", true, false, disabled, disabledTooltip); + UIWidgets::PaddedEnhancementCheckbox("Fish Never Escape", CVAR_ENHANCEMENT("FishNeverEscape"), true, false, disabled, disabledTooltip); UIWidgets::Tooltip("Once a hook has been set, fish will never let go while being reeled in."); - UIWidgets::PaddedEnhancementSliderInt("Child Minimum Weight: %d", "##cMinimumWeight", "gChildMinimumWeightFish", 3, 10, "", 10, true, true, false, disabled, disabledTooltip); + UIWidgets::PaddedEnhancementSliderInt("Child Minimum Weight: %d", "##cMinimumWeight", CVAR_ENHANCEMENT("MinimumFishWeightChild"), 3, 10, "", 10, true, true, false, disabled, disabledTooltip); UIWidgets::Tooltip("The minimum weight for the unique fishing reward as a child"); - UIWidgets::PaddedEnhancementSliderInt("Adult Minimum Weight: %d", "##aMinimumWeight", "gAdultMinimumWeightFish", 6, 13, "", 13, true, true, false, disabled, disabledTooltip); + UIWidgets::PaddedEnhancementSliderInt("Adult Minimum Weight: %d", "##aMinimumWeight", CVAR_ENHANCEMENT("MinimumFishWeightAdult"), 6, 13, "", 13, true, true, false, disabled, disabledTooltip); UIWidgets::Tooltip("The minimum weight for the unique fishing reward as an adult"); ImGui::EndMenu(); } UIWidgets::Spacer(0); if (ImGui::BeginMenu("Lost Woods Ocarina Game")) { - UIWidgets::EnhancementCheckbox("Customize Behavior", "gCustomizeOcarinaGame"); + UIWidgets::EnhancementCheckbox("Customize Behavior", CVAR_ENHANCEMENT("CustomizeOcarinaGame")); UIWidgets::Tooltip("Turn on/off changes to the lost woods ocarina game behavior"); - bool disabled = !CVarGetInteger("gCustomizeOcarinaGame", 0); + bool disabled = !CVarGetInteger(CVAR_ENHANCEMENT("CustomizeOcarinaGame"), 0); static const char* disabledTooltip = "This option is disabled because \"Customize Behavior\" is turned off"; - UIWidgets::PaddedEnhancementCheckbox("Instant Win", "gInstantOcarinaGameWin", true, false, disabled, disabledTooltip); + UIWidgets::PaddedEnhancementCheckbox("Instant Win", CVAR_ENHANCEMENT("InstantOcarinaGameWin"), true, false, disabled, disabledTooltip); UIWidgets::Tooltip("Skips the lost woods ocarina game"); - UIWidgets::PaddedEnhancementSliderInt("Note Play Speed: %dx", "##OcarinaGameNoteSpeed", "gOcarinaGameNoteSpeed", 1, 5, "", 1, true, true, false, disabled, disabledTooltip); + UIWidgets::PaddedEnhancementSliderInt("Note Play Speed: %dx", "##OcarinaGameNoteSpeed", CVAR_ENHANCEMENT("OcarinaGame.NoteSpeed"), 1, 5, "", 1, true, true, false, disabled, disabledTooltip); UIWidgets::Tooltip("Adjust the speed that the skull kids play notes"); - UIWidgets::PaddedEnhancementCheckbox("Unlimited Playback Time", "gOcarinaUnlimitedFailTime", true, false, disabled, disabledTooltip); + UIWidgets::PaddedEnhancementCheckbox("Unlimited Playback Time", CVAR_ENHANCEMENT("OcarinaUnlimitedFailTime"), true, false, disabled, disabledTooltip); UIWidgets::Tooltip("Removes the timer to play back the song"); - UIWidgets::PaddedEnhancementSliderInt("Number of Starting Notes: %d", "##OcarinaGameStartingNotes", "gOcarinaGameStartingNotes", 1, 8, "", 3, true, true, false, + UIWidgets::PaddedEnhancementSliderInt("Number of Starting Notes: %d", "##OcarinaGameStartingNotes", CVAR_ENHANCEMENT("OcarinaGame.StartingNotes"), 1, 8, "", 3, true, true, false, disabled, disabledTooltip); UIWidgets::Tooltip("Adjust the number of notes the skull kids play to start the first round"); - int roundMin = CVarGetInteger("gOcarinaGameStartingNotes", 3); + int roundMin = CVarGetInteger(CVAR_ENHANCEMENT("OcarinaGame.StartingNotes"), 3); UIWidgets::PaddedEnhancementSliderInt("Round One Notes: %d", "##OcarinaGameRoundOne", - "gOcarinaGameRoundOneNotes", roundMin, 8, "", 5, true, true, + CVAR_ENHANCEMENT("OcarinaGame.RoundOneNotes"), roundMin, 8, "", 5, true, true, false, disabled, disabledTooltip); UIWidgets::Tooltip("Adjust the number of notes you need to play to end the first round"); UIWidgets::PaddedEnhancementSliderInt("Round Two Notes: %d", "##OcarinaGameRoundTwoNotes", - "gOcarinaGameRoundTwoNotes", roundMin, 8, "", 6, true, true, + CVAR_ENHANCEMENT("OcarinaGame.RoundTwoNotes"), roundMin, 8, "", 6, true, true, false, disabled, disabledTooltip); UIWidgets::Tooltip("Adjust the number of notes you need to play to end the second round"); UIWidgets::PaddedEnhancementSliderInt("Round Three Notes: %d", "##OcarinaGameRoundThreeNotes", - "gOcarinaGameRoundThreeNotes", roundMin, 8, "", 8, true, true, + CVAR_ENHANCEMENT("OcarinaGame.RoundThreeNotes"), roundMin, 8, "", 8, true, true, false, disabled, disabledTooltip); UIWidgets::Tooltip("Adjust the number of notes you need to play to end the third round"); @@ -890,16 +890,16 @@ void DrawEnhancementsMenu() { UIWidgets::Spacer(0); - UIWidgets::PaddedEnhancementCheckbox("Delete File On Death", "gDeleteFileOnDeath", true, false); + UIWidgets::PaddedEnhancementCheckbox("Delete File On Death", CVAR_ENHANCEMENT("DeleteFileOnDeath"), true, false); ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.0f, 0.0f, 1.0f)); UIWidgets::Tooltip("Dying will delete your file\n\n " ICON_FA_EXCLAMATION_TRIANGLE " WARNING " ICON_FA_EXCLAMATION_TRIANGLE "\nTHIS IS NOT REVERSABLE\nUSE AT YOUR OWN RISK!"); ImGui::PopStyleColor(); - if (UIWidgets::PaddedEnhancementCheckbox("Permanent heart loss", "gPermanentHeartLoss", true, false)) { + if (UIWidgets::PaddedEnhancementCheckbox("Permanent heart loss", CVAR_ENHANCEMENT("PermanentHeartLoss"), true, false)) { UpdatePermanentHeartLossState(); } UIWidgets::Tooltip("When you lose 4 quarters of a heart you will permanently lose that heart container.\n\nDisabling this after the fact will restore your heart containers."); ImGui::Text("Damage Multiplier"); - UIWidgets::EnhancementCombobox("gDamageMul", allPowers, 0); + UIWidgets::EnhancementCombobox(CVAR_ENHANCEMENT("DamageMult"), allPowers, 0); UIWidgets::Tooltip( "Modifies all sources of damage not affected by other sliders\n" "2x: Can survive all common attacks from the start of the game\n" @@ -912,7 +912,7 @@ void DrawEnhancementsMenu() { "256x: Cannot survive damage" ); UIWidgets::PaddedText("Fall Damage Multiplier", true, false); - UIWidgets::EnhancementCombobox("gFallDamageMul", subPowers, 0); + UIWidgets::EnhancementCombobox(CVAR_ENHANCEMENT("FallDamageMult"), subPowers, 0); UIWidgets::Tooltip( "Modifies all fall damage\n" "2x: Can survive all fall damage from the start of the game\n" @@ -924,7 +924,7 @@ void DrawEnhancementsMenu() { "128x: Cannot survive fall damage" ); UIWidgets::PaddedText("Void Damage Multiplier", true, false); - UIWidgets::EnhancementCombobox("gVoidDamageMul", subSubPowers, 0); + UIWidgets::EnhancementCombobox(CVAR_ENHANCEMENT("VoidDamageMult"), subSubPowers, 0); UIWidgets::Tooltip( "Modifies damage taken after falling into a void\n" "2x: Can survive void damage from the start of the game\n" @@ -935,41 +935,41 @@ void DrawEnhancementsMenu() { "64x: Cannot survive void damage" ); UIWidgets::PaddedText("Bonk Damage Multiplier", true, false); - UIWidgets::EnhancementCombobox("gBonkDamageMul", bonkDamageValues, BONK_DAMAGE_NONE); + UIWidgets::EnhancementCombobox(CVAR_ENHANCEMENT("BonkDamageMult"), bonkDamageValues, BONK_DAMAGE_NONE); UIWidgets::Tooltip("Modifies damage taken after bonking."); - UIWidgets::PaddedEnhancementCheckbox("Spawn with full health", "gFullHealthSpawn", true, false); + UIWidgets::PaddedEnhancementCheckbox("Spawn with full health", CVAR_ENHANCEMENT("FullHealthSpawn"), true, false); UIWidgets::Tooltip("Respawn with full health instead of 3 Hearts"); - UIWidgets::PaddedEnhancementCheckbox("No Random Drops", "gNoRandomDrops", true, false); + UIWidgets::PaddedEnhancementCheckbox("No Random Drops", CVAR_ENHANCEMENT("NoRandomDrops"), true, false); UIWidgets::Tooltip("Disables random drops, except from the Goron Pot, Dampe, and bosses"); bool forceEnableBombchuDrops = IS_RANDO && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_ENABLE_BOMBCHU_DROPS) == 1; static const char* forceEnableBombchuDropsText = "This setting is forcefully enabled because a savefile\nwith \"Enable Bombchu Drops\" is loaded."; - UIWidgets::PaddedEnhancementCheckbox("Enable Bombchu Drops", "gBombchuDrops", true, false, + UIWidgets::PaddedEnhancementCheckbox("Enable Bombchu Drops", CVAR_ENHANCEMENT("BombchuDrops"), true, false, forceEnableBombchuDrops, forceEnableBombchuDropsText, UIWidgets::CheckboxGraphics::Checkmark); UIWidgets::Tooltip("Bombchus will sometimes drop in place of bombs"); - UIWidgets::PaddedEnhancementCheckbox("Trees Drop Sticks", "gTreeStickDrops", true, false); + UIWidgets::PaddedEnhancementCheckbox("Trees Drop Sticks", CVAR_ENHANCEMENT("TreesDropSticks"), true, false); UIWidgets::Tooltip("Bonking into trees will have a chance to drop up to 3 sticks. Must already have obtained sticks."); - UIWidgets::PaddedEnhancementCheckbox("No Heart Drops", "gNoHeartDrops", true, false); + UIWidgets::PaddedEnhancementCheckbox("No Heart Drops", CVAR_ENHANCEMENT("NoHeartDrops"), true, false); UIWidgets::Tooltip("Disables heart drops, but not heart placements, like from a Deku Scrub running off\nThis simulates Hero Mode from other games in the series"); - if (UIWidgets::PaddedEnhancementCheckbox("Hyper Bosses", "gHyperBosses", true, false)) { + if (UIWidgets::PaddedEnhancementCheckbox("Hyper Bosses", CVAR_ENHANCEMENT("HyperBosses"), true, false)) { UpdateHyperBossesState(); } UIWidgets::Tooltip("All major bosses move and act twice as fast."); - if (UIWidgets::PaddedEnhancementCheckbox("Hyper Enemies", "gHyperEnemies", true, false)) { + if (UIWidgets::PaddedEnhancementCheckbox("Hyper Enemies", CVAR_ENHANCEMENT("HyperEnemies"), true, false)) { UpdateHyperEnemiesState(); } UIWidgets::Tooltip("All regular enemies and mini-bosses move and act twice as fast."); - UIWidgets::PaddedEnhancementCheckbox("Always Win Goron Pot", "gGoronPot", true, false); + UIWidgets::PaddedEnhancementCheckbox("Always Win Goron Pot", CVAR_ENHANCEMENT("GoronPot"), true, false); UIWidgets::Tooltip("Always get the heart piece/purple rupee from the spinning Goron pot"); - UIWidgets::PaddedEnhancementCheckbox("Always Win Dampe Digging Game", "gDampeWin", true, false, SaveManager::Instance->IsRandoFile(), + UIWidgets::PaddedEnhancementCheckbox("Always Win Dampe Digging Game", CVAR_ENHANCEMENT("DampeWin"), true, false, SaveManager::Instance->IsRandoFile(), "This setting is always enabled in randomizer files", UIWidgets::CheckboxGraphics::Checkmark); UIWidgets::Tooltip("Always win the heart piece/purple rupee on the first dig in Dampe's grave digging game, just like in rando\nIn a rando file, this is unconditionally enabled"); - UIWidgets::PaddedEnhancementCheckbox("All Dogs are Richard", "gAllDogsRichard", true, false); + UIWidgets::PaddedEnhancementCheckbox("All Dogs are Richard", CVAR_ENHANCEMENT("AllDogsRichard"), true, false); UIWidgets::Tooltip("All dogs can be traded in and will count as Richard."); - UIWidgets::PaddedEnhancementSliderInt("Cuccos Stay Put Multiplier: %dx", "##CuccoStayDurationMultiplier", "gCuccoStayDurationMultiplier", 1, 5, "", 1, true, true, false); + UIWidgets::PaddedEnhancementSliderInt("Cuccos Stay Put Multiplier: %dx", "##CuccoStayDurationMultiplier", CVAR_ENHANCEMENT("CuccoStayDurationMult"), 1, 5, "", 1, true, true, false); UIWidgets::Tooltip("Cuccos will stay in place longer after putting them down, by a multiple of the value of the slider."); - UIWidgets::PaddedEnhancementSliderInt("Leever Spawn Rate: %d seconds", "##LeeverSpawnRate", "gEnhancements.LeeverSpawnRate", 0, 10, "", 0, true, true, false); + UIWidgets::PaddedEnhancementSliderInt("Leever Spawn Rate: %d seconds", "##LeeverSpawnRate", CVAR_ENHANCEMENT("LeeverSpawnRate"), 0, 10, "", 0, true, true, false); UIWidgets::Tooltip("The time between leever groups spawning."); ImGui::EndMenu(); @@ -979,15 +979,15 @@ void DrawEnhancementsMenu() { if (ImGui::BeginMenu("Reduced Clutter")) { - UIWidgets::EnhancementCheckbox("Mute Low HP Alarm", "gLowHpAlarm"); + UIWidgets::EnhancementCheckbox("Mute Low HP Alarm", CVAR_ENHANCEMENT("LowHpAlarm")); UIWidgets::Tooltip("Disable the low HP beeping sound"); - UIWidgets::PaddedEnhancementCheckbox("Minimal UI", "gMinimalUI", true, false); + UIWidgets::PaddedEnhancementCheckbox("Minimal UI", CVAR_ENHANCEMENT("MinimalUI"), true, false); UIWidgets::Tooltip("Hides most of the UI when not needed\nNote: Doesn't activate until after loading a new scene"); - UIWidgets::PaddedEnhancementCheckbox("Disable Navi Call Audio", "gDisableNaviCallAudio", true, false); + UIWidgets::PaddedEnhancementCheckbox("Disable Navi Call Audio", CVAR_ENHANCEMENT("DisableNaviCallAudio"), true, false); UIWidgets::Tooltip("Disables the voice audio when Navi calls you"); - UIWidgets::PaddedEnhancementCheckbox("Disable Hot/Underwater Warning Text", "gDisableTunicWarningText", true, false); + UIWidgets::PaddedEnhancementCheckbox("Disable Hot/Underwater Warning Text", CVAR_ENHANCEMENT("DisableTunicWarningText"), true, false); UIWidgets::Tooltip("Disables warning text when you don't have on the Goron/Zora Tunic in Hot/Underwater conditions."); - UIWidgets::PaddedEnhancementCheckbox("Remember Minimap State Between Areas", "gEnhancements.RememberMapToggleState"); + UIWidgets::PaddedEnhancementCheckbox("Remember Minimap State Between Areas", CVAR_ENHANCEMENT("RememberMapToggleState")); UIWidgets::Tooltip("Preserves the minimap visibility state when going between areas rather than defaulting it to \"on\" when going through loading zones."); ImGui::EndMenu(); @@ -995,15 +995,15 @@ void DrawEnhancementsMenu() { UIWidgets::Spacer(0); - UIWidgets::EnhancementCheckbox("Visual Stone of Agony", "gVisualAgony"); + UIWidgets::EnhancementCheckbox("Visual Stone of Agony", CVAR_ENHANCEMENT("VisualAgony")); UIWidgets::Tooltip("Displays an icon and plays a sound when Stone of Agony should be activated, for those without rumble"); - UIWidgets::PaddedEnhancementCheckbox("Assignable Tunics and Boots", "gAssignableTunicsAndBoots", true, false); + UIWidgets::PaddedEnhancementCheckbox("Assignable Tunics and Boots", CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), true, false); UIWidgets::Tooltip("Allows equipping the tunic and boots to c-buttons"); - UIWidgets::PaddedEnhancementCheckbox("Equipment Toggle", "gEquipmentCanBeRemoved", true, false); + UIWidgets::PaddedEnhancementCheckbox("Equipment Toggle", CVAR_ENHANCEMENT("EquipmentCanBeRemoved"), true, false); UIWidgets::Tooltip("Allows equipment to be removed by toggling it off on\nthe equipment subscreen."); - if (CVarGetInteger("gEquipmentCanBeRemoved", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("EquipmentCanBeRemoved"), 0)) { UIWidgets::PaddedText("Sword Toggle Options", true, false); - UIWidgets::EnhancementCombobox("gEnhancements.SwordToggle", swordToggleModes, SWORD_TOGGLE_NONE); + UIWidgets::EnhancementCombobox(CVAR_ENHANCEMENT("SwordToggle"), swordToggleModes, SWORD_TOGGLE_NONE); UIWidgets::Tooltip( "Introduces Options for unequipping Link's sword\n\n" "None: Only Biggoron's Sword/Giant's Knife can be toggled. Doing so will equip the Master Sword.\n\n" @@ -1012,17 +1012,17 @@ void DrawEnhancementsMenu() { ); } - UIWidgets::PaddedEnhancementCheckbox("Link's Cow in Both Time Periods", "gCowOfTime", true, false); + UIWidgets::PaddedEnhancementCheckbox("Link's Cow in Both Time Periods", CVAR_ENHANCEMENT("CowOfTime"), true, false); UIWidgets::Tooltip("Allows the Lon Lon Ranch obstacle course reward to be shared across time periods"); - UIWidgets::PaddedEnhancementCheckbox("Enable visible guard vision", "gGuardVision", true, false); - UIWidgets::PaddedEnhancementCheckbox("Enable passage of time on file select", "gTimeFlowFileSelect", true, false); - UIWidgets::PaddedEnhancementCheckbox("Item counts in messages", "gInjectItemCounts", true, false); + UIWidgets::PaddedEnhancementCheckbox("Enable visible guard vision", CVAR_ENHANCEMENT("GuardVision"), true, false); + UIWidgets::PaddedEnhancementCheckbox("Enable passage of time on file select", CVAR_ENHANCEMENT("TimeFlowFileSelect"), true, false); + UIWidgets::PaddedEnhancementCheckbox("Item counts in messages", CVAR_ENHANCEMENT("InjectItemCounts"), true, false); UIWidgets::Tooltip("Injects item counts in pickup messages, like golden skulltula tokens and heart pieces"); - UIWidgets::PaddedEnhancementCheckbox("Pull grave during the day", "gDayGravePull", true, false); + UIWidgets::PaddedEnhancementCheckbox("Pull grave during the day", CVAR_ENHANCEMENT("DayGravePull"), true, false); UIWidgets::Tooltip("Allows graves to be pulled when child during the day"); - UIWidgets::PaddedEnhancementCheckbox("Dogs follow you everywhere", "gDogFollowsEverywhere", true, false); + UIWidgets::PaddedEnhancementCheckbox("Dogs follow you everywhere", CVAR_ENHANCEMENT("DogFollowsEverywhere"), true, false); UIWidgets::Tooltip("Allows dogs to follow you anywhere you go, even if you leave the market"); - UIWidgets::PaddedEnhancementCheckbox("Don't require input for Credits sequence", "gNoInputForCredits", true, false); + UIWidgets::PaddedEnhancementCheckbox("Don't require input for Credits sequence", CVAR_ENHANCEMENT("NoInputForCredits"), true, false); UIWidgets::Tooltip("Removes the input requirement on textboxes after defeating Ganon, allowing Credits sequence to continue to progress"); // Blue Fire Arrows @@ -1030,7 +1030,7 @@ void DrawEnhancementsMenu() { OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_BLUE_FIRE_ARROWS); static const char* forceEnableBlueFireArrowsText = "This setting is forcefully enabled because a savefile\nwith \"Blue Fire Arrows\" is loaded."; - UIWidgets::PaddedEnhancementCheckbox("Blue Fire Arrows", "gBlueFireArrows", true, false, + UIWidgets::PaddedEnhancementCheckbox("Blue Fire Arrows", CVAR_ENHANCEMENT("BlueFireArrows"), true, false, forceEnableBlueFireArrows, forceEnableBlueFireArrowsText, UIWidgets::CheckboxGraphics::Checkmark); UIWidgets::Tooltip("Allows Ice Arrows to melt red ice.\nMay require a room reload if toggled during gameplay."); @@ -1039,16 +1039,16 @@ void DrawEnhancementsMenu() { OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SUNLIGHT_ARROWS); static const char* forceEnableSunLightArrowsText = "This setting is forcefully enabled because a savefile\nwith \"Sunlight Arrows\" is loaded."; - UIWidgets::PaddedEnhancementCheckbox("Sunlight Arrows", "gSunlightArrows", true, false, + UIWidgets::PaddedEnhancementCheckbox("Sunlight Arrows", CVAR_ENHANCEMENT("SunlightArrows"), true, false, forceEnableSunLightArrows, forceEnableSunLightArrowsText, UIWidgets::CheckboxGraphics::Checkmark); UIWidgets::Tooltip("Allows Light Arrows to activate sun switches.\nMay require a room reload if toggled during gameplay."); - UIWidgets::PaddedEnhancementCheckbox("Disable Crit wiggle", "gDisableCritWiggle", true, false); + UIWidgets::PaddedEnhancementCheckbox("Disable Crit wiggle", CVAR_ENHANCEMENT("DisableCritWiggle"), true, false); UIWidgets::Tooltip("Disable random camera wiggle at low health"); - UIWidgets::PaddedEnhancementCheckbox("Enemy Health Bars", "gEnemyHealthBar", true, false); + UIWidgets::PaddedEnhancementCheckbox("Enemy Health Bars", CVAR_ENHANCEMENT("EnemyHealthBar"), true, false); UIWidgets::Tooltip("Renders a health bar for enemies when Z-Targeted"); - UIWidgets::PaddedEnhancementCheckbox("Targetable Hookshot Reticle", "gHookshotableReticle", true, false); + UIWidgets::PaddedEnhancementCheckbox("Targetable Hookshot Reticle", CVAR_ENHANCEMENT("HookshotableReticle"), true, false); UIWidgets::Tooltip("Use a different color when aiming at hookshotable collision"); ImGui::EndMenu(); @@ -1066,13 +1066,13 @@ void DrawEnhancementsMenu() { ToggleAltAssetsAtEndOfFrame = true; } UIWidgets::Tooltip("Toggle between standard assets and alternate assets. Usually mods will indicate if this setting has to be used or not."); - UIWidgets::PaddedEnhancementCheckbox("Disable Bomb Billboarding", "gDisableBombBillboarding", true, false); + UIWidgets::PaddedEnhancementCheckbox("Disable Bomb Billboarding", CVAR_ENHANCEMENT("DisableBombBillboarding"), true, false); UIWidgets::Tooltip("Disables bombs always rotating to face the camera. To be used in conjunction with mods that want to replace bombs with 3D objects."); - UIWidgets::PaddedEnhancementCheckbox("Disable Grotto Fixed Rotation", "gDisableGrottoRotation", true, false); + UIWidgets::PaddedEnhancementCheckbox("Disable Grotto Fixed Rotation", CVAR_ENHANCEMENT("DisableGrottoRotation"), true, false); UIWidgets::Tooltip("Disables grottos rotating with the camera. To be used in conjunction with mods that want to replace grottos with 3D objects."); - UIWidgets::PaddedEnhancementCheckbox("Invisible Bunny Hood", "gHideBunnyHood", true, false); + UIWidgets::PaddedEnhancementCheckbox("Invisible Bunny Hood", CVAR_ENHANCEMENT("HideBunnyHood"), true, false); UIWidgets::Tooltip("Turns Bunny Hood invisible while still maintaining its effects."); - UIWidgets::PaddedEnhancementCheckbox("Disable HUD Heart animations", "gNoHUDHeartAnimation", true, false); + UIWidgets::PaddedEnhancementCheckbox("Disable HUD Heart animations", CVAR_ENHANCEMENT("NoHUDHeartAnimation"), true, false); UIWidgets::Tooltip("Disables the beating animation of the hearts on the HUD."); ImGui::EndMenu(); @@ -1082,43 +1082,43 @@ void DrawEnhancementsMenu() { if (ImGui::BeginMenu("Animated Link in Pause Menu")) { ImGui::Text("Rotation"); - UIWidgets::EnhancementRadioButton("Disabled", "gPauseLiveLinkRotation", 0); - UIWidgets::EnhancementRadioButton("Rotate Link with D-pad", "gPauseLiveLinkRotation", 1); + UIWidgets::EnhancementRadioButton("Disabled", CVAR_ENHANCEMENT("PauseLiveLinkRotation"), 0); + UIWidgets::EnhancementRadioButton("Rotate Link with D-pad", CVAR_ENHANCEMENT("PauseLiveLinkRotation"), 1); UIWidgets::Tooltip("Allow you to rotate Link on the Equipment menu with the D-pad\nUse D-pad Up or D-pad Down to reset Link's rotation"); - UIWidgets::EnhancementRadioButton("Rotate Link with C-buttons", "gPauseLiveLinkRotation", 2); + UIWidgets::EnhancementRadioButton("Rotate Link with C-buttons", CVAR_ENHANCEMENT("PauseLiveLinkRotation"), 2); UIWidgets::Tooltip("Allow you to rotate Link on the Equipment menu with the C-buttons\nUse C-Up or C-Down to reset Link's rotation"); - UIWidgets::EnhancementRadioButton("Rotate Link with Right Stick", "gPauseLiveLinkRotation", 3); + UIWidgets::EnhancementRadioButton("Rotate Link with Right Stick", CVAR_ENHANCEMENT("PauseLiveLinkRotation"), 3); UIWidgets::Tooltip("Allow you to rotate Link on the Equipment menu with the Right Stick\nYou can zoom in by pointing up and reset Link's rotation by pointing down"); - if (CVarGetInteger("gPauseLiveLinkRotation", 0) != 0) { - UIWidgets::EnhancementSliderInt("Rotation Speed: %d", "##MinRotationSpeed", "gPauseLiveLinkRotationSpeed", 1, 20, "", 1); + if (CVarGetInteger(CVAR_ENHANCEMENT("PauseLiveLinkRotation"), 0) != 0) { + UIWidgets::EnhancementSliderInt("Rotation Speed: %d", "##MinRotationSpeed", CVAR_ENHANCEMENT("PauseLiveLinkRotationSpeed"), 1, 20, "", 1); } UIWidgets::PaddedSeparator(); ImGui::Text("Static loop"); - UIWidgets::EnhancementRadioButton("Disabled", "gPauseLiveLink", 0); - UIWidgets::EnhancementRadioButton("Idle (standing)", "gPauseLiveLink", 1); - UIWidgets::EnhancementRadioButton("Idle (look around)", "gPauseLiveLink", 2); - UIWidgets::EnhancementRadioButton("Idle (belt)", "gPauseLiveLink", 3); - UIWidgets::EnhancementRadioButton("Idle (shield)", "gPauseLiveLink", 4); - UIWidgets::EnhancementRadioButton("Idle (test sword)", "gPauseLiveLink", 5); - UIWidgets::EnhancementRadioButton("Idle (yawn)", "gPauseLiveLink", 6); - UIWidgets::EnhancementRadioButton("Battle Stance", "gPauseLiveLink", 7); - UIWidgets::EnhancementRadioButton("Walking (no shield)", "gPauseLiveLink", 8); - UIWidgets::EnhancementRadioButton("Walking (holding shield)", "gPauseLiveLink", 9); - UIWidgets::EnhancementRadioButton("Running (no shield)", "gPauseLiveLink", 10); - UIWidgets::EnhancementRadioButton("Running (holding shield)", "gPauseLiveLink", 11); - UIWidgets::EnhancementRadioButton("Hand on hip", "gPauseLiveLink", 12); - UIWidgets::EnhancementRadioButton("Spin attack charge", "gPauseLiveLink", 13); - UIWidgets::EnhancementRadioButton("Look at hand", "gPauseLiveLink", 14); + UIWidgets::EnhancementRadioButton("Disabled", CVAR_ENHANCEMENT("PauseLiveLink"), 0); + UIWidgets::EnhancementRadioButton("Idle (standing)", CVAR_ENHANCEMENT("PauseLiveLink"), 1); + UIWidgets::EnhancementRadioButton("Idle (look around)", CVAR_ENHANCEMENT("PauseLiveLink"), 2); + UIWidgets::EnhancementRadioButton("Idle (belt)", CVAR_ENHANCEMENT("PauseLiveLink"), 3); + UIWidgets::EnhancementRadioButton("Idle (shield)", CVAR_ENHANCEMENT("PauseLiveLink"), 4); + UIWidgets::EnhancementRadioButton("Idle (test sword)", CVAR_ENHANCEMENT("PauseLiveLink"), 5); + UIWidgets::EnhancementRadioButton("Idle (yawn)", CVAR_ENHANCEMENT("PauseLiveLink"), 6); + UIWidgets::EnhancementRadioButton("Battle Stance", CVAR_ENHANCEMENT("PauseLiveLink"), 7); + UIWidgets::EnhancementRadioButton("Walking (no shield)", CVAR_ENHANCEMENT("PauseLiveLink"), 8); + UIWidgets::EnhancementRadioButton("Walking (holding shield)", CVAR_ENHANCEMENT("PauseLiveLink"), 9); + UIWidgets::EnhancementRadioButton("Running (no shield)", CVAR_ENHANCEMENT("PauseLiveLink"), 10); + UIWidgets::EnhancementRadioButton("Running (holding shield)", CVAR_ENHANCEMENT("PauseLiveLink"), 11); + UIWidgets::EnhancementRadioButton("Hand on hip", CVAR_ENHANCEMENT("PauseLiveLink"), 12); + UIWidgets::EnhancementRadioButton("Spin attack charge", CVAR_ENHANCEMENT("PauseLiveLink"), 13); + UIWidgets::EnhancementRadioButton("Look at hand", CVAR_ENHANCEMENT("PauseLiveLink"), 14); UIWidgets::PaddedSeparator(); ImGui::Text("Randomize"); - UIWidgets::EnhancementRadioButton("Random", "gPauseLiveLink", 15); + UIWidgets::EnhancementRadioButton("Random", CVAR_ENHANCEMENT("PauseLiveLink"), 15); UIWidgets::Tooltip("Randomize the animation played each time you open the menu"); - UIWidgets::EnhancementRadioButton("Random cycle", "gPauseLiveLink", 16); + UIWidgets::EnhancementRadioButton("Random cycle", CVAR_ENHANCEMENT("PauseLiveLink"), 16); UIWidgets::Tooltip("Randomize the animation played on the menu after a certain time"); - UIWidgets::EnhancementRadioButton("Random cycle (Idle)", "gPauseLiveLink", 17); + UIWidgets::EnhancementRadioButton("Random cycle (Idle)", CVAR_ENHANCEMENT("PauseLiveLink"), 17); UIWidgets::Tooltip("Randomize the animation played on the menu after a certain time (Idle animations only)"); - if (CVarGetInteger("gPauseLiveLink", 0) >= 16) { - UIWidgets::EnhancementSliderInt("Frame to wait: %d", "##MinFrameCount", "gMinFrameCount", 1, 1000, "", 0); + if (CVarGetInteger(CVAR_ENHANCEMENT("PauseLiveLink"), 0) >= 16) { + UIWidgets::EnhancementSliderInt("Frame to wait: %d", "##MinFrameCount", CVAR_ENHANCEMENT("MinFrameCount"), 1, 1000, "", 0); } ImGui::EndMenu(); @@ -1126,59 +1126,59 @@ void DrawEnhancementsMenu() { UIWidgets::Spacer(0); - UIWidgets::PaddedEnhancementCheckbox("Disable LOD", "gDisableLOD", true, false); + UIWidgets::PaddedEnhancementCheckbox("Disable LOD", CVAR_ENHANCEMENT("DisableLOD"), true, false); UIWidgets::Tooltip("Turns off the Level of Detail setting, making models use their higher-poly variants at any distance"); - if (UIWidgets::PaddedEnhancementCheckbox("Disable Draw Distance", "gDisableDrawDistance", true, false)) { - if (CVarGetInteger("gDisableDrawDistance", 0) == 0) { - CVarSetInteger("gDisableKokiriDrawDistance", 0); + if (UIWidgets::PaddedEnhancementCheckbox("Disable Draw Distance", CVAR_ENHANCEMENT("DisableDrawDistance"), true, false)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 0) == 0) { + CVarSetInteger(CVAR_ENHANCEMENT("DisableKokiriDrawDistance"), 0); } } UIWidgets::Tooltip("Turns off the objects draw distance, making objects being visible from a longer range"); - if (CVarGetInteger("gDisableDrawDistance", 0) == 1) { - UIWidgets::PaddedEnhancementCheckbox("Kokiri Draw Distance", "gDisableKokiriDrawDistance", true, false); + if (CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 0) == 1) { + UIWidgets::PaddedEnhancementCheckbox("Kokiri Draw Distance", CVAR_ENHANCEMENT("DisableKokiriDrawDistance"), true, false); UIWidgets::Tooltip("The Kokiri are mystical beings that fade into view when approached\nEnabling this will remove their draw distance"); } - if (UIWidgets::PaddedEnhancementCheckbox("Show Age-Dependent Equipment", "gEnhancements.EquimentAlwaysVisible", true, + if (UIWidgets::PaddedEnhancementCheckbox("Show Age-Dependent Equipment", CVAR_ENHANCEMENT("EquimentAlwaysVisible"), true, false)) { UpdatePatchHand(); } UIWidgets::Tooltip("Makes all equipment visible, regardless of Age."); - if (CVarGetInteger("gEnhancements.EquimentAlwaysVisible", 0) == 1) { - UIWidgets::PaddedEnhancementCheckbox("Scale Adult Equipment as Child", "gEnhancements.ScaleAdultEquimentAsChild", true, false); + if (CVarGetInteger(CVAR_ENHANCEMENT("EquimentAlwaysVisible"), 0) == 1) { + UIWidgets::PaddedEnhancementCheckbox("Scale Adult Equipment as Child", CVAR_ENHANCEMENT("ScaleAdultEquimentAsChild"), true, false); UIWidgets::Tooltip("Scales all of the Adult Equipment, as well and moving some a bit, to fit on Child Link Better. May not work properly with some mods."); } UIWidgets::PaddedEnhancementCheckbox("N64 Mode", "gLowResMode", true, false); UIWidgets::Tooltip("Sets aspect ratio to 4:3 and lowers resolution to 240p, the N64's native resolution"); - UIWidgets::PaddedEnhancementCheckbox("Glitch line-up tick", "gDrawLineupTick", true, false); + UIWidgets::PaddedEnhancementCheckbox("Glitch line-up tick", CVAR_ENHANCEMENT("DrawLineupTick"), true, false); UIWidgets::Tooltip("Displays a tick in the top center of the screen to help with glitch line-ups in SoH, as traditional UI based line-ups do not work outside of 4:3"); - UIWidgets::PaddedEnhancementCheckbox("Enable 3D Dropped items/projectiles", "gNewDrops", true, false); + UIWidgets::PaddedEnhancementCheckbox("Enable 3D Dropped items/projectiles", CVAR_ENHANCEMENT("NewDrops"), true, false); UIWidgets::Tooltip("Change most 2D items and projectiles on the overworld to their 3D versions"); - UIWidgets::PaddedEnhancementCheckbox("Disable Black Bar Letterboxes", "gDisableBlackBars", true, false); + UIWidgets::PaddedEnhancementCheckbox("Disable Black Bar Letterboxes", CVAR_ENHANCEMENT("DisableBlackBars"), true, false); UIWidgets::Tooltip("Disables Black Bar Letterboxes during cutscenes and Z-targeting\nNote: there may be minor visual glitches that were covered up by the black bars\nPlease disable this setting before reporting a bug"); - UIWidgets::PaddedEnhancementCheckbox("Dynamic Wallet Icon", "gDynamicWalletIcon", true, false); + UIWidgets::PaddedEnhancementCheckbox("Dynamic Wallet Icon", CVAR_ENHANCEMENT("DynamicWalletIcon"), true, false); UIWidgets::Tooltip("Changes the rupee in the wallet icon to match the wallet size you currently have"); - UIWidgets::PaddedEnhancementCheckbox("Always show dungeon entrances", "gAlwaysShowDungeonMinimapIcon", true, false); + UIWidgets::PaddedEnhancementCheckbox("Always show dungeon entrances", CVAR_ENHANCEMENT("AlwaysShowDungeonMinimapIcon"), true, false); UIWidgets::Tooltip("Always shows dungeon entrance icons on the minimap"); - UIWidgets::PaddedEnhancementCheckbox("Show Gauntlets in First Person", "gFPSGauntlets", true, false); + UIWidgets::PaddedEnhancementCheckbox("Show Gauntlets in First Person", CVAR_ENHANCEMENT("FirstPersonGauntlets"), true, false); UIWidgets::Tooltip("Renders Gauntlets when using the Bow and Hookshot like in OOT3D"); - if (UIWidgets::PaddedEnhancementCheckbox("Color Temple of Time's Medallions", "gToTMedallionsColors", true, false)) { + if (UIWidgets::PaddedEnhancementCheckbox("Color Temple of Time's Medallions", CVAR_ENHANCEMENT("ToTMedallionsColors"), true, false)) { PatchToTMedallions(); } UIWidgets::Tooltip("When medallions are collected, the medallion imprints around the Master Sword pedestal in the Temple of Time will become colored"); - UIWidgets::PaddedEnhancementCheckbox("Show locked door chains on both sides of locked doors", "gShowDoorLocksOnBothSides", true, false); + UIWidgets::PaddedEnhancementCheckbox("Show locked door chains on both sides of locked doors", CVAR_ENHANCEMENT("ShowDoorLocksOnBothSides"), true, false); UIWidgets::PaddedText("Fix Vanishing Paths", true, false); - if (UIWidgets::EnhancementCombobox("gSceneSpecificDirtPathFix", zFightingOptions, ZFIGHT_FIX_DISABLED) && gPlayState != NULL) { + if (UIWidgets::EnhancementCombobox(CVAR_ENHANCEMENT("SceneSpecificDirtPathFix"), zFightingOptions, ZFIGHT_FIX_DISABLED) && gPlayState != NULL) { UpdateDirtPathFixState(gPlayState->sceneNum); } UIWidgets::Tooltip("Disabled: Paths vanish more the higher the resolution (Z-fighting is based on resolution)\n" "Consistent: Certain paths vanish the same way in all resolutions\n" "No Vanish: Paths do not vanish, Link seems to sink in to some paths\n" "This might affect other decal effects\n"); - UIWidgets::PaddedEnhancementSliderInt("Text Spacing: %d", "##TEXTSPACING", "gTextSpacing", 4, 6, "", 6, true, true, true); + UIWidgets::PaddedEnhancementSliderInt("Text Spacing: %d", "##TEXTSPACING", CVAR_ENHANCEMENT("TextSpacing"), 4, 6, "", 6, true, true, true); UIWidgets::Tooltip("Space between text characters (useful for HD font textures)"); - UIWidgets::PaddedEnhancementCheckbox("More info in file select", "gFileSelectMoreInfo", true, false); + UIWidgets::PaddedEnhancementCheckbox("More info in file select", CVAR_ENHANCEMENT("FileSelectMoreInfo"), true, false); UIWidgets::Tooltip("Shows what items you have collected in the file select screen, like in N64 randomizer"); - UIWidgets::PaddedEnhancementCheckbox("Better ammo rendering in pause menu", "gEnhancements.BetterAmmoRendering", true, false); + UIWidgets::PaddedEnhancementCheckbox("Better ammo rendering in pause menu", CVAR_ENHANCEMENT("BetterAmmoRendering"), true, false); UIWidgets::Tooltip("Ammo counts in the pause menu will work correctly regardless of the position of items in the inventory"); ImGui::EndMenu(); } @@ -1187,69 +1187,69 @@ void DrawEnhancementsMenu() { if (ImGui::BeginMenu("Fixes")) { - UIWidgets::EnhancementCheckbox("Fix L&R Pause menu", "gUniformLR"); + UIWidgets::EnhancementCheckbox("Fix L&R Pause menu", CVAR_ENHANCEMENT("FixMenuLR")); UIWidgets::Tooltip("Makes the L and R buttons in the pause menu the same color"); - UIWidgets::PaddedEnhancementCheckbox("Fix L&Z Page switch in Pause menu", "gNGCKaleidoSwitcher", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fix L&Z Page switch in Pause menu", CVAR_ENHANCEMENT("NGCKaleidoSwitcher"), true, false); UIWidgets::Tooltip("Makes L and R switch pages like on the GameCube\nZ opens the Debug Menu instead"); - UIWidgets::PaddedEnhancementCheckbox("Fix Dungeon entrances", "gFixDungeonMinimapIcon", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fix Dungeon entrances", CVAR_ENHANCEMENT("FixDungeonMinimapIcon"), true, false); UIWidgets::Tooltip("Removes the dungeon entrance icon on the top-left corner of the screen when no dungeon is present on the current map"); - UIWidgets::PaddedEnhancementCheckbox("Fix Two Handed idle animations", "gTwoHandedIdle", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fix Two Handed idle animations", CVAR_ENHANCEMENT("TwoHandedIdle"), true, false); UIWidgets::Tooltip("Re-enables the two-handed idle animation, a seemingly finished animation that was disabled on accident in the original game"); - UIWidgets::PaddedEnhancementCheckbox("Fix the Gravedigging Tour Glitch", "gGravediggingTourFix", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fix the Gravedigging Tour Glitch", CVAR_ENHANCEMENT("GravediggingTourFix"), true, false); UIWidgets::Tooltip("Fixes a bug where the Gravedigging Tour Heart Piece disappears if the area reloads"); - UIWidgets::PaddedEnhancementCheckbox("Fix Deku Nut upgrade", "gDekuNutUpgradeFix", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fix Deku Nut upgrade", CVAR_ENHANCEMENT("DekuNutUpgradeFix"), true, false); UIWidgets::Tooltip("Prevents the Forest Stage Deku Nut upgrade from becoming unobtainable after receiving the Poacher's Saw"); - UIWidgets::PaddedEnhancementCheckbox("Fix Navi text HUD position", "gNaviTextFix", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fix Navi text HUD position", CVAR_ENHANCEMENT("NaviTextFix"), true, false); UIWidgets::Tooltip("Correctly centers the Navi text prompt on the HUD's C-Up button"); - UIWidgets::PaddedEnhancementCheckbox("Fix Anubis fireballs", "gAnubisFix", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fix Anubis fireballs", CVAR_ENHANCEMENT("AnubixFix"), true, false); UIWidgets::Tooltip("Make Anubis fireballs do fire damage when reflected back at them with the Mirror Shield"); - if (UIWidgets::PaddedEnhancementCheckbox("Fix Megaton Hammer crouch stab", "gCrouchStabHammerFix", true, false)) { - if (!CVarGetInteger("gCrouchStabHammerFix", 0)) { - CVarClear("gCrouchStabFix"); + if (UIWidgets::PaddedEnhancementCheckbox("Fix Megaton Hammer crouch stab", CVAR_ENHANCEMENT("CrouchStabHammerFix"), true, false)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("CrouchStabHammerFix"), 0)) { + CVarClear(CVAR_ENHANCEMENT("CrouchStabFix")); } } UIWidgets::Tooltip("Make the Megaton Hammer's crouch stab able to destroy rocks without first swinging it normally"); - if (CVarGetInteger("gCrouchStabHammerFix", 0)) { - UIWidgets::PaddedEnhancementCheckbox("Remove power crouch stab", "gCrouchStabFix", true, false); + if (CVarGetInteger(CVAR_ENHANCEMENT("CrouchStabHammerFix"), 0)) { + UIWidgets::PaddedEnhancementCheckbox("Remove power crouch stab", CVAR_ENHANCEMENT("CrouchStabFix"), true, false); UIWidgets::Tooltip("Make crouch stabbing always do the same damage as a regular slash"); } - UIWidgets::PaddedEnhancementCheckbox("Fix credits timing", "gCreditsFix", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fix credits timing", CVAR_ENHANCEMENT("CreditsFix"), true, false); UIWidgets::Tooltip("Extend certain credits scenes so the music lines up properly with the visuals"); - UIWidgets::PaddedEnhancementCheckbox("Fix Gerudo Warrior's clothing colors", "gGerudoWarriorClothingFix", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fix Gerudo Warrior's clothing colors", CVAR_ENHANCEMENT("GerudoWarriorClothingFix"), true, false); UIWidgets::Tooltip("Prevent the Gerudo Warrior's clothes changing color when changing Link's tunic or using bombs in front of her"); - UIWidgets::PaddedEnhancementCheckbox("Fix Camera Drift", "gFixCameraDrift", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fix Camera Drift", CVAR_ENHANCEMENT("FixCameraDrift"), true, false); UIWidgets::Tooltip("Fixes camera slightly drifting to the left when standing still due to a math error"); - UIWidgets::PaddedEnhancementCheckbox("Fix Camera Swing", "gFixCameraSwing", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fix Camera Swing", CVAR_ENHANCEMENT("FixCameraSwing"), true, false); UIWidgets::Tooltip("Fixes camera getting stuck on collision when standing still, also fixes slight shift back in camera when stop moving"); - UIWidgets::PaddedEnhancementCheckbox("Fix Hanging Ledge Swing Rate", "gFixHangingLedgeSwingRate", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fix Hanging Ledge Swing Rate", CVAR_ENHANCEMENT("FixHangingLedgeSwingRate"), true, false); UIWidgets::Tooltip("Fixes camera swing rate when player falls off a ledge and camera swings around"); - UIWidgets::PaddedEnhancementCheckbox("Fix Missing Jingle after 5 Silver Rupees", "gSilverRupeeJingleExtend", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fix Missing Jingle after 5 Silver Rupees", CVAR_ENHANCEMENT("SilverRupeeJingleExtend"), true, false); UIWidgets::Tooltip( "Adds 5 higher pitches for the Silver Rupee Jingle for the rooms with more than 5 Silver Rupees. " "Currently only relevant in Master Quest."); - if (UIWidgets::PaddedEnhancementCheckbox("Fix out of bounds textures", "gFixTexturesOOB", true, false)) { + if (UIWidgets::PaddedEnhancementCheckbox("Fix out of bounds textures", CVAR_ENHANCEMENT("FixTexturesOOB"), true, false)) { ApplyAuthenticGfxPatches(); } UIWidgets::Tooltip("Fixes authentic out of bounds texture reads, instead loading textures with the correct size"); - UIWidgets::PaddedEnhancementCheckbox("Fix Poacher's Saw Softlock", "gFixSawSoftlock", true, false, CVarGetInteger("gSkipText", 0), + UIWidgets::PaddedEnhancementCheckbox("Fix Poacher's Saw Softlock", CVAR_ENHANCEMENT("FixSawSoftlock"), true, false, CVarGetInteger(CVAR_ENHANCEMENT("SkipText"), 0), "This is disabled because it is forced on when Skip Text is enabled.", UIWidgets::CheckboxGraphics::Checkmark); UIWidgets::Tooltip("Prevents the Poacher's Saw softlock from mashing through the text, or with Skip Text enabled."); - UIWidgets::PaddedEnhancementCheckbox("Fix enemies not spawning near water", "gEnemySpawnsOverWaterboxes", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fix enemies not spawning near water", CVAR_ENHANCEMENT("EnemySpawnsOverWaterboxes"), true, false); UIWidgets::Tooltip("Causes respawning enemies, like stalchildren, to appear on land near bodies of water. " "Fixes an incorrect calculation that acted like water underneath ground was above it."); - UIWidgets::PaddedEnhancementCheckbox("Fix Bush Item Drops", "gBushDropFix", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fix Bush Item Drops", CVAR_ENHANCEMENT("BushDropFix"), true, false); UIWidgets::Tooltip("Fixes the bushes to drop items correctly rather than spawning undefined items."); - UIWidgets::PaddedEnhancementCheckbox("Fix falling from vine edges", "gFixVineFall", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fix falling from vine edges", CVAR_ENHANCEMENT("FixVineFall"), true, false); UIWidgets::Tooltip("Prevents immediately falling off climbable surfaces if climbing on the edges."); - UIWidgets::PaddedEnhancementCheckbox("Fix Link's eyes open while sleeping", "gFixEyesOpenWhileSleeping", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fix Link's eyes open while sleeping", CVAR_ENHANCEMENT("FixEyesOpenWhileSleeping"), true, false); UIWidgets::Tooltip("Fixes Link's eyes being open in the opening cutscene when he is supposed to be sleeping."); - UIWidgets::PaddedEnhancementCheckbox("Fix Darunia dancing too fast", "gEnhancements.FixDaruniaDanceSpeed", + UIWidgets::PaddedEnhancementCheckbox("Fix Darunia dancing too fast", CVAR_ENHANCEMENT("FixDaruniaDanceSpeed"), true, false, false, "", UIWidgets::CheckboxGraphics::Cross, true); UIWidgets::Tooltip("Fixes Darunia's dancing speed so he dances to the beat of Saria's Song, like in vanilla."); - UIWidgets::PaddedEnhancementCheckbox("Fix raised Floor Switches", "gEnhancements.FixFloorSwitches", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fix raised Floor Switches", CVAR_ENHANCEMENT("FixFloorSwitches"), true, false); UIWidgets::Tooltip("Fixes the two raised floor switches, the one in Forest Temple Basement and the one at the top of Fire Temple. \n" "This will lower them, making activating them easier"); - UIWidgets::PaddedEnhancementCheckbox("Fix Zora hint dialogue", "gFixZoraHintDialogue", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fix Zora hint dialogue", CVAR_ENHANCEMENT("FixZoraHintDialogue"), true, false); UIWidgets::Tooltip("Fixes one Zora's dialogue giving a hint about bringing Ruto's Letter to King Zora to properly occur before moving King Zora rather than after"); ImGui::EndMenu(); @@ -1259,23 +1259,23 @@ void DrawEnhancementsMenu() { if (ImGui::BeginMenu("Restoration")) { - UIWidgets::EnhancementCheckbox("Authentic Logo Screen", "gAuthenticLogo"); + UIWidgets::EnhancementCheckbox("Authentic Logo Screen", CVAR_ENHANCEMENT("AuthenticLogo")); UIWidgets::Tooltip("Hide the game version and build details and display the authentic model and texture on the boot logo start screen"); - UIWidgets::PaddedEnhancementCheckbox("Red Ganon blood", "gRedGanonBlood", true, false); + UIWidgets::PaddedEnhancementCheckbox("Red Ganon blood", CVAR_ENHANCEMENT("RedGanonBlood"), true, false); UIWidgets::Tooltip("Restore the original red blood from NTSC 1.0/1.1. Disable for green blood"); - UIWidgets::PaddedEnhancementCheckbox("Fish while hovering", "gHoverFishing", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fish while hovering", CVAR_ENHANCEMENT("HoverFishing"), true, false); UIWidgets::Tooltip("Restore a bug from NTSC 1.0 that allows casting the Fishing Rod while using the Hover Boots"); - UIWidgets::PaddedEnhancementCheckbox("N64 Weird Frames", "gN64WeirdFrames", true, false); + UIWidgets::PaddedEnhancementCheckbox("N64 Weird Frames", CVAR_ENHANCEMENT("N64WeirdFrames"), true, false); UIWidgets::Tooltip("Restores N64 Weird Frames allowing weirdshots to behave the same as N64"); - UIWidgets::PaddedEnhancementCheckbox("Bombchus out of bounds", "gBombchusOOB", true, false); + UIWidgets::PaddedEnhancementCheckbox("Bombchus out of bounds", CVAR_ENHANCEMENT("BombchusOOB"), true, false); UIWidgets::Tooltip("Allows bombchus to explode out of bounds\nSimilar to GameCube and Wii VC"); - UIWidgets::PaddedEnhancementCheckbox("Quick Putaway", "gQuickPutaway", true, false); + UIWidgets::PaddedEnhancementCheckbox("Quick Putaway", CVAR_ENHANCEMENT("QuickPutaway"), true, false); UIWidgets::Tooltip("Restore a bug from NTSC 1.0 that allows putting away an item without an animation and performing Putaway Ocarina Items"); - UIWidgets::PaddedEnhancementCheckbox("Restore old Gold Skulltula cutscene", "gGsCutscene", true, false); + UIWidgets::PaddedEnhancementCheckbox("Restore old Gold Skulltula cutscene", CVAR_ENHANCEMENT("GSCutscene"), true, false); UIWidgets::Tooltip("Restore pre-release behavior where defeating a Gold Skulltula will play a cutscene showing it die."); - UIWidgets::PaddedEnhancementCheckbox("Quick Bongo Kill", "gQuickBongoKill", true, false); + UIWidgets::PaddedEnhancementCheckbox("Quick Bongo Kill", CVAR_ENHANCEMENT("QuickBongoKill"), true, false); UIWidgets::Tooltip("Restore a bug from NTSC 1.0 that allows bypassing Bongo Bongo's intro cutscene to quickly kill him"); - UIWidgets::PaddedEnhancementCheckbox("Original RBA Values", "gRestoreRBAValues", true, false); + UIWidgets::PaddedEnhancementCheckbox("Original RBA Values", CVAR_ENHANCEMENT("RestoreRBAValues"), true, false); UIWidgets::Tooltip("Restores the original outcomes when performing Reverse Bottle Adventure."); ImGui::EndMenu(); @@ -1285,7 +1285,7 @@ void DrawEnhancementsMenu() { if (ImGui::BeginMenu("Extra Modes")) { UIWidgets::PaddedText("Mirrored World", true, false); - if (UIWidgets::EnhancementCombobox("gMirroredWorldMode", mirroredWorldModes, MIRRORED_WORLD_OFF) && gPlayState != NULL) { + if (UIWidgets::EnhancementCombobox(CVAR_ENHANCEMENT("MirroredWorldMode"), mirroredWorldModes, MIRRORED_WORLD_OFF) && gPlayState != NULL) { UpdateMirrorModeState(gPlayState->sceneNum); } UIWidgets::Tooltip( @@ -1301,7 +1301,7 @@ void DrawEnhancementsMenu() { ); UIWidgets::PaddedText("Enemy Randomizer", true, false); - UIWidgets::EnhancementCombobox("gRandomizedEnemies", enemyRandomizerModes, ENEMY_RANDOMIZER_OFF); + UIWidgets::EnhancementCombobox(CVAR_ENHANCEMENT("RandomizedEnemies"), enemyRandomizerModes, ENEMY_RANDOMIZER_OFF); UIWidgets::Tooltip( "Replaces fixed enemies throughout the game with a random enemy. Bosses, mini-bosses and a few specific regular enemies are excluded.\n" "Enemies that need more than Deku Nuts + either Deku Sticks or a sword to kill are excluded from spawning in \"clear enemy\" rooms.\n\n" @@ -1309,66 +1309,66 @@ void DrawEnhancementsMenu() { "- Random (Seeded): Enemies are randomized based on the current randomizer seed/file\n" ); - UIWidgets::PaddedEnhancementCheckbox("Randomized Enemy Sizes", "gRandomizedEnemySizes", true, false); + UIWidgets::PaddedEnhancementCheckbox("Randomized Enemy Sizes", CVAR_ENHANCEMENT("RandomizedEnemySizes"), true, false); UIWidgets::Tooltip("Enemies and Bosses spawn with random sizes."); - if (CVarGetInteger("gRandomizedEnemySizes", 0)) { - UIWidgets::EnhancementCheckbox("Scale Health with Size", "gEnemySizeScalesHealth"); + if (CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemySizes"), 0)) { + UIWidgets::EnhancementCheckbox("Scale Health with Size", CVAR_ENHANCEMENT("EnemySizeScalesHealth")); UIWidgets::Tooltip("Scales normal enemies health with their randomized size. *This will NOT affect bosses*"); } - UIWidgets::PaddedEnhancementCheckbox("Ivan the Fairy (Coop Mode)", "gIvanCoopModeEnabled", true, false); + UIWidgets::PaddedEnhancementCheckbox("Ivan the Fairy (Coop Mode)", CVAR_ENHANCEMENT("IvanCoopModeEnabled"), true, false); UIWidgets::Tooltip("Enables Ivan the Fairy upon the next map change. Player 2 can control Ivan and " "press the C-Buttons to use items and mess with Player 1!"); - UIWidgets::PaddedEnhancementCheckbox("Rupee Dash Mode", "gRupeeDash", true, false); + UIWidgets::PaddedEnhancementCheckbox("Rupee Dash Mode", CVAR_ENHANCEMENT("RupeeDash"), true, false); UIWidgets::Tooltip("Rupees reduced over time, Link suffers damage when the count hits 0."); - if (CVarGetInteger("gRupeeDash", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("RupeeDash"), 0)) { UIWidgets::PaddedEnhancementSliderInt( - "Rupee Dash Interval: %d", "##DashInterval", "gDashInterval", 1, 10, "", 5, true, true, false, - !CVarGetInteger("gRupeeDash", 0), + "Rupee Dash Interval: %d", "##DashInterval", CVAR_ENHANCEMENT("RupeeDashInterval"), 1, 10, "", 5, true, true, false, + !CVarGetInteger(CVAR_ENHANCEMENT("RupeeDash"), 0), "This option is disabled because \"Rupee Dash Mode\" is turned off"); UIWidgets::Tooltip("Interval between Rupee reduction in Rupee Dash Mode"); } - UIWidgets::PaddedEnhancementCheckbox("Shadow Tag Mode", "gShadowTag", true, false); + UIWidgets::PaddedEnhancementCheckbox("Shadow Tag Mode", CVAR_ENHANCEMENT("ShadowTag"), true, false); UIWidgets::Tooltip("A wallmaster follows Link everywhere, don't get caught!"); - UIWidgets::PaddedEnhancementCheckbox("Additional Traps", "gAddTraps.enabled", true, false); + UIWidgets::PaddedEnhancementCheckbox("Additional Traps", CVAR_ENHANCEMENT("ExtraTraps.Enabled"), true, false); UIWidgets::Tooltip("Enables additional Trap variants."); - if (CVarGetInteger("gAddTraps.enabled", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("ExtraTraps.Enabled"), 0)) { UIWidgets::PaddedSeparator(); if (ImGui::BeginMenu("Trap Options")) { ImGui::Text("Tier 1 Traps:"); UIWidgets::Spacer(0); - UIWidgets::PaddedEnhancementCheckbox("Freeze Traps", "gAddTraps.Ice", true, false); - UIWidgets::PaddedEnhancementCheckbox("Burn Traps", "gAddTraps.Burn", true, false); - UIWidgets::PaddedEnhancementCheckbox("Shock Traps", "gAddTraps.Shock", true, false); + UIWidgets::PaddedEnhancementCheckbox("Freeze Traps", CVAR_ENHANCEMENT("ExtraTraps.Ice"), true, false); + UIWidgets::PaddedEnhancementCheckbox("Burn Traps", CVAR_ENHANCEMENT("ExtraTraps.Burn"), true, false); + UIWidgets::PaddedEnhancementCheckbox("Shock Traps", CVAR_ENHANCEMENT("ExtraTraps.Shock"), true, false); UIWidgets::PaddedSeparator(); ImGui::Text("Tier 2 Traps:"); UIWidgets::Spacer(0); - UIWidgets::PaddedEnhancementCheckbox("Knockback Traps", "gAddTraps.Knock", true, false); - UIWidgets::PaddedEnhancementCheckbox("Speed Traps", "gAddTraps.Speed", true, false); - UIWidgets::PaddedEnhancementCheckbox("Bomb Traps", "gAddTraps.Bomb", true, false); + UIWidgets::PaddedEnhancementCheckbox("Knockback Traps", CVAR_ENHANCEMENT("ExtraTraps.Knockback"), true, false); + UIWidgets::PaddedEnhancementCheckbox("Speed Traps", CVAR_ENHANCEMENT("ExtraTraps.Speed"), true, false); + UIWidgets::PaddedEnhancementCheckbox("Bomb Traps", CVAR_ENHANCEMENT("ExtraTraps.Bomb"), true, false); UIWidgets::PaddedSeparator(); ImGui::Text("Tier 3 Traps:"); UIWidgets::Spacer(0); - UIWidgets::PaddedEnhancementCheckbox("Void Traps", "gAddTraps.Void", true, false); - UIWidgets::PaddedEnhancementCheckbox("Ammo Traps", "gAddTraps.Ammo", true, false); - UIWidgets::PaddedEnhancementCheckbox("Death Traps", "gAddTraps.Kill", true, false); - UIWidgets::PaddedEnhancementCheckbox("Teleport Traps", "gAddTraps.Tele", true, false); + UIWidgets::PaddedEnhancementCheckbox("Void Traps", CVAR_ENHANCEMENT("ExtraTraps.Void"), true, false); + UIWidgets::PaddedEnhancementCheckbox("Ammo Traps", CVAR_ENHANCEMENT("ExtraTraps.Ammo"), true, false); + UIWidgets::PaddedEnhancementCheckbox("Death Traps", CVAR_ENHANCEMENT("ExtraTraps.Kill"), true, false); + UIWidgets::PaddedEnhancementCheckbox("Teleport Traps", CVAR_ENHANCEMENT("ExtraTraps.Teleport"), true, false); ImGui::EndMenu(); } } UIWidgets::Spacer(0); - if (UIWidgets::PaddedEnhancementCheckbox("Hurt Container Mode", "gHurtContainer", true, false)) { - UpdateHurtContainerModeState(CVarGetInteger("gHurtContainer", 0)); + if (UIWidgets::PaddedEnhancementCheckbox("Hurt Container Mode", CVAR_ENHANCEMENT("HurtContainer"), true, false)) { + UpdateHurtContainerModeState(CVarGetInteger(CVAR_ENHANCEMENT("HurtContainer"), 0)); } UIWidgets::Tooltip("Changes Heart Piece and Heart Container functionality.\n\n" "- Each Heart Container or full Heart Piece reduces Links hearts by 1.\n" @@ -1381,7 +1381,7 @@ void DrawEnhancementsMenu() { // Autosave enum value of 1 is the default in presets and the old checkbox "on" state for backwards compatibility UIWidgets::PaddedText("Autosave", false, true); - UIWidgets::EnhancementCombobox("gAutosave", autosaveLabels, AUTOSAVE_OFF); + UIWidgets::EnhancementCombobox(CVAR_ENHANCEMENT("Autosave"), autosaveLabels, AUTOSAVE_OFF); UIWidgets::Tooltip("Automatically save the game when changing locations and/or obtaining items\n" "Major items exclude rupees and health/magic/ammo refills (but include bombchus unless bombchu drops are enabled)"); @@ -1417,8 +1417,8 @@ void DrawEnhancementsMenu() { #ifdef __SWITCH__ UIWidgets::Spacer(0); ImGui::Text("Switch performance mode"); - if (UIWidgets::EnhancementCombobox("gSwitchPerfMode", SWITCH_CPU_PROFILES, (int)LUS::SwitchProfiles::STOCK)) { - SPDLOG_INFO("Profile:: %s", SWITCH_CPU_PROFILES[CVarGetInteger("gSwitchPerfMode", (int)LUS::SwitchProfiles::STOCK)]); + if (UIWidgets::EnhancementCombobox(CVAR_ENHANCEMENT("SwitchPerfMode"), SWITCH_CPU_PROFILES, (int)LUS::SwitchProfiles::STOCK)) { + SPDLOG_INFO("Profile:: %s", SWITCH_CPU_PROFILES[CVarGetInteger(CVAR_ENHANCEMENT("SwitchPerfMode"), (int)LUS::SwitchProfiles::STOCK)]); LUS::Switch::ApplyOverclock(); } #endif diff --git a/soh/src/code/code_80097A00.c b/soh/src/code/code_80097A00.c index eb83738e3..32110d8d2 100644 --- a/soh/src/code/code_80097A00.c +++ b/soh/src/code/code_80097A00.c @@ -205,7 +205,7 @@ u8 Inventory_DeleteEquipment(PlayState* play, s16 equipment) { if (equipment == EQUIP_TYPE_TUNIC) { gSaveContext.equips.equipment |= EQUIP_VALUE_TUNIC_KOKIRI << (EQUIP_TYPE_TUNIC * 4); // non-vanilla: remove goron and zora tunics from item buttons if assignable tunics is on - if (CVarGetInteger("gAssignableTunicsAndBoots", 0) && equipValue != EQUIP_VALUE_TUNIC_KOKIRI) { + if (CVarGetInteger(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 0) && equipValue != EQUIP_VALUE_TUNIC_KOKIRI) { ItemID item = (equipValue == EQUIP_VALUE_TUNIC_GORON ? ITEM_TUNIC_GORON : ITEM_TUNIC_ZORA); for (int i = 1; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) { if (gSaveContext.equips.buttonItems[i] == item) { diff --git a/soh/src/code/code_800EC960.c b/soh/src/code/code_800EC960.c index c7238cb39..95387b448 100644 --- a/soh/src/code/code_800EC960.c +++ b/soh/src/code/code_800EC960.c @@ -1608,7 +1608,7 @@ void func_800ED458(s32 arg0) { if (D_80130F3C != 0 && sOcarinaDropInputTimer != 0) { sOcarinaDropInputTimer--; - if (!CVarGetInteger("gDpadNoDropOcarinaInput", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("DpadNoDropOcarinaInput"), 0)) { return; } } @@ -2067,15 +2067,15 @@ void Audio_OcaMemoryGameStart(u8 minigameRound) { u8 i; // #region SOH [Enhancement] - if (CVarGetInteger("gCustomizeOcarinaGame", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("CustomizeOcarinaGame"), 0)) { u8 startingNotes = 3; - u8 roundOneCount = CVarGetInteger("gOcarinaGameRoundOneNotes", 5); - u8 roundTwoCount = CVarGetInteger("gOcarinaGameRoundTwoNotes", 6); - u8 roundThreeCount = CVarGetInteger("gOcarinaGameRoundThreeNotes", 8); + u8 roundOneCount = CVarGetInteger(CVAR_ENHANCEMENT("OcarinaGame.RoundOneNotes"), 5); + u8 roundTwoCount = CVarGetInteger(CVAR_ENHANCEMENT("OcarinaGame.RoundTwoNotes"), 6); + u8 roundThreeCount = CVarGetInteger(CVAR_ENHANCEMENT("OcarinaGame.RoundThreeNotes"), 8); u8 modMinigameNoteCnts[] = { roundOneCount, roundTwoCount, roundThreeCount }; - startingNotes = CVarGetInteger("gOcarinaGameStartingNotes", 3); + startingNotes = CVarGetInteger(CVAR_ENHANCEMENT("OcarinaGame.StartingNotes"), 3); if (minigameRound > 2) { minigameRound = 2; @@ -2118,9 +2118,9 @@ s32 Audio_OcaMemoryGameGenNote(void) { } // #region SOH [Enhancement] - if (CVarGetInteger("gCustomizeOcarinaGame", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("CustomizeOcarinaGame"), 0)) { int noteSpeed = 0x2D; - noteSpeed = noteSpeed / CVarGetInteger("gOcarinaGameNoteSpeed", 1); + noteSpeed = noteSpeed / CVarGetInteger(CVAR_ENHANCEMENT("OcarinaGame.NoteSpeed"), 1); sOcarinaSongs[OCARINA_SONG_MEMORY_GAME][sOcaMinigameAppendPos].noteIdx = rndNote; sOcarinaSongs[OCARINA_SONG_MEMORY_GAME][sOcaMinigameAppendPos].unk_02 = noteSpeed; diff --git a/soh/src/code/shrink_window.c b/soh/src/code/shrink_window.c index 015820421..ee4d2e967 100644 --- a/soh/src/code/shrink_window.c +++ b/soh/src/code/shrink_window.c @@ -6,7 +6,7 @@ s32 sShrinkWindowVal = 0; s32 sShrinkWindowCurrentVal = 0; void ShrinkWindow_SetVal(s32 value) { - if (CVarGetInteger("gDisableBlackBars", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("DisableBlackBars"), 0)) { sShrinkWindowVal = 0; return; } @@ -21,7 +21,7 @@ u32 ShrinkWindow_GetVal(void) { } void ShrinkWindow_SetCurrentVal(s32 currentVal) { - if (CVarGetInteger("gDisableBlackBars", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("DisableBlackBars"), 0)) { sShrinkWindowCurrentVal = 0; return; } diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index ec14f13b5..87c4f9b46 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -1228,7 +1228,7 @@ void Actor_Init(Actor* actor, PlayState* play) { actor->uncullZoneForward = 1000.0f; actor->uncullZoneScale = 350.0f; actor->uncullZoneDownward = 700.0f; - if (CVarGetInteger("gDisableDrawDistance", 0) != 0 && actor->id != ACTOR_EN_TORCH2 && actor->id != ACTOR_EN_BLKOBJ // Extra check for Dark Link and his room + if (CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 0) != 0 && actor->id != ACTOR_EN_TORCH2 && actor->id != ACTOR_EN_BLKOBJ // Extra check for Dark Link and his room && actor->id != ACTOR_EN_HORSE // Check for Epona, else if we call her she will spawn at the other side of the map + we can hear her during the title screen sequence && actor->id != ACTOR_EN_HORSE_GANON && actor->id != ACTOR_EN_HORSE_ZELDA // check for Zelda's and Ganondorf's horses that will always be scene during cinematic whith camera paning && (play->sceneNum != SCENE_DODONGOS_CAVERN && actor->id != ACTOR_EN_ZF)) { // Check for DC and Lizalfos for the case where the miniboss music would still play under certains conditions and changing room @@ -2350,7 +2350,7 @@ void Actor_DrawFaroresWindPointer(PlayState* play) { D_8015BC14 = 60; D_8015BC18 = 1.0f; } else if (D_8015BC14) { - D_8015BC14-= CVarGetInteger("gFastFarores", 0) ? 5 : 1; + D_8015BC14-= CVarGetInteger(CVAR_ENHANCEMENT("FastFarores"), 0) ? 5 : 1; } else if (D_8015BC18 > 0.0f) { static Vec3f effectVel = { 0.0f, -0.05f, 0.0f }; static Vec3f effectAccel = { 0.0f, -0.025f, 0.0f }; @@ -2898,7 +2898,7 @@ s32 func_800314B0(PlayState* play, Actor* actor) { s32 func_800314D4(PlayState* play, Actor* actor, Vec3f* arg2, f32 arg3) { f32 var; - if (CVarGetInteger("gDisableDrawDistance", 0) != 0 && actor->id != ACTOR_EN_TORCH2 && actor->id != ACTOR_EN_BLKOBJ // Extra check for Dark Link and his room + if (CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 0) != 0 && actor->id != ACTOR_EN_TORCH2 && actor->id != ACTOR_EN_BLKOBJ // Extra check for Dark Link and his room && actor->id != ACTOR_EN_HORSE // Check for Epona, else if we call her she will spawn at the other side of the map + we can hear her during the title screen sequence && actor->id != ACTOR_EN_HORSE_GANON && actor->id != ACTOR_EN_HORSE_ZELDA // check for Zelda's and Ganondorf's horses that will always be scene during cinematic whith camera paning && (play->sceneNum != SCENE_DODONGOS_CAVERN && actor->id != ACTOR_EN_ZF)) { // Check for DC and Lizalfos for the case where the miniboss music would still play under certains conditions and changing room @@ -3192,7 +3192,7 @@ int gMapLoading = 0; Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s16 params, s16 canRandomize) { - uint8_t tryRandomizeEnemy = CVarGetInteger("gRandomizedEnemies", 0) && gSaveContext.fileNum >= 0 && gSaveContext.fileNum <= 2 && canRandomize; + uint8_t tryRandomizeEnemy = CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) && gSaveContext.fileNum >= 0 && gSaveContext.fileNum <= 2 && canRandomize; if (tryRandomizeEnemy) { if (!GetRandomizedEnemy(play, &actorId, &posX, &posY, &posZ, &rotX, &rotY, &rotZ, ¶ms)) { @@ -3221,7 +3221,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos objBankIndex = Object_GetIndex(&gPlayState->objectCtx, dbEntry->objectId); - if (objBankIndex < 0 && (!gMapLoading || CVarGetInteger("gRandomizedEnemies", 0))) { + if (objBankIndex < 0 && (!gMapLoading || CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0))) { objBankIndex = 0; } @@ -3299,7 +3299,7 @@ Actor* Actor_SpawnAsChild(ActorContext* actorCtx, Actor* parent, PlayState* play // Gohma (z_boss_goma.c), the Stalchildren spawner (z_en_encount1.c) and the falling platform spawning Stalfos in // Forest Temple (z_bg_mori_bigst.c) that normally rely on this behaviour are changed when // Enemy Rando is on so they still work properly even without assigning a parent. - if (CVarGetInteger("gRandomizedEnemies", 0) && (spawnedActor->id == ACTOR_EN_FLOORMAS || spawnedActor->id == ACTOR_EN_PEEHAT)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) && (spawnedActor->id == ACTOR_EN_FLOORMAS || spawnedActor->id == ACTOR_EN_PEEHAT)) { return spawnedActor; } diff --git a/soh/src/code/z_camera.c b/soh/src/code/z_camera.c index 3f3c55f65..03f8b4b7a 100644 --- a/soh/src/code/z_camera.c +++ b/soh/src/code/z_camera.c @@ -1239,7 +1239,7 @@ f32 Camera_LERPClampDist(Camera* camera, f32 dist, f32 min, f32 max) { camera->rUpdateRateInv = Camera_LERPCeilF(rUpdateRateInvTarget, camera->rUpdateRateInv, PCT(OREG(25)), 0.1f); return Camera_LERPCeilF(distTarget, camera->dist, 1.0f / camera->rUpdateRateInv, - CVarGetInteger("gFixCameraDrift", 0) ? 0.0f : 0.2f); + CVarGetInteger(CVAR_ENHANCEMENT("FixCameraDrift"), 0) ? 0.0f : 0.2f); } f32 Camera_ClampDist(Camera* camera, f32 dist, f32 minDist, f32 maxDist, s16 timer) { @@ -1262,7 +1262,7 @@ f32 Camera_ClampDist(Camera* camera, f32 dist, f32 minDist, f32 maxDist, s16 tim camera->rUpdateRateInv = Camera_LERPCeilF(rUpdateRateInvTarget, camera->rUpdateRateInv, PCT(OREG(25)), 0.1f); return Camera_LERPCeilF(distTarget, camera->dist, 1.0f / camera->rUpdateRateInv, - CVarGetInteger("gFixCameraDrift", 0) ? 0.0f : 0.2f); + CVarGetInteger(CVAR_ENHANCEMENT("FixCameraDrift"), 0) ? 0.0f : 0.2f); } s16 Camera_CalcDefaultPitch(Camera* camera, s16 arg1, s16 arg2, s16 arg3) { @@ -1710,7 +1710,7 @@ s32 Camera_Normal1(Camera* camera) { Camera_Vec3fVecSphGeoAdd(eyeNext, at, &eyeAdjustment); if ((camera->status == CAM_STAT_ACTIVE) && (!(norm1->interfaceFlags & 0x10))) { anim->swingYawTarget = BINANG_ROT180(camera->playerPosRot.rot.y); - if (!CVarGetInteger("gFixCameraSwing", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("FixCameraSwing"), 0)) { if (anim->startSwingTimer > 0) { func_80046E20(camera, &eyeAdjustment, norm1->distMin, norm1->unk_0C, &sp98, &anim->swing); } else { @@ -1749,7 +1749,7 @@ s32 Camera_Normal1(Camera* camera) { } // crit wiggle - if(!CVarGetInteger("gDisableCritWiggle",0)) { + if(!CVarGetInteger(CVAR_ENHANCEMENT("DisableCritWiggle"),0)) { if (gSaveContext.health <= 16 && ((camera->play->state.frames % 256) == 0)) { wiggleAdj = Rand_ZeroOne() * 10000.0f; camera->inputDir.y = wiggleAdj + camera->inputDir.y; @@ -4726,7 +4726,7 @@ s32 Camera_Unique1(Camera* camera) { anim->timer--; } - sp8C.yaw = Camera_LERPFloorS(anim->yawTarget, eyeNextAtOffset.yaw, 0.5f, CVarGetInteger("gFixHangingLedgeSwingRate", 0) ? 0xA : 0x2710); + sp8C.yaw = Camera_LERPFloorS(anim->yawTarget, eyeNextAtOffset.yaw, 0.5f, CVarGetInteger(CVAR_ENHANCEMENT("FixHangingLedgeSwingRate"), 0) ? 0xA : 0x2710); Camera_Vec3fVecSphGeoAdd(eyeNext, at, &sp8C); *eye = *eyeNext; Camera_BGCheck(camera, at, eye); diff --git a/soh/src/code/z_collision_check.c b/soh/src/code/z_collision_check.c index c4716c947..5376ae41c 100644 --- a/soh/src/code/z_collision_check.c +++ b/soh/src/code/z_collision_check.c @@ -3047,7 +3047,7 @@ void CollisionCheck_ApplyDamage(PlayState* play, CollisionCheckContext* colChkCt collider->actor->colChkInfo.damage += damage; } - if (CVarGetInteger("gIvanCoopModeEnabled", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("IvanCoopModeEnabled"), 0)) { collider->actor->colChkInfo.damage *= GET_PLAYER(play)->ivanDamageMultiplier; } } @@ -3667,7 +3667,7 @@ u8 CollisionCheck_GetSwordDamage(s32 dmgFlags, PlayState* play) { damage = 8; } - if (CVarGetInteger("gIvanCoopModeEnabled", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("IvanCoopModeEnabled"), 0)) { damage *= GET_PLAYER(play)->ivanDamageMultiplier; } diff --git a/soh/src/code/z_construct.c b/soh/src/code/z_construct.c index c8a340492..960088cba 100644 --- a/soh/src/code/z_construct.c +++ b/soh/src/code/z_construct.c @@ -430,8 +430,8 @@ void Regs_InitDataImpl(void) { WREG(28) = 0; R_OW_MINIMAP_X = 238; R_OW_MINIMAP_Y = 164; - if (!CVarGetInteger("gEnhancements.RememberMapToggleState", 0)) { - R_MINIMAP_DISABLED = CVarGetInteger("gMinimalUI", 0); + if (!CVarGetInteger(CVAR_ENHANCEMENT("RememberMapToggleState"), 0)) { + R_MINIMAP_DISABLED = CVarGetInteger(CVAR_ENHANCEMENT("MinimalUI"), 0); } WREG(32) = 122; WREG(33) = 60; diff --git a/soh/src/code/z_demo.c b/soh/src/code/z_demo.c index 21ac5eae7..55f62c1e0 100644 --- a/soh/src/code/z_demo.c +++ b/soh/src/code/z_demo.c @@ -512,9 +512,9 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB } bool playCutscene = false; - if (!CVarGetInteger("gCreditsFix", 1) && (cmd->startFrame == csCtx->frames)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("CreditsFix"), 1) && (cmd->startFrame == csCtx->frames)) { playCutscene = true; - } else if (CVarGetInteger("gCreditsFix", 1)) { + } else if (CVarGetInteger(CVAR_ENHANCEMENT("CreditsFix"), 1)) { u16 delay = 0; // HACK: Align visual timing with audio during credits sequence @@ -616,7 +616,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB play->transitionType = TRANS_TYPE_INSTANT; break; case 8: - if (CVarGetInteger("gBetterFW", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("BetterFarore"), 0)) { FaroresWindData tempFW = gSaveContext.backupFW; gSaveContext.backupFW = gSaveContext.fw; gSaveContext.fw = tempFW; diff --git a/soh/src/code/z_en_item00.c b/soh/src/code/z_en_item00.c index 136df2ef0..4f59e29df 100644 --- a/soh/src/code/z_en_item00.c +++ b/soh/src/code/z_en_item00.c @@ -333,7 +333,7 @@ void EnItem00_SetupAction(EnItem00* this, EnItem00ActionFunc actionFunc) { void EnItem00_SetObjectDependency(EnItem00* this, PlayState* play, s16 objectIndex) { // Remove object dependency for Enemy Randomizer and Crowd Control to allow Like-likes to // drop equipment correctly in rooms where Like-likes normally don't spawn. - if (CVarGetInteger("gRandomizedEnemies", 0) || CVarGetInteger("gCrowdControl", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) || CVarGetInteger("gCrowdControl", 0)) { this->actor.objBankIndex = 0; } else { this->actor.objBankIndex = Object_GetIndex(&play->objectCtx, objectIndex); @@ -781,7 +781,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { (this->actor.params >= ITEM00_ARROWS_SMALL && this->actor.params <= ITEM00_SMALL_KEY) || this->actor.params == ITEM00_BOMBS_A || this->actor.params == ITEM00_ARROWS_SINGLE || this->actor.params == ITEM00_BOMBS_SPECIAL || this->actor.params == ITEM00_BOMBCHU) { - if (CVarGetInteger("gNewDrops", 0) || + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0) || // Keys in randomizer need to always rotate for their GID replacement (IS_RANDO && this->actor.params == ITEM00_SMALL_KEY)) { this->actor.shape.rot.y += 960; @@ -1008,35 +1008,35 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { if (!(this->unk_156 & this->unk_158)) { switch (this->actor.params) { case ITEM00_RUPEE_GREEN: - if (CVarGetInteger("gNewDrops", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0)) { mtxScale = 25.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); GetItem_Draw(play, GID_RUPEE_GREEN); break; } case ITEM00_RUPEE_BLUE: - if (CVarGetInteger("gNewDrops", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0)) { mtxScale = 25.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); GetItem_Draw(play, GID_RUPEE_BLUE); break; } case ITEM00_RUPEE_RED: - if (CVarGetInteger("gNewDrops", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0)) { mtxScale = 25.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); GetItem_Draw(play, GID_RUPEE_RED); break; } case ITEM00_RUPEE_ORANGE: - if (CVarGetInteger("gNewDrops", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0)) { mtxScale = 17.5f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); GetItem_Draw(play, GID_RUPEE_GOLD); break; } case ITEM00_RUPEE_PURPLE: - if (CVarGetInteger("gNewDrops", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0)) { mtxScale = 17.5f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); GetItem_Draw(play, GID_RUPEE_PURPLE); @@ -1046,7 +1046,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { } break; case ITEM00_HEART_PIECE: - if (CVarGetInteger("gNewDrops", 0) && !IS_RANDO) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0) && !IS_RANDO) { mtxScale = 21.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); GetItem_Draw(play, GID_HEART_PIECE); @@ -1059,7 +1059,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { break; case ITEM00_HEART: // Only change despawn-able recovery hearts - if (CVarGetInteger("gNewDrops", 0) && this->unk_15A >= 0) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0) && this->unk_15A >= 0) { mtxScale = 16.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); GetItem_Draw(play, GID_HEART); @@ -1085,7 +1085,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { case ITEM00_BOMBS_A: case ITEM00_BOMBS_B: case ITEM00_BOMBS_SPECIAL: - if (CVarGetInteger("gNewDrops", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0)) { mtxScale = 8.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); GetItem_Draw(play, GID_BOMB); @@ -1093,70 +1093,70 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { } case ITEM00_ARROWS_SINGLE: case ITEM00_ARROWS_SMALL: - if (CVarGetInteger("gNewDrops", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0)) { mtxScale = 7.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); GetItem_Draw(play, GID_ARROWS_SMALL); break; } case ITEM00_ARROWS_MEDIUM: - if (CVarGetInteger("gNewDrops", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0)) { mtxScale = 7.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); GetItem_Draw(play, GID_ARROWS_MEDIUM); break; } case ITEM00_ARROWS_LARGE: - if (CVarGetInteger("gNewDrops", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0)) { mtxScale = 7.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); GetItem_Draw(play, GID_ARROWS_LARGE); break; } case ITEM00_NUTS: - if (CVarGetInteger("gNewDrops", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0)) { mtxScale = 9.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); GetItem_Draw(play, GID_NUTS); break; } case ITEM00_STICK: - if (CVarGetInteger("gNewDrops", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0)) { mtxScale = 7.5f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); GetItem_Draw(play, GID_STICK); break; } case ITEM00_MAGIC_LARGE: - if (CVarGetInteger("gNewDrops", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0)) { mtxScale = 8.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); GetItem_Draw(play, GID_MAGIC_LARGE); break; } case ITEM00_MAGIC_SMALL: - if (CVarGetInteger("gNewDrops", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0)) { mtxScale = 8.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); GetItem_Draw(play, GID_MAGIC_SMALL); break; } case ITEM00_SEEDS: - if (CVarGetInteger("gNewDrops", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0)) { mtxScale = 7.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); GetItem_Draw(play, GID_SEEDS); break; } case ITEM00_BOMBCHU: - if (CVarGetInteger("gNewDrops", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0)) { mtxScale = 9.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); GetItem_Draw(play, GID_BOMBCHU); break; } case ITEM00_SMALL_KEY: - if (CVarGetInteger("gNewDrops", 0) && !IS_RANDO) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0) && !IS_RANDO) { mtxScale = 8.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); GetItem_Draw(play, GID_KEY_SMALL); @@ -1523,7 +1523,7 @@ s16 func_8001F404(s16 dropId) { if (LINK_IS_ADULT) { if (dropId == ITEM00_SEEDS) { dropId = ITEM00_ARROWS_SMALL; - } else if ((dropId == ITEM00_STICK) && !(CVarGetInteger("gTreeStickDrops", 0))) { + } else if ((dropId == ITEM00_STICK) && !(CVarGetInteger(CVAR_ENHANCEMENT("TreesDropSticks"), 0))) { dropId = ITEM00_RUPEE_GREEN; } } else { @@ -1532,7 +1532,7 @@ s16 func_8001F404(s16 dropId) { } } - if ((CVarGetInteger("gBombchuDrops", 0) || + if ((CVarGetInteger(CVAR_ENHANCEMENT("BombchuDrops"), 0) || (IS_RANDO && Randomizer_GetSettingValue(RSK_ENABLE_BOMBCHU_DROPS) == 1)) && (dropId == ITEM00_BOMBS_A || dropId == ITEM00_BOMBS_B || dropId == ITEM00_BOMBS_SPECIAL)) { dropId = EnItem00_ConvertBombDropToBombchu(dropId); @@ -1566,7 +1566,7 @@ EnItem00* Item_DropCollectible(PlayState* play, Vec3f* spawnPos, s16 params) { params &= 0x3FFF; - if ((params & 0x00FF) == ITEM00_HEART && CVarGetInteger("gNoHeartDrops", 0)) { return NULL; } + if ((params & 0x00FF) == ITEM00_HEART && CVarGetInteger(CVAR_ENHANCEMENT("NoHeartDrops"), 0)) { return NULL; } if (((params & 0x00FF) == ITEM00_FLEXIBLE) && !param4000) { // TODO: Prevent the cast to EnItem00 here since this is a different actor (En_Elf) @@ -1611,7 +1611,7 @@ EnItem00* Item_DropCollectible2(PlayState* play, Vec3f* spawnPos, s16 params) { params &= 0x3FFF; - if ((params & 0x00FF) == ITEM00_HEART && CVarGetInteger("gNoHeartDrops", 0)) { return NULL; } + if ((params & 0x00FF) == ITEM00_HEART && CVarGetInteger(CVAR_ENHANCEMENT("NoHeartDrops"), 0)) { return NULL; } if (((params & 0x00FF) == ITEM00_FLEXIBLE) && !param4000) { // TODO: Prevent the cast to EnItem00 here since this is a different actor (En_Elf) @@ -1648,7 +1648,7 @@ void Item_DropCollectibleRandom(PlayState* play, Actor* fromActor, Vec3f* spawnP param8000 = params & 0x8000; params &= 0x7FFF; - if (CVarGetInteger("gNoRandomDrops", 0)) { return; } + if (CVarGetInteger(CVAR_ENHANCEMENT("NoRandomDrops"), 0)) { return; } if (fromActor != NULL) { if (fromActor->dropFlag) { @@ -1691,11 +1691,11 @@ void Item_DropCollectibleRandom(PlayState* play, Actor* fromActor, Vec3f* spawnP EffectSsDeadSound_SpawnStationary(play, spawnPos, NA_SE_EV_BUTTERFRY_TO_FAIRY, true, DEADSOUND_REPEAT_MODE_OFF, 40); return; - } else if (gSaveContext.health <= 0x30 && !CVarGetInteger("gNoHeartDrops", 0)) { // 3 hearts or less + } else if (gSaveContext.health <= 0x30 && !CVarGetInteger(CVAR_ENHANCEMENT("NoHeartDrops"), 0)) { // 3 hearts or less params = 0xB * 0x10; dropTableIndex = 0x0; dropId = ITEM00_HEART; - } else if (gSaveContext.health <= 0x50 && !CVarGetInteger("gNoHeartDrops", 0)) { // 5 hearts or less + } else if (gSaveContext.health <= 0x50 && !CVarGetInteger(CVAR_ENHANCEMENT("NoHeartDrops"), 0)) { // 5 hearts or less params = 0xA * 0x10; dropTableIndex = 0x0; dropId = ITEM00_HEART; @@ -1728,7 +1728,7 @@ void Item_DropCollectibleRandom(PlayState* play, Actor* fromActor, Vec3f* spawnP } } - if (dropId != 0xFF && (!CVarGetInteger("gNoHeartDrops", 0) || dropId != ITEM00_HEART)) { + if (dropId != 0xFF && (!CVarGetInteger(CVAR_ENHANCEMENT("NoHeartDrops"), 0) || dropId != ITEM00_HEART)) { dropQuantity = sDropQuantities[params + dropTableIndex]; while (dropQuantity > 0) { if (!param8000) { @@ -1753,7 +1753,7 @@ void Item_DropCollectibleRandom(PlayState* play, Actor* fromActor, Vec3f* spawnP } } } else { - if (CVarGetInteger("gBushDropFix", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("BushDropFix"), 0)) { Item_DropCollectible(play, spawnPos, dropId | 0x8000); } else { Item_DropCollectible(play, spawnPos, params | 0x8000); diff --git a/soh/src/code/z_face_reaction.c b/soh/src/code/z_face_reaction.c index 899c6afc6..278af706e 100644 --- a/soh/src/code/z_face_reaction.c +++ b/soh/src/code/z_face_reaction.c @@ -67,7 +67,7 @@ u16 sReactionTextIds[][PLAYER_MASK_MAX] = { u16 Text_GetFaceReaction(PlayState* play, u32 reactionSet) { u8 currentMask = Player_GetMask(play); - if (CVarGetInteger("gMMBunnyHood", BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA && currentMask == PLAYER_MASK_BUNNY) { + if (CVarGetInteger(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA && currentMask == PLAYER_MASK_BUNNY) { return 0; } else { return sReactionTextIds[reactionSet][currentMask]; diff --git a/soh/src/code/z_fcurve_data_skelanime.c b/soh/src/code/z_fcurve_data_skelanime.c index b75c34a61..91b6dc90c 100644 --- a/soh/src/code/z_fcurve_data_skelanime.c +++ b/soh/src/code/z_fcurve_data_skelanime.c @@ -131,7 +131,7 @@ void SkelCurve_DrawLimb(PlayState* play, s32 limbIndex, SkelAnimeCurve* skelCurv Matrix_TranslateRotateZYX(&pos, &rot); Matrix_Scale(scale.x, scale.y, scale.z, MTXMODE_APPLY); - if (CVarGetInteger("gDisableLOD", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("DisableLOD"), 0)) { lod = 0; } diff --git a/soh/src/code/z_lifemeter.c b/soh/src/code/z_lifemeter.c index 69cba24b4..bc337df4c 100644 --- a/soh/src/code/z_lifemeter.c +++ b/soh/src/code/z_lifemeter.c @@ -602,7 +602,7 @@ void HealthMeter_Draw(PlayState* play) { { Mtx* matrix = Graph_Alloc(gfxCtx, sizeof(Mtx)); - if (CVarGetInteger("gNoHUDHeartAnimation", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NoHUDHeartAnimation"), 0)) { Matrix_SetTranslateScaleMtx2(matrix, HeartsScale, // Scale X HeartsScale, // Scale Y @@ -646,7 +646,7 @@ void HealthMeter_HandleCriticalAlarm(PlayState* play) { if (interfaceCtx->unk_22A <= 0) { interfaceCtx->unk_22A = 0; interfaceCtx->unk_22C = 0; - if (CVarGetInteger("gLowHpAlarm", 0) == 0 && !Player_InCsMode(play) && (play->pauseCtx.state == 0) && + if (CVarGetInteger(CVAR_ENHANCEMENT("LowHpAlarm"), 0) == 0 && !Player_InCsMode(play) && (play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0) && HealthMeter_IsCritical() && !Play_InCsMode(play)) { func_80078884(NA_SE_SY_HITPOINT_ALARM); } diff --git a/soh/src/code/z_map_exp.c b/soh/src/code/z_map_exp.c index 60ac73cda..2370f3a58 100644 --- a/soh/src/code/z_map_exp.c +++ b/soh/src/code/z_map_exp.c @@ -918,14 +918,14 @@ void Minimap_Draw(PlayState* play) { // or hide them entirely if the fix is applied if (gMapData->owEntranceIconPosY[sEntranceIconMapIndex] == 0) { entranceY = 0; - entranceX = CVarGetInteger("gFixDungeonMinimapIcon", 0) ? -9999 : OTRGetRectDimensionFromLeftEdge(0); + entranceX = CVarGetInteger(CVAR_ENHANCEMENT("FixDungeonMinimapIcon"), 0) ? -9999 : OTRGetRectDimensionFromLeftEdge(0); } //! @bug UB: sEntranceIconMapIndex can be up to 23 and is accessing owEntranceFlag which is size 20 if ((gMapData->owEntranceFlag[sEntranceIconMapIndex] == 0xFFFF) || ((gMapData->owEntranceFlag[sEntranceIconMapIndex] != 0xFFFF) && ((gSaveContext.infTable[26] & gBitFlags[gMapData->owEntranceFlag[mapIndex]]) || - CVarGetInteger("gAlwaysShowDungeonMinimapIcon", 0)))) { + CVarGetInteger(CVAR_ENHANCEMENT("AlwaysShowDungeonMinimapIcon"), 0)))) { gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, iconSize, iconSize, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); @@ -952,7 +952,7 @@ void Minimap_Draw(PlayState* play) { // Ice Cavern entrance icon if ((play->sceneNum == SCENE_ZORAS_FOUNTAIN) && ((gSaveContext.infTable[26] & gBitFlags[9]) || - CVarGetInteger("gAlwaysShowDungeonMinimapIcon", 0))) { + CVarGetInteger(CVAR_ENHANCEMENT("AlwaysShowDungeonMinimapIcon"), 0))) { gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, iconSize, iconSize, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index fa4c6c01b..149ca72df 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -150,7 +150,7 @@ void Message_UpdateOcarinaGame(PlayState* play) { u8 Message_ShouldAdvance(PlayState* play) { Input* input = &play->state.input[0]; - bool isB_Held = CVarGetInteger("gSkipText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) + bool isB_Held = CVarGetInteger(CVAR_ENHANCEMENT("SkipText"), 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) : CHECK_BTN_ALL(input->press.button, BTN_B); if (CHECK_BTN_ALL(input->press.button, BTN_A) || isB_Held || CHECK_BTN_ALL(input->press.button, BTN_CUP)) { @@ -162,7 +162,7 @@ u8 Message_ShouldAdvance(PlayState* play) { u8 Message_ShouldAdvanceSilent(PlayState* play) { Input* input = &play->state.input[0]; - bool isB_Held = CVarGetInteger("gSkipText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) + bool isB_Held = CVarGetInteger(CVAR_ENHANCEMENT("SkipText"), 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) : CHECK_BTN_ALL(input->press.button, BTN_B); return CHECK_BTN_ALL(input->press.button, BTN_A) || isB_Held || CHECK_BTN_ALL(input->press.button, BTN_CUP); @@ -291,7 +291,7 @@ void Message_FindMessage(PlayState* play, u16 textId) { const char* seg; u16 bufferId = textId; // Use the better owl message if better owl is enabled - if (CVarGetInteger("gBetterOwl", 0) != 0 && (bufferId == 0x2066 || bufferId == 0x607B || + if (CVarGetInteger(CVAR_ENHANCEMENT("BetterOwl"), 0) != 0 && (bufferId == 0x2066 || bufferId == 0x607B || bufferId == 0x10C2 || bufferId == 0x10C6 || bufferId == 0x206A)) { bufferId = 0x71B3; @@ -873,7 +873,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { Message_SetTextColor(msgCtx, msgCtx->msgBufDecoded[++i] & 0xF); break; case ' ': - msgCtx->textPosX += CVarGetInteger("gTextSpacing", 6); + msgCtx->textPosX += CVarGetInteger(CVAR_ENHANCEMENT("TextSpacing"), 6); break; case MESSAGE_BOX_BREAK: if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { @@ -1032,7 +1032,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { msgCtx->textDelay = msgCtx->msgBufDecoded[++i]; break; case MESSAGE_UNSKIPPABLE: - msgCtx->textUnskippable = CVarGetInteger("gSkipText", 0) != 1; + msgCtx->textUnskippable = CVarGetInteger(CVAR_ENHANCEMENT("SkipText"), 0) != 1; break; case MESSAGE_TWO_CHOICE: msgCtx->textboxEndType = TEXTBOX_ENDTYPE_2_CHOICE; @@ -1116,7 +1116,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { } } if (msgCtx->textDelayTimer == 0) { - msgCtx->textDrawPos = i + CVarGetInteger("gTextSpeed", 2); + msgCtx->textDrawPos = i + CVarGetInteger(CVAR_ENHANCEMENT("TextSpeed"), 2); msgCtx->textDelayTimer = msgCtx->textDelay; } else { msgCtx->textDelayTimer--; @@ -1189,7 +1189,7 @@ void Message_Decode(PlayState* play) { phi_s1 = temp_s2 = msgCtx->msgBufDecoded[decodedBufPos] = font->msgBuf[msgCtx->msgBufPos]; // Don't require input for credits textboxes in randomizer - if (CVarGetInteger("gNoInputForCredits", 0) && ( + if (CVarGetInteger(CVAR_ENHANCEMENT("NoInputForCredits"), 0) && ( msgCtx->textId == 0x706F || msgCtx->textId == 0x7091 || msgCtx->textId == 0x7092 || @@ -1654,7 +1654,7 @@ void Message_OpenText(PlayState* play, u16 textId) { //DmaMgr_SendRequest1(font->msgBuf, (uintptr_t)(_staff_message_data_staticSegmentRomStart + 4 + font->msgOffset), //font->msgLength, __FILE__, __LINE__); - } else if (CVarGetInteger("gAskToEquip", 0) && + } else if (CVarGetInteger(CVAR_ENHANCEMENT("AskToEquip"), 0) && (((LINK_IS_ADULT || CVarGetInteger(CVAR_CHEAT("TimelessEquipment"), 0)) && // 0C = Biggoron, 4B = Giant's, 4E = Mirror Shield, 50-51 = Tunics (textId == 0x0C || textId == 0x4B || textId == 0x4E || @@ -2155,7 +2155,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); - bool isB_Held = CVarGetInteger("gSkipText", 0) != 0 ? CHECK_BTN_ALL(play->state.input[0].cur.button, BTN_B) + bool isB_Held = CVarGetInteger(CVAR_ENHANCEMENT("SkipText"), 0) != 0 ? CHECK_BTN_ALL(play->state.input[0].cur.button, BTN_B) : CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B); switch (msgCtx->msgMode) { @@ -2436,7 +2436,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { } break; case MSGMODE_SETUP_DISPLAY_SONG_PLAYED: - if (CVarGetInteger("gFastOcarinaPlayback", 0) == 0 || + if (CVarGetInteger(CVAR_ENHANCEMENT("FastOcarinaPlayback"), 0) == 0 || play->msgCtx.lastPlayedSong == OCARINA_SONG_TIME || play->msgCtx.lastPlayedSong == OCARINA_SONG_STORMS || play->msgCtx.lastPlayedSong == OCARINA_SONG_SUNS) { @@ -2491,7 +2491,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { Message_Decode(play); msgCtx->msgMode = MSGMODE_DISPLAY_SONG_PLAYED_TEXT; - if (CVarGetInteger("gFastOcarinaPlayback", 0) == 0 || play->msgCtx.lastPlayedSong == OCARINA_SONG_TIME + if (CVarGetInteger(CVAR_ENHANCEMENT("FastOcarinaPlayback"), 0) == 0 || play->msgCtx.lastPlayedSong == OCARINA_SONG_TIME || play->msgCtx.lastPlayedSong == OCARINA_SONG_STORMS || play->msgCtx.lastPlayedSong == OCARINA_SONG_SUNS) { msgCtx->stateTimer = 20; @@ -3148,7 +3148,7 @@ void Message_Update(PlayState* play) { GameInteractor_ExecuteOnDialogMessage(); - bool isB_Held = CVarGetInteger("gSkipText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) && !sTextboxSkipped + bool isB_Held = CVarGetInteger(CVAR_ENHANCEMENT("SkipText"), 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) && !sTextboxSkipped : CHECK_BTN_ALL(input->press.button, BTN_B); switch (msgCtx->msgMode) { @@ -3367,7 +3367,7 @@ void Message_Update(PlayState* play) { } if ((s32)(gSaveContext.inventory.questItems & 0xF0000000) == 0x40000000) { gSaveContext.inventory.questItems ^= 0x40000000; - if (!CVarGetInteger("gHurtContainer", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("HurtContainer"), 0)) { gSaveContext.healthCapacity += 0x10; gSaveContext.health += 0x10; } else { diff --git a/soh/src/code/z_olib.c b/soh/src/code/z_olib.c index 2b72f3014..da4959726 100644 --- a/soh/src/code/z_olib.c +++ b/soh/src/code/z_olib.c @@ -80,7 +80,7 @@ Vec3f* OLib_VecSphToVec3f(Vec3f* dest, VecSph* sph) { f32 sinYaw; f32 cosYaw; - if (CVarGetInteger("gFixCameraDrift", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("FixCameraDrift"), 0)) { cosPitch = Math_AccurateCosS(sph->pitch); cosYaw = Math_AccurateCosS(sph->yaw); sinPitch = Math_AccurateSinS(sph->pitch); diff --git a/soh/src/code/z_onepointdemo.c b/soh/src/code/z_onepointdemo.c index 2ece7c2f1..caf6da8d6 100644 --- a/soh/src/code/z_onepointdemo.c +++ b/soh/src/code/z_onepointdemo.c @@ -72,7 +72,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 camIdx, s16 csId, Actor* actor // #region SOH [Enhancement] //the default is 90, lower values necessary to prevent camera swing as animation speeds up - s16 camCrawlTemp = CVarGetInteger("gCrawlSpeed", 1); + s16 camCrawlTemp = CVarGetInteger(CVAR_ENHANCEMENT("CrawlSpeed"), 1); s16 camCrawlTimer = D_8012042C / camCrawlTemp; // #endregion @@ -336,7 +336,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 camIdx, s16 csId, Actor* actor case 9601: Play_CameraChangeSetting(play, camIdx, CAM_SET_CS_3); Play_CameraChangeSetting(play, MAIN_CAM, mainCam->prevSetting); - if (CVarGetInteger("gCrawlSpeed", 1) > 1) { + if (CVarGetInteger(CVAR_ENHANCEMENT("CrawlSpeed"), 1) > 1) { OnePointCutscene_SetCsCamPoints(csCam, D_80120430 | 0x1000, camCrawlTimer, D_80120308, D_80120398); } else { OnePointCutscene_SetCsCamPoints(csCam, D_80120430 | 0x1000, D_8012042C, D_80120308, D_80120398); @@ -344,7 +344,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 camIdx, s16 csId, Actor* actor break; case 9602: // #region SOH [Enhancement] - if (CVarGetInteger("gCrawlSpeed", 1) > 1) { + if (CVarGetInteger(CVAR_ENHANCEMENT("CrawlSpeed"), 1) > 1) { Play_CameraChangeSetting(play, camIdx, CAM_SET_CS_3); Play_CameraChangeSetting(play, MAIN_CAM, mainCam->prevSetting); OnePointCutscene_SetCsCamPoints(csCam, D_80120430 | 0x1000, camCrawlTimer, D_80120308, D_80120434); diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index e9788f7f8..dd6949e8e 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -1170,7 +1170,7 @@ void func_80083108(PlayState* play) { if (interfaceCtx->restrictions.tradeItems != 0) { for (i = 1; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) { - if ((CVarGetInteger("gMMBunnyHood", BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA) + if ((CVarGetInteger(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA) && (gSaveContext.equips.buttonItems[i] >= ITEM_MASK_KEATON) && (gSaveContext.equips.buttonItems[i] <= ITEM_MASK_TRUTH)) { gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] = BTN_ENABLED; @@ -1401,7 +1401,7 @@ void Interface_SetSceneRestrictions(PlayState* play) { interfaceCtx->restrictions.farores, interfaceCtx->restrictions.dinsNayrus, interfaceCtx->restrictions.all); osSyncPrintf(VT_RST); - if (CVarGetInteger("gBetterFW", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("BetterFarore"), 0)) { if (currentScene == SCENE_GERUDO_TRAINING_GROUND || currentScene == SCENE_INSIDE_GANONS_CASTLE) { interfaceCtx->restrictions.farores = 0; } @@ -2278,7 +2278,7 @@ u8 Item_Give(PlayState* play, u8 item) { gSaveContext.sohStats.heartPieces++; return Return_Item(item, MOD_NONE, ITEM_NONE); } else if (item == ITEM_HEART_CONTAINER) { - if (!CVarGetInteger("gHurtContainer", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("HurtContainer"), 0)) { gSaveContext.healthCapacity += 0x10; gSaveContext.health += 0x10; } else { @@ -2379,7 +2379,7 @@ u8 Item_Give(PlayState* play, u8 item) { } return Return_Item(item, MOD_NONE, ITEM_NONE); } else if ((item >= ITEM_WEIRD_EGG) && (item <= ITEM_CLAIM_CHECK)) { - if ((item == ITEM_SAW) && CVarGetInteger("gDekuNutUpgradeFix", 0) == 0) { + if ((item == ITEM_SAW) && CVarGetInteger(CVAR_ENHANCEMENT("DekuNutUpgradeFix"), 0) == 0) { Flags_SetItemGetInf(ITEMGETINF_OBTAINED_NUT_UPGRADE_FROM_STAGE); } @@ -2905,7 +2905,7 @@ void Inventory_UpdateBottleItem(PlayState* play, u8 item, u8 button) { item = ITEM_MILK_HALF; } - if (CVarGetInteger("gRestoreRBAValues",0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("RestoreRBAValues"),0)) { byteSwapInventory(); gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[button - 1]] = item; byteSwapInventory(); @@ -3016,7 +3016,7 @@ void Interface_SetNaviCall(PlayState* play, u16 naviCallState) { if (((naviCallState == 0x1D) || (naviCallState == 0x1E)) && !interfaceCtx->naviCalling && (play->csCtx.state == CS_STATE_IDLE)) { - if (!CVarGetInteger("gDisableNaviCallAudio", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("DisableNaviCallAudio"), 0)) { // clang-format off if (naviCallState == 0x1E) { Audio_PlaySoundGeneral(NA_SE_VO_NAVY_CALL, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } @@ -4132,7 +4132,7 @@ void Interface_DrawItemButtons(PlayState* play) { const s16 C_Right_BTN_Pos_ori[] = { C_RIGHT_BUTTON_X+X_Margins_CR, C_RIGHT_BUTTON_Y+Y_Margins_CR }; const s16 C_Up_BTN_Pos_ori[] = { C_UP_BUTTON_X+X_Margins_CU, C_UP_BUTTON_Y+Y_Margins_CU }; const s16 C_Down_BTN_Pos_ori[] = { C_DOWN_BUTTON_X+X_Margins_CD, C_DOWN_BUTTON_Y+Y_Margins_CD }; - s16 LabelX_Navi=7 + !!CVarGetInteger("gNaviTextFix", 0); + s16 LabelX_Navi=7 + !!CVarGetInteger(CVAR_ENHANCEMENT("NaviTextFix"), 0); s16 LabelY_Navi=4; s16 C_Left_BTN_Pos[2]; //(X,Y) s16 C_Right_BTN_Pos[2]; @@ -5119,7 +5119,7 @@ void Interface_Draw(PlayState* play) { s16 svar4; s16 svar5; s16 svar6; - bool fullUi = !CVarGetInteger("gMinimalUI", 0) || !R_MINIMAP_DISABLED || play->pauseCtx.state != 0; + bool fullUi = !CVarGetInteger(CVAR_ENHANCEMENT("MinimalUI"), 0) || !R_MINIMAP_DISABLED || play->pauseCtx.state != 0; if (GameInteractor_NoUIActive()) { return; @@ -5143,7 +5143,7 @@ void Interface_Draw(PlayState* play) { if (fullUi) { // Rupee Icon - if (CVarGetInteger("gDynamicWalletIcon", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("DynamicWalletIcon"), 0)) { switch (CUR_UPG_VALUE(UPG_WALLET)) { case 0: if (CVarGetInteger("gCosmetics.Consumable_GreenRupee.Changed", 0)) { @@ -5346,7 +5346,7 @@ void Interface_Draw(PlayState* play) { gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0); } - if (CVarGetInteger("gDrawLineupTick", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("DrawLineupTick"), 0)) { Interface_DrawLineupTick(play); } @@ -5366,7 +5366,7 @@ void Interface_Draw(PlayState* play) { } // Render enemy health bar after Z-target to leverage set variables - if (CVarGetInteger("gEnemyHealthBar", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("EnemyHealthBar"), 0)) { Interface_DrawEnemyHealthBar(&play->actorCtx.targetCtx, play); } } diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index 9bc72380e..6e745ea7f 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -675,7 +675,7 @@ void Play_Init(GameState* thisx) { Fault_AddClient(&D_801614B8, ZeldaArena_Display, NULL, NULL); // In order to keep bunny hood equipped on first load, we need to pre-set the age reqs for the item and slot - if ((CVarGetInteger("gMMBunnyHood", BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA && CVarGetInteger("gAdultBunnyHood", 0)) || CVarGetInteger(CVAR_CHEAT("TimelessEquipment"), 0)) { + if ((CVarGetInteger(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA && CVarGetInteger(CVAR_ENHANCEMENT("AdultBunnyHood"), 0)) || CVarGetInteger(CVAR_CHEAT("TimelessEquipment"), 0)) { gItemAgeReqs[ITEM_MASK_BUNNY] = AGE_REQ_NONE; if(INV_CONTENT(ITEM_TRADE_CHILD) == ITEM_MASK_BUNNY) gSlotAgeReqs[SLOT_TRADE_CHILD] = AGE_REQ_NONE; @@ -762,7 +762,7 @@ void Play_Init(GameState* thisx) { } #endif - if (CVarGetInteger("gIvanCoopModeEnabled", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("IvanCoopModeEnabled"), 0)) { Actor_Spawn(&play->actorCtx, play, gEnPartnerId, GET_PLAYER(play)->actor.world.pos.x, GET_PLAYER(play)->actor.world.pos.y + Player_GetHeight(GET_PLAYER(play)) + 5.0f, GET_PLAYER(play)->actor.world.pos.z, 0, 0, 0, 1, true); @@ -1216,7 +1216,7 @@ void Play_Update(PlayState* play) { gSaveContext.sohStats.sceneTimer++; gSaveContext.sohStats.roomTimer++; - if (CVarGetInteger("gMMBunnyHood", BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA && Player_GetMask(play) == PLAYER_MASK_BUNNY) { + if (CVarGetInteger(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA && Player_GetMask(play) == PLAYER_MASK_BUNNY) { gSaveContext.sohStats.count[COUNT_TIME_BUNNY_HOOD]++; } } @@ -2364,7 +2364,7 @@ void Play_PerformSave(PlayState* play) { IS_RANDO && gSaveContext.triforcePiecesCollected == Randomizer_GetSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED) && Randomizer_GetSettingValue(RSK_TRIFORCE_HUNT); - if (CVarGetInteger("gAutosave", AUTOSAVE_OFF) != AUTOSAVE_OFF || triforceHuntCompleted) { + if (CVarGetInteger(CVAR_ENHANCEMENT("Autosave"), AUTOSAVE_OFF) != AUTOSAVE_OFF || triforceHuntCompleted) { Overlay_DisplayText(3.0f, "Game Saved"); } } diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index 90b721f3c..8bcb6ec7c 100644 --- a/soh/src/code/z_player_lib.c +++ b/soh/src/code/z_player_lib.c @@ -600,9 +600,9 @@ void Player_SetModelsForHoldingShield(Player* this) { if ((CVarGetInteger(CVAR_CHEAT("ShieldTwoHanded"), 0) && (this->heldItemAction != PLAYER_IA_DEKU_STICK) || !Player_HoldsTwoHandedWeapon(this)) && !Player_IsChildWithHylianShield(this)) { this->rightHandType = PLAYER_MODELTYPE_RH_SHIELD; - if (LINK_IS_CHILD && (CVarGetInteger("gEnhancements.EquimentAlwaysVisible", 0)) && (this->currentShield == PLAYER_SHIELD_MIRROR)) { + if (LINK_IS_CHILD && (CVarGetInteger(CVAR_ENHANCEMENT("EquimentAlwaysVisible"), 0)) && (this->currentShield == PLAYER_SHIELD_MIRROR)) { this->rightHandDLists = &sPlayerDListGroups[PLAYER_MODELTYPE_RH_SHIELD][0]; - } else if (LINK_IS_ADULT && (CVarGetInteger("gEnhancements.EquimentAlwaysVisible", 0)) && (this->currentShield == PLAYER_SHIELD_DEKU)) { + } else if (LINK_IS_ADULT && (CVarGetInteger(CVAR_ENHANCEMENT("EquimentAlwaysVisible"), 0)) && (this->currentShield == PLAYER_SHIELD_DEKU)) { this->rightHandDLists = &sPlayerDListGroups[PLAYER_MODELTYPE_RH_SHIELD][1]; } else { this->rightHandDLists = &sPlayerDListGroups[PLAYER_MODELTYPE_RH_SHIELD][gSaveContext.linkAge]; @@ -613,7 +613,7 @@ void Player_SetModelsForHoldingShield(Player* this) { this->sheathType = PLAYER_MODELTYPE_SHEATH_17; } this->sheathDLists = &sPlayerDListGroups[this->sheathType][gSaveContext.linkAge]; - if ((CVarGetInteger("gEnhancements.EquimentAlwaysVisible", 0)) && LINK_IS_CHILD && + if ((CVarGetInteger(CVAR_ENHANCEMENT("EquimentAlwaysVisible"), 0)) && LINK_IS_CHILD && gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI) { this->sheathDLists = &sPlayerDListGroups[this->sheathType][0]; } @@ -628,7 +628,7 @@ void Player_SetModels(Player* this, s32 modelGroup) { this->leftHandType = gPlayerModelTypes[modelGroup][PLAYER_MODELGROUPENTRY_LEFT_HAND]; this->leftHandDLists = &sPlayerDListGroups[this->leftHandType][gSaveContext.linkAge]; - if (CVarGetInteger("gEnhancements.EquimentAlwaysVisible", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("EquimentAlwaysVisible"), 0)) { if (LINK_IS_CHILD && (this->leftHandType == PLAYER_MODELTYPE_LH_HAMMER || ((this->leftHandType == PLAYER_MODELTYPE_LH_SWORD || this->leftHandType == PLAYER_MODELTYPE_LH_BGS) && @@ -649,7 +649,7 @@ void Player_SetModels(Player* this, s32 modelGroup) { this->rightHandType = gPlayerModelTypes[modelGroup][PLAYER_MODELGROUPENTRY_RIGHT_HAND]; this->rightHandDLists = &sPlayerDListGroups[this->rightHandType][gSaveContext.linkAge]; - if (CVarGetInteger("gEnhancements.EquimentAlwaysVisible", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("EquimentAlwaysVisible"), 0)) { if (LINK_IS_CHILD && (this->rightHandType == PLAYER_MODELTYPE_RH_HOOKSHOT || (this->rightHandType == PLAYER_MODELTYPE_RH_SHIELD && this->currentShield == PLAYER_SHIELD_MIRROR))) { @@ -660,7 +660,7 @@ void Player_SetModels(Player* this, s32 modelGroup) { this->rightHandDLists = &sPlayerDListGroups[this->rightHandType][1]; } } - if ((CVarGetInteger("gBowSlingShotAmmoFix", 0) || CVarGetInteger("gEnhancements.EquimentAlwaysVisible", 0)) && this->rightHandType == 11) { // If holding Bow/Slingshot + if ((CVarGetInteger(CVAR_ENHANCEMENT("BowSlingshotAmmoFix"), 0) || CVarGetInteger(CVAR_ENHANCEMENT("EquimentAlwaysVisible"), 0)) && this->rightHandType == 11) { // If holding Bow/Slingshot this->rightHandDLists = &sPlayerDListGroups[this->rightHandType][Player_HoldsSlingshot(this)]; } @@ -668,7 +668,7 @@ void Player_SetModels(Player* this, s32 modelGroup) { this->sheathType = gPlayerModelTypes[modelGroup][PLAYER_MODELGROUPENTRY_SHEATH]; this->sheathDLists = &sPlayerDListGroups[this->sheathType][gSaveContext.linkAge]; - if (CVarGetInteger("gEnhancements.EquimentAlwaysVisible", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("EquimentAlwaysVisible"), 0)) { if (LINK_IS_CHILD && (this->currentShield == PLAYER_SHIELD_HYLIAN || this->currentShield == PLAYER_SHIELD_MIRROR) && ((gSaveContext.equips.buttonItems[0] == ITEM_SWORD_MASTER) || @@ -789,7 +789,7 @@ s32 Player_IsBurningStickInRange(PlayState* play, Vec3f* pos, f32 xzRange, f32 y s32 Player_GetStrength(void) { s32 strengthUpgrade = CUR_UPG_VALUE(UPG_STRENGTH); - if (CVarGetInteger("gToggleStrength", 0) && CVarGetInteger("gStrengthDisabled", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("ToggleStrength"), 0) && CVarGetInteger(CVAR_ENHANCEMENT("StrengthDisabled"), 0)) { return PLAYER_STR_NONE; } @@ -953,9 +953,9 @@ s32 Player_GetEnvironmentalHazard(PlayState* play) { triggerEntry = &sTextTriggers[var]; if ((triggerEntry->flag != 0) && !(gSaveContext.textTriggerFlags & triggerEntry->flag) && - (((var == 0) && (this->currentTunic != PLAYER_TUNIC_GORON && CVarGetInteger(CVAR_CHEAT("SuperTunic"), 0) == 0 && CVarGetInteger("gDisableTunicWarningText", 0) == 0)) || + (((var == 0) && (this->currentTunic != PLAYER_TUNIC_GORON && CVarGetInteger(CVAR_CHEAT("SuperTunic"), 0) == 0 && CVarGetInteger(CVAR_ENHANCEMENT("DisableTunicWarningText"), 0) == 0)) || (((var == 1) || (var == 3)) && (this->currentBoots == PLAYER_BOOTS_IRON) && - (this->currentTunic != PLAYER_TUNIC_ZORA && CVarGetInteger(CVAR_CHEAT("SuperTunic"), 0) == 0 && CVarGetInteger("gDisableTunicWarningText", 0) == 0)))) { + (this->currentTunic != PLAYER_TUNIC_ZORA && CVarGetInteger(CVAR_CHEAT("SuperTunic"), 0) == 0 && CVarGetInteger(CVAR_ENHANCEMENT("DisableTunicWarningText"), 0) == 0)))) { Message_StartTextbox(play, triggerEntry->textId, NULL); gSaveContext.textTriggerFlags |= triggerEntry->flag; } @@ -1090,7 +1090,7 @@ void Player_DrawImpl(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dL SkelAnime_DrawFlexLod(play, skeleton, jointTable, dListCount, overrideLimbDraw, postLimbDraw, data, lod); - if (((CVarGetInteger("gFPSGauntlets", 0) && LINK_IS_ADULT) || (overrideLimbDraw != Player_OverrideLimbDrawGameplayFirstPerson)) && + if (((CVarGetInteger(CVAR_ENHANCEMENT("FirstPersonGauntlets"), 0) && LINK_IS_ADULT) || (overrideLimbDraw != Player_OverrideLimbDrawGameplayFirstPerson)) && (overrideLimbDraw != Player_OverrideLimbDrawGameplayCrawling) && (gSaveContext.gameMode != 3)) { if (LINK_IS_ADULT) { @@ -1243,7 +1243,7 @@ void func_8008F87C(PlayState* play, Player* this, SkelAnime* skelAnime, Vec3f* p s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { Player* this = (Player*)thisx; - if (CVarGetInteger("gEnhancements.EquimentAlwaysVisible", 0) && CVarGetInteger("gEnhancements.ScaleAdultEquimentAsChild", 0) && LINK_IS_CHILD) { + if (CVarGetInteger(CVAR_ENHANCEMENT("EquimentAlwaysVisible"), 0) && CVarGetInteger(CVAR_ENHANCEMENT("ScaleAdultEquimentAsChild"), 0) && LINK_IS_CHILD) { if (limbIndex == PLAYER_LIMB_L_HAND) { if ((gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI && sLeftHandType == PLAYER_MODELTYPE_LH_SWORD) || (sLeftHandType == PLAYER_MODELTYPE_LH_BGS) || (sLeftHandType == PLAYER_MODELTYPE_LH_HAMMER)) { @@ -1396,7 +1396,7 @@ s32 Player_OverrideLimbDrawGameplayDefault(PlayState* play, s32 limbIndex, Gfx** (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI)) { dLists += PLAYER_SHIELD_MAX * 4; } - } else if (!CVarGetInteger("gEnhancements.EquimentAlwaysVisible", 0)) { + } else if (!CVarGetInteger(CVAR_ENHANCEMENT("EquimentAlwaysVisible"), 0)) { if (!LINK_IS_ADULT && ((this->sheathType == PLAYER_MODELTYPE_SHEATH_16) || (this->sheathType == PLAYER_MODELTYPE_SHEATH_17)) && (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI)) { dLists = &sSheathWithSwordDLs[PLAYER_SHIELD_MAX * 4]; @@ -1438,7 +1438,7 @@ s32 Player_OverrideLimbDrawGameplayFirstPerson(PlayState* play, s32 limbIndex, G *dList = sFirstPersonLeftForearmDLs[gSaveContext.linkAge]; } else if (limbIndex == PLAYER_LIMB_L_HAND) { s32 handOutDlIndex = gSaveContext.linkAge; - if ((CVarGetInteger("gBowSlingShotAmmoFix", 0) || CVarGetInteger("gEnhancements.EquimentAlwaysVisible", 0)) && LINK_IS_ADULT && Player_HoldsSlingshot(this)) { + if ((CVarGetInteger(CVAR_ENHANCEMENT("BowSlingshotAmmoFix"), 0) || CVarGetInteger(CVAR_ENHANCEMENT("EquimentAlwaysVisible"), 0)) && LINK_IS_ADULT && Player_HoldsSlingshot(this)) { handOutDlIndex = 1; } *dList = sFirstPersonLeftHandDLs[handOutDlIndex]; @@ -1448,7 +1448,7 @@ s32 Player_OverrideLimbDrawGameplayFirstPerson(PlayState* play, s32 limbIndex, G *dList = sFirstPersonForearmDLs[gSaveContext.linkAge]; } else if (limbIndex == PLAYER_LIMB_R_HAND) { s32 firstPersonWeaponIndex = gSaveContext.linkAge; - if (CVarGetInteger("gBowSlingShotAmmoFix", 0) || CVarGetInteger("gEnhancements.EquimentAlwaysVisible", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("BowSlingshotAmmoFix"), 0) || CVarGetInteger(CVAR_ENHANCEMENT("EquimentAlwaysVisible"), 0)) { if (Player_HoldsBow(this)) { firstPersonWeaponIndex = 0; } else if (Player_HoldsSlingshot(this)) { @@ -1682,7 +1682,7 @@ void Player_DrawHookshotReticle(PlayState* play, Player* this, f32 hookshotRange gSPTexture(WORLD_OVERLAY_DISP++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gDPLoadTextureBlock(WORLD_OVERLAY_DISP++, gLinkAdultHookshotReticleTex, G_IM_FMT_I, G_IM_SIZ_8b, 64, 64, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD); - if (SurfaceType_IsHookshotSurface(&play->colCtx, colPoly, bgId) && CVarGetInteger("gHookshotableReticle", false)) { + if (SurfaceType_IsHookshotSurface(&play->colCtx, colPoly, bgId) && CVarGetInteger(CVAR_ENHANCEMENT("HookshotableReticle"), false)) { const Color_RGBA8 defaultColor = { .r = 0, .g = 255, .b = 0, .a = 255 }; const Color_RGBA8 color = CVarGetColor("gCosmetics.HookshotReticle_Target.Value", defaultColor); gDPSetPrimColor(WORLD_OVERLAY_DISP++, 0, 0, color.r, color.g, color.b, color.a); @@ -1848,7 +1848,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve Matrix_Get(&this->shieldMf); } else if ((this->rightHandType == PLAYER_MODELTYPE_RH_BOW_SLINGSHOT) || (this->rightHandType == PLAYER_MODELTYPE_RH_BOW_SLINGSHOT_2)) { s32 stringModelToUse = gSaveContext.linkAge; - if (CVarGetInteger("gBowSlingShotAmmoFix", 0) || CVarGetInteger("gEnhancements.EquimentAlwaysVisible", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("BowSlingshotAmmoFix"), 0) || CVarGetInteger(CVAR_ENHANCEMENT("EquimentAlwaysVisible"), 0)) { stringModelToUse = Player_HoldsSlingshot(this); } BowStringData* stringData = &sBowStringData[stringModelToUse]; @@ -1917,7 +1917,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve play, this, ((this->heldItemAction == PLAYER_IA_HOOKSHOT) ? 38600.0f : 77600.0f) * CVarGetFloat(CVAR_CHEAT("HookshotReachMultiplier"), 1.0f)); } } - } else if (CVarGetInteger("gBowReticle", 0) && ( + } else if (CVarGetInteger(CVAR_ENHANCEMENT("BowReticle"), 0) && ( (this->heldItemAction == PLAYER_IA_BOW_FIRE) || (this->heldItemAction == PLAYER_IA_BOW_ICE) || (this->heldItemAction == PLAYER_IA_BOW_LIGHT) || @@ -2038,7 +2038,7 @@ s32 Player_OverrideLimbDrawPause(PlayState* play, s32 limbIndex, Gfx** dList, Ve type = gPlayerModelTypes[modelGroup][PLAYER_MODELGROUPENTRY_SHEATH]; if ((type == PLAYER_MODELTYPE_SHEATH_18) || (type == PLAYER_MODELTYPE_SHEATH_19)) { dListOffset = playerSwordAndShield[1] * ptrSize; - } else if (type == PLAYER_MODELTYPE_SHEATH_16 && CVarGetInteger("gPauseLiveLink", 0)) { + } else if (type == PLAYER_MODELTYPE_SHEATH_16 && CVarGetInteger(CVAR_ENHANCEMENT("PauseLiveLink"), 0)) { //if (playerSwordAndShield[0] == 1) //dListOffset = 4; } @@ -2122,7 +2122,7 @@ void Player_DrawPauseImpl(PlayState* play, void* seg04, void* seg06, SkelAnime* playerSwordAndShield[0] = sword; playerSwordAndShield[1] = shield; - Matrix_SetTranslateRotateYXZ(pos->x - ((CVarGetInteger("gPauseLiveLink", 0) && LINK_AGE_IN_YEARS == YEARS_ADULT) ? 25 : 0), + Matrix_SetTranslateRotateYXZ(pos->x - ((CVarGetInteger(CVAR_ENHANCEMENT("PauseLiveLink"), 0) && LINK_AGE_IN_YEARS == YEARS_ADULT) ? 25 : 0), pos->y - (CVarGetInteger("gPauseTriforce", 0) ? 16 : 0), pos->z, rot); Matrix_Scale(scale * (CVarGetInteger("gMirroredWorld", 0) ? -1 : 1), scale, scale, MTXMODE_APPLY); @@ -2176,8 +2176,8 @@ void Player_DrawPause(PlayState* play, u8* segment, SkelAnime* skelAnime, Vec3f* Vec3s* srcTable; s32 i; bool canswitchrnd = false; - s16 SelectedMode = CVarGetInteger("gPauseLiveLink", 0); - MinFrameCount = CVarGetInteger("gMinFrameCount", 200); + s16 SelectedMode = CVarGetInteger(CVAR_ENHANCEMENT("PauseLiveLink"), 0); + MinFrameCount = CVarGetInteger(CVAR_ENHANCEMENT("MinFrameCount"), 200); gSegments[4] = VIRTUAL_TO_PHYSICAL(segment + 0x3800); gSegments[6] = VIRTUAL_TO_PHYSICAL(segment + 0x8800); @@ -2202,7 +2202,7 @@ void Player_DrawPause(PlayState* play, u8* segment, SkelAnime* skelAnime, Vec3f* }; s16 AnimArraySize = ARRAY_COUNT(PauseMenuAnimSet); - if (CVarGetInteger("gPauseLiveLink", 0) || CVarGetInteger("gPauseTriforce", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("PauseLiveLink"), 0) || CVarGetInteger("gPauseTriforce", 0)) { uintptr_t anim = 0; // Initialise anim if (CUR_EQUIP_VALUE(EQUIP_TYPE_SWORD) >= EQUIP_VALUE_SWORD_BIGGORON) { diff --git a/soh/src/code/z_skelanime.c b/soh/src/code/z_skelanime.c index 2123c2d3b..3df8a26a5 100644 --- a/soh/src/code/z_skelanime.c +++ b/soh/src/code/z_skelanime.c @@ -78,7 +78,7 @@ void SkelAnime_DrawLod(PlayState* play, void** skeleton, Vec3s* jointTable, Vec3f pos; Vec3s rot; - if (CVarGetInteger("gDisableLOD", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("DisableLOD"), 0)) { lod = 0; } @@ -195,7 +195,7 @@ void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable, Vec3s rot; Mtx* mtx = Graph_Alloc(play->state.gfxCtx, dListCount * sizeof(Mtx)); - if (CVarGetInteger("gDisableLOD", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("DisableLOD"), 0)) { lod = 0; } @@ -870,7 +870,7 @@ AnimationEntry* AnimationContext_AddEntry(AnimationContext* animationCtx, Animat */ void AnimationContext_SetLoadFrame(PlayState* play, LinkAnimationHeader* animation, s32 frame, s32 limbCount, Vec3s* frameTable) { - if (CVarGetInteger("gN64WeirdFrames", 0) && frame < 0) { + if (CVarGetInteger(CVAR_ENHANCEMENT("N64WeirdFrames"), 0) && frame < 0) { Vec3s* src = (Vec3s*)getN64WeirdFrame((sizeof(Vec3s) * limbCount + 2) * frame); memcpy(frameTable, src, sizeof(Vec3s) * limbCount + 2); return; diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c index 5b67eba1d..60285a8bf 100644 --- a/soh/src/code/z_sram.c +++ b/soh/src/code/z_sram.c @@ -125,7 +125,7 @@ void Sram_OpenSave() { default: // Use the saved entrance value with remember save location, except when in grottos/fairy fountains - if (CVarGetInteger("gRememberSaveLocation", 0) && gSaveContext.savedSceneNum != SCENE_FAIRYS_FOUNTAIN && + if (CVarGetInteger(CVAR_ENHANCEMENT("RememberSaveLocation"), 0) && gSaveContext.savedSceneNum != SCENE_FAIRYS_FOUNTAIN && gSaveContext.savedSceneNum != SCENE_GROTTOS) { break; } @@ -142,7 +142,7 @@ void Sram_OpenSave() { osSyncPrintf(VT_RST); if (gSaveContext.health < 0x30) { - gSaveContext.health = CVarGetInteger("gFullHealthSpawn", 0) ? gSaveContext.healthCapacity : 0x30; + gSaveContext.health = CVarGetInteger(CVAR_ENHANCEMENT("FullHealthSpawn"), 0) ? gSaveContext.healthCapacity : 0x30; } if (gSaveContext.scarecrowLongSongSet) { diff --git a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index 58f11a7f3..1ada94a29 100644 --- a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -106,7 +106,7 @@ void BgBreakwall_Init(Actor* thisx, PlayState* play) { s32 wallType = ((this->dyna.actor.params >> 13) & 3) & 0xFF; // Initialize this with the mud wall, so it can't be affected by toggling while the actor is loaded - blueFireArrowsEnabledOnMudwallLoad = CVarGetInteger("gBlueFireArrows", 0) || (IS_RANDO && Randomizer_GetSettingValue(RSK_BLUE_FIRE_ARROWS)); + blueFireArrowsEnabledOnMudwallLoad = CVarGetInteger(CVAR_ENHANCEMENT("BlueFireArrows"), 0) || (IS_RANDO && Randomizer_GetSettingValue(RSK_BLUE_FIRE_ARROWS)); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DPM_UNK); diff --git a/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c b/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c index 2379b0a58..d1f0e6d30 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c +++ b/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c @@ -69,7 +69,7 @@ void func_8087B7E8(BgHaka* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->dyna.unk_150 != 0.0f) { - if (play->sceneNum == SCENE_GRAVEYARD && !LINK_IS_ADULT && IS_DAY && !CVarGetInteger("gDayGravePull", 0)) { + if (play->sceneNum == SCENE_GRAVEYARD && !LINK_IS_ADULT && IS_DAY && !CVarGetInteger(CVAR_ENHANCEMENT("DayGravePull"), 0)) { this->dyna.unk_150 = 0.0f; player->stateFlags2 &= ~PLAYER_STATE2_MOVING_DYNAPOLY; if (!Play_InCsMode(play)) { diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c b/soh/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c index c61c93a46..98c5138c3 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c @@ -211,9 +211,9 @@ void BgHakaGate_StatueTurn(BgHakaGate* this, PlayState* play) { if (turnFinished) { player->stateFlags2 &= ~PLAYER_STATE2_MOVING_DYNAPOLY; this->vRotYDeg10 = (this->vRotYDeg10 + turnAngle) % 3600; - this->vTurnRateDeg10 = CVarGetInteger("gFasterBlockPush", 0) * 2; + this->vTurnRateDeg10 = CVarGetInteger(CVAR_ENHANCEMENT("FasterBlockPush"), 0) * 2; this->vTurnAngleDeg10 = 0; - this->vTimer = 5 - ((CVarGetInteger("gFasterBlockPush", 0) * 3) / 5); + this->vTimer = 5 - ((CVarGetInteger(CVAR_ENHANCEMENT("FasterBlockPush"), 0) * 3) / 5); this->actionFunc = BgHakaGate_StatueIdle; this->dyna.unk_150 = 0.0f; } diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c b/soh/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c index 4f9b4a216..e031c07cc 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c @@ -181,7 +181,7 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, PlayState* play) { func_80078884(NA_SE_SY_ERROR); } else { // Random rewards - if (CVarGetInteger("gNoRandomDrops", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NoRandomDrops"), 0)) { collectibleParams = -1; } else if(rnd < 0.4f) { collectibleParams = ITEM00_BOMBS_A; @@ -196,7 +196,7 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, PlayState* play) { } } else if (Flags_GetCollectible(play, this->dyna.actor.params) != 0) { // If small key already collected, drop recovery heart instead - if (CVarGetInteger("gNoHeartDrops", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NoHeartDrops"), 0)) { collectibleParams = -1; } else { diff --git a/soh/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c b/soh/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c index 3b2524e79..c020c07ed 100644 --- a/soh/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c +++ b/soh/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c @@ -320,7 +320,7 @@ void BgHeavyBlock_Wait(BgHeavyBlock* this, PlayState* play) { if (Actor_HasParent(&this->dyna.actor, play)) { this->timer = 0; - if (!CVarGetInteger("gFasterHeavyBlockLift", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 0)) { switch (this->dyna.actor.params & 0xFF) { case HEAVYBLOCK_BREAKABLE: OnePointCutscene_Init(play, 4020, 270, &this->dyna.actor, MAIN_CAM); @@ -369,7 +369,7 @@ void BgHeavyBlock_LiftedUp(BgHeavyBlock* this, PlayState* play) { this->timer++; - if (!CVarGetInteger("gFasterHeavyBlockLift", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 0)) { func_8002DF54(play, &player->actor, 8); } @@ -409,7 +409,7 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, PlayState* play) { Quake_SetCountdown(quakeIndex, 30); // We don't want this arbitrarily long quake with the enhancement enabled - if (!CVarGetInteger("gFasterHeavyBlockLift", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 0)) { quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 2); Quake_SetSpeed(quakeIndex, 12000); Quake_SetQuakeValues(quakeIndex, 5, 0, 0, 0); diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c b/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c index 36cfb0a27..c5b90a4c9 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c @@ -137,9 +137,9 @@ void func_8088B268(BgHidanRock* this, PlayState* play) { } } - this->dyna.actor.speedXZ = this->dyna.actor.speedXZ + (CVarGetInteger("gFasterBlockPush", 0) * 0.3) + 0.5f; + this->dyna.actor.speedXZ = this->dyna.actor.speedXZ + (CVarGetInteger(CVAR_ENHANCEMENT("FasterBlockPush"), 0) * 0.3) + 0.5f; this->dyna.actor.speedXZ = - CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f + (CVarGetInteger("gFasterBlockPush", 0) * 0.5)); + CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f + (CVarGetInteger(CVAR_ENHANCEMENT("FasterBlockPush"), 0) * 0.5)); if (D_8088BFC0 > 0.0f) { temp_v1 = Math_StepToF(&D_8088BFC0, 20.0f, this->dyna.actor.speedXZ); @@ -157,7 +157,7 @@ void func_8088B268(BgHidanRock* this, PlayState* play) { this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z; D_8088BFC0 = 0.0f; this->dyna.actor.speedXZ = 0.0f; - this->timer = 5 - ((CVarGetInteger("gFasterBlockPush", 0) * 3) / 5); + this->timer = 5 - ((CVarGetInteger(CVAR_ENHANCEMENT("FasterBlockPush"), 0) * 3) / 5); } func_8002F974(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); diff --git a/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c b/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c index 36666ed15..2b2e1c0f7 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c +++ b/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c @@ -105,7 +105,7 @@ void func_80890740(BgIceShelter* this, PlayState* play) { s32 type = (this->dyna.actor.params >> 8) & 7; // Initialize this with the red ice, so it can't be affected by toggling while the actor is loaded - blueFireArrowsEnabledOnRedIceLoad = CVarGetInteger("gBlueFireArrows", 0) || (IS_RANDO && Randomizer_GetSettingValue(RSK_BLUE_FIRE_ARROWS)); + blueFireArrowsEnabledOnRedIceLoad = CVarGetInteger(CVAR_ENHANCEMENT("BlueFireArrows"), 0) || (IS_RANDO && Randomizer_GetSettingValue(RSK_BLUE_FIRE_ARROWS)); Collider_InitCylinder(play, &this->cylinder1); // If "Blue Fire Arrows" is enabled, set up a collider on the red ice that responds to them diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c b/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c index 564f6f322..f2c821929 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c @@ -443,7 +443,7 @@ void func_80896950(BgJyaCobra* this, PlayState* play) { if (this->dyna.unk_150 > 0.001f) { this->unk_168++; - if (this->unk_168 >= (15 - CVarGetInteger("gFasterBlockPush", 0) * 2)) { + if (this->unk_168 >= (15 - CVarGetInteger(CVAR_ENHANCEMENT("FasterBlockPush"), 0) * 2)) { func_808969F8(this, play); } } else { @@ -478,7 +478,7 @@ void func_808969F8(BgJyaCobra* this, PlayState* play) { this->unk_174.z = player->actor.world.pos.z - this->dyna.actor.world.pos.z; this->unk_170 = 0; this->unk_172 = true; - this->unk_16E = CVarGetInteger("gFasterBlockPush", 0) * 20; + this->unk_16E = CVarGetInteger(CVAR_ENHANCEMENT("FasterBlockPush"), 0) * 20; } void func_80896ABC(BgJyaCobra* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c b/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c index 7ec5c2a77..19bef1b67 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c @@ -99,7 +99,7 @@ void BgJyaLift_DelayMove(BgJyaLift* this, PlayState* play) { // The cutscene of the platform lowering will show the central room in an unloaded state if // Link is not standing on the platform as it lowers. Therefore check for the Sunlight arrows // enhancement and if it's enabled, check that Link is on the platform. Otherwise skip it. - if (!(CVarGetInteger("gSunlightArrows", 0) || Randomizer_GetSettingValue(RSK_SUNLIGHT_ARROWS)) || + if (!(CVarGetInteger(CVAR_ENHANCEMENT("SunlightArrows"), 0) || Randomizer_GetSettingValue(RSK_SUNLIGHT_ARROWS)) || (GET_PLAYER(play)->actor.world.pos.x > -19.0f && GET_PLAYER(play)->actor.world.pos.x < 139.0f && GET_PLAYER(play)->actor.world.pos.z > -1172.0f && diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c b/soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c index eeecfabcb..6e1c36f78 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c @@ -216,7 +216,7 @@ void BgMoriBigst_SetupStalfosPairFight(BgMoriBigst* this, PlayState* play) { void BgMoriBigst_StalfosPairFight(BgMoriBigst* this, PlayState* play) { if ((this->dyna.actor.home.rot.z == 0 || // Check if all enemies are defeated instead of the regular stalfos when enemy randomizer or crowd control is on. - (Flags_GetTempClear(play, this->dyna.actor.room) && (CVarGetInteger("gRandomizedEnemies", 0) || (CVarGetInteger("gCrowdControl", 0))))) && + (Flags_GetTempClear(play, this->dyna.actor.room) && (CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) || (CVarGetInteger("gCrowdControl", 0))))) && !Player_InCsMode(play)) { Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); BgMoriBigst_SetupDone(this, play); diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c b/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c index 8392e7224..4944c8455 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c @@ -94,7 +94,7 @@ void BgMoriKaitenkabe_Wait(BgMoriKaitenkabe* this, PlayState* play) { if (this->dyna.unk_150 > 0.001f) { this->timer++; - if ((this->timer > (28 - CVarGetInteger("gFasterBlockPush", 0) * 4)) && !Player_InCsMode(play)) { + if ((this->timer > (28 - CVarGetInteger(CVAR_ENHANCEMENT("FasterBlockPush"), 0) * 4)) && !Player_InCsMode(play)) { BgMoriKaitenkabe_SetupRotate(this); func_8002DF54(play, &this->dyna.actor, 8); Math_Vec3f_Copy(&this->lockedPlayerPos, &player->actor.world.pos); @@ -118,7 +118,7 @@ void BgMoriKaitenkabe_Wait(BgMoriKaitenkabe* this, PlayState* play) { void BgMoriKaitenkabe_SetupRotate(BgMoriKaitenkabe* this) { this->actionFunc = BgMoriKaitenkabe_Rotate; - this->rotSpeed = CVarGetInteger("gFasterBlockPush", 0) * 0.1f; + this->rotSpeed = CVarGetInteger(CVAR_ENHANCEMENT("FasterBlockPush"), 0) * 0.1f; this->rotYdeg = 0.0f; } diff --git a/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c b/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c index a2fca0db7..5f53bb878 100644 --- a/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c +++ b/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c @@ -387,8 +387,8 @@ void BgPoEvent_BlockPush(BgPoEvent* this, PlayState* play) { s32 blockStop; Player* player = GET_PLAYER(play); - this->dyna.actor.speedXZ = this->dyna.actor.speedXZ + (CVarGetInteger("gFasterBlockPush", 0) * 0.3) + 0.5f; - this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f + (CVarGetInteger("gFasterBlockPush", 0) * 0.5)); + this->dyna.actor.speedXZ = this->dyna.actor.speedXZ + (CVarGetInteger(CVAR_ENHANCEMENT("FasterBlockPush"), 0) * 0.3) + 0.5f; + this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f + (CVarGetInteger(CVAR_ENHANCEMENT("FasterBlockPush"), 0) * 0.5)); blockStop = Math_StepToF(&sBgPoEventblockPushDist, 20.0f, this->dyna.actor.speedXZ); displacement = this->direction * sBgPoEventblockPushDist; this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.unk_158) * displacement) + this->dyna.actor.home.pos.x; @@ -403,7 +403,7 @@ void BgPoEvent_BlockPush(BgPoEvent* this, PlayState* play) { this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z; sBgPoEventblockPushDist = 0.0f; this->dyna.actor.speedXZ = 0.0f; - this->direction = 5 - ((CVarGetInteger("gFasterBlockPush", 0) * 3) / 5); + this->direction = 5 - ((CVarGetInteger(CVAR_ENHANCEMENT("FasterBlockPush"), 0) * 3) / 5); sBgPoEventBlocksAtRest++; this->actionFunc = BgPoEvent_BlockIdle; if (this->type == 1) { diff --git a/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c index 4385c4341..d1fdca048 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c @@ -260,9 +260,9 @@ void func_808B4194(BgSpot15Rrbox* this, PlayState* play) { s32 approxFResult; Actor* actor = &this->dyna.actor; - this->unk_174 = this->unk_174 + ((CVarGetInteger("gFasterBlockPush", 0) / 2) * 0.5) + 0.5f; + this->unk_174 = this->unk_174 + ((CVarGetInteger(CVAR_ENHANCEMENT("FasterBlockPush"), 0) / 2) * 0.5) + 0.5f; - this->unk_174 = CLAMP_MAX(this->unk_174, 2.0f + (CVarGetInteger("gFasterBlockPush", 0) * 0.5)); + this->unk_174 = CLAMP_MAX(this->unk_174, 2.0f + (CVarGetInteger(CVAR_ENHANCEMENT("FasterBlockPush"), 0) * 0.5)); approxFResult = Math_StepToF(&this->unk_178, 20.0f, this->unk_174); @@ -294,7 +294,7 @@ void func_808B4194(BgSpot15Rrbox* this, PlayState* play) { this->dyna.unk_150 = 0.0f; this->unk_178 = 0.0f; this->unk_174 = 0.0f; - this->unk_168 = 10 - ((CVarGetInteger("gFasterBlockPush", 0) * 3) / 2); + this->unk_168 = 10 - ((CVarGetInteger(CVAR_ENHANCEMENT("FasterBlockPush"), 0) * 3) / 2); func_808B4084(this, play); } Audio_PlayActorSound2(actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); diff --git a/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c index 8233ffeac..2d81c8610 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c @@ -297,7 +297,7 @@ void func_808B7F74(BgSpot18Basket* this) { shapeRotY = this->dyna.actor.shape.rot.y; this->actionFunc = func_808B7FC0; - if ((shapeRotY < -0x2E93) || (shapeRotY >= 0x7C19) || CVarGetInteger("gGoronPot", 0)) { + if ((shapeRotY < -0x2E93) || (shapeRotY >= 0x7C19) || CVarGetInteger(CVAR_ENHANCEMENT("GoronPot"), 0)) { this->unk_218 = 2; } else if (shapeRotY < 0x26C2) { this->unk_218 = 1; diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index 97551ca46..65420de32 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -1240,7 +1240,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { static Color_RGBA8 bloodPrimColor = { 0, 120, 0, 255 }; static Color_RGBA8 bloodEnvColor = { 0, 120, 0, 255 }; - if(CVarGetInteger("gRedGanonBlood", 0)) { + if(CVarGetInteger(CVAR_ENHANCEMENT("RedGanonBlood"), 0)) { bloodPrimColor.r = 120; bloodPrimColor.g = 0; diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index ba4a4fbc6..4de5ab068 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -1486,7 +1486,7 @@ void func_8090109C(BossGanon2* this, PlayState* play) { static Color_RGBA8 sPrimColor = { 0, 120, 0, 255 }; static Color_RGBA8 sEnvColor = { 0, 120, 0, 255 }; - if(CVarGetInteger("gRedGanonBlood", 0)) { + if(CVarGetInteger(CVAR_ENHANCEMENT("RedGanonBlood"), 0)) { sPrimColor.r = 120; sPrimColor.g = 0; diff --git a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index 6de72fd2d..049cb3da5 100644 --- a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -445,7 +445,7 @@ void BossGoma_SetupCeilingIdle(BossGoma* this) { void BossGoma_SetupFallJump(BossGoma* this) { // When in Enemy Randomizer, reset the state of the spawned Gohma Larva because it's not done // by the (non-existent) Larva themselves. - if (CVarGetInteger("gRandomizedEnemies", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0)) { this->childrenGohmaState[0] = this->childrenGohmaState[1] = this->childrenGohmaState[2] = 0; } Animation_Change(&this->skelanime, &gGohmaLandAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -5.0f); @@ -1559,14 +1559,14 @@ void BossGoma_CeilingIdle(BossGoma* this, PlayState* play) { if (this->framesUntilNextAction == 0) { Actor* nearbyEnTest = NULL; - if (CVarGetInteger("gRandomizedEnemies", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0)) { nearbyEnTest = Actor_FindNearby(play, &this->actor, -1, ACTORCAT_ENEMY, 8000.0f); } if (this->childrenGohmaState[0] == 0 && this->childrenGohmaState[1] == 0 && this->childrenGohmaState[2] == 0) { // if no child gohma has been spawned BossGoma_SetupCeilingPrepareSpawnGohmas(this); } else if ((this->childrenGohmaState[0] < 0 && this->childrenGohmaState[1] < 0 && this->childrenGohmaState[2] < 0) || - (nearbyEnTest == NULL && CVarGetInteger("gRandomizedEnemies", 0))) { + (nearbyEnTest == NULL && CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0))) { // In authentic gameplay, check if all baby Ghomas are dead. In Enemy Randomizer, check if there's no enemies alive. BossGoma_SetupFallJump(this); } else { diff --git a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index b9f5c6f2c..d7be78fab 100644 --- a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -360,7 +360,7 @@ void BossSst_HeadSetupLurk(BossSst* this) { } void BossSst_HeadLurk(BossSst* this, PlayState* play) { - if (CVarGetInteger("gQuickBongoKill", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("QuickBongoKill"), 0)) { this->colliderCyl.base.acFlags |= AC_ON; } @@ -371,7 +371,7 @@ void BossSst_HeadLurk(BossSst* this, PlayState* play) { void BossSst_HeadSetupIntro(BossSst* this, PlayState* play) { //Make sure to restore original behavior if the quick kill didn't happen - if (CVarGetInteger("gQuickBongoKill", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("QuickBongoKill"), 0)) { this->colliderCyl.base.acFlags &= ~AC_ON; } @@ -2665,7 +2665,7 @@ void BossSst_UpdateHead(Actor* thisx, PlayState* play) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderJntSph.base); } - if ((this->actionFunc != BossSst_HeadLurk || CVarGetInteger("gQuickBongoKill", 0)) && (this->actionFunc != BossSst_HeadIntro)) { + if ((this->actionFunc != BossSst_HeadLurk || CVarGetInteger(CVAR_ENHANCEMENT("QuickBongoKill"), 0)) && (this->actionFunc != BossSst_HeadIntro)) { if (this->colliderCyl.base.acFlags & AC_ON) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCyl.base); } diff --git a/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 22c850111..27155289b 100644 --- a/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -182,7 +182,7 @@ void DoorAna_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); // Changes the grottos facing angle based on camera angle - if (!CVarGetInteger("gDisableGrottoRotation", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("DisableGrottoRotation"), 0)) { this->actor.shape.rot.y = Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) + 0x8000; } } diff --git a/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index 3fe7fc689..13b960f55 100644 --- a/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -110,7 +110,7 @@ void ElfMsg_Destroy(Actor* thisx, PlayState* play) { s32 ElfMsg_GetMessageId(ElfMsg* this) { // Negative message ID forces link to talk to Navi - if (this->actor.params & 0x8000 || CVarGetInteger("gNoForcedNavi", 0) != 0) { + if (this->actor.params & 0x8000 || CVarGetInteger(CVAR_ENHANCEMENT("NoForcedNavi"), 0) != 0) { return (this->actor.params & 0xFF) + 0x100; } else { return -((this->actor.params & 0xFF) + 0x100); diff --git a/soh/src/overlays/actors/ovl_En_Am/z_en_am.c b/soh/src/overlays/actors/ovl_En_Am/z_en_am.c index 8347c631a..c62e3a8fa 100644 --- a/soh/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/soh/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -670,7 +670,7 @@ void EnAm_Statue(EnAm* this, PlayState* play) { Player* player = GET_PLAYER(play); f32 temp158f = this->dyna.unk_158; s16 moveDir = 0; - s32 blockSpeed = CVarGetInteger("gFasterBlockPush", 0); + s32 blockSpeed = CVarGetInteger(CVAR_ENHANCEMENT("FasterBlockPush"), 0); if (this->unk_258 == 0) { if (this->dyna.unk_150 != 0.0f) { diff --git a/soh/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c b/soh/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c index 740aea6c4..0b1a2b0b7 100644 --- a/soh/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c +++ b/soh/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c @@ -116,7 +116,7 @@ void func_809B27D8(EnAnubiceFire* this, PlayState* play) { Audio_PlayActorSound2(&this->actor, NA_SE_IT_SHIELD_REFLECT_SW); this->cylinder.base.atFlags &= 0xFFE9; this->cylinder.base.atFlags |= 8; - this->cylinder.info.toucher.dmgFlags = CVarGetInteger("gAnubisFix", 0) ? 0x800 : 2; + this->cylinder.info.toucher.dmgFlags = CVarGetInteger(CVAR_ENHANCEMENT("AnubixFix"), 0) ? 0x800 : 2; this->unk_15A = 30; this->actor.params = 1; this->actor.velocity.x *= -1.0f; diff --git a/soh/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c b/soh/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c index 816dcf091..d612475d4 100644 --- a/soh/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c +++ b/soh/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c @@ -104,8 +104,8 @@ void EnBlkobj_DarkLinkFight(EnBlkobj* this, PlayState* play) { // Check for if Dark Link is defeated in authentic gameplay. // Check for if all enemies are defeated with enemy randomizer or crowd control on. uint8_t roomCleared = - (!CVarGetInteger("gRandomizedEnemies", 0) && !CVarGetInteger("gCrowdControl", 0) && Actor_Find(&play->actorCtx, ACTOR_EN_TORCH2, ACTORCAT_BOSS) == NULL) || - ((CVarGetInteger("gRandomizedEnemies", 0) || CVarGetInteger("gCrowdControl", 0)) && Flags_GetTempClear(play, this->dyna.actor.room)); + (!CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) && !CVarGetInteger("gCrowdControl", 0) && Actor_Find(&play->actorCtx, ACTOR_EN_TORCH2, ACTORCAT_BOSS) == NULL) || + ((CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) || CVarGetInteger("gCrowdControl", 0)) && Flags_GetTempClear(play, this->dyna.actor.room)); if (roomCleared) { Flags_SetClear(play, this->dyna.actor.room); this->timer++; diff --git a/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c index baa1db8f5..434556a51 100644 --- a/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -125,7 +125,7 @@ void EnBom_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->bombCollider, thisx, &sCylinderInit); Collider_SetJntSph(play, &this->explosionCollider, thisx, &sJntSphInit, &this->explosionColliderItems[0]); this->explosionColliderItems[0].info.toucher.damage += (thisx->shape.rot.z & 0xFF00) >> 8; - if (CVarGetInteger("gNutsExplodeBombs", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NutsExplodeBombs"), 0)) { this->bombCollider.info.bumper.dmgFlags |= 1; } @@ -199,7 +199,7 @@ void EnBom_Explode(EnBom* this, PlayState* play) { func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96); } - if (CVarGetInteger("gStaticExplosionRadius", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("StaticExplosionRadius"), 0)) { //72 is the maximum radius of an OoT bomb explosion this->explosionCollider.elements[0].dim.worldSphere.radius = 72; } else { @@ -397,7 +397,7 @@ void EnBom_Draw(Actor* thisx, PlayState* play) { if (thisx->params == BOMB_BODY) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - if (!CVarGetInteger("gDisableBombBillboarding", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("DisableBombBillboarding"), 0)) { Matrix_ReplaceRotation(&play->billboardMtxF); } func_8002EBCC(thisx, play, 0); diff --git a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index 76c0feac3..eccfe98b0 100644 --- a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -69,7 +69,7 @@ void EnBomBowlMan_Init(Actor* thisx, PlayState* play2) { Actor_SetScale(&this->actor, 0.013f); for (i = 0; i < 2; i++) { - if(CVarGetInteger("gCustomizeBombchuBowling", 0) && CVarGetInteger(i == 0 ? "gBombchuBowlingNoSmallCucco" : "gBombchuBowlingNoBigCucco", 0)) { + if(CVarGetInteger(CVAR_ENHANCEMENT("CustomizeBombchuBowling"), 0) && CVarGetInteger(i == 0 ? CVAR_ENHANCEMENT("BombchuBowlingNoSmallCucco") : CVAR_ENHANCEMENT("BombchuBowlingNoBigCucco"), 0)) { continue; } @@ -327,8 +327,8 @@ void EnBomBowlMan_HandlePlayChoice(EnBomBowlMan* this, PlayState* play) { Rupees_ChangeBy(-30); this->minigamePlayStatus = 1; this->wallStatus[0] = this->wallStatus[1] = 0; - if(CVarGetInteger("gCustomizeBombchuBowling", 0)) { - play->bombchuBowlingStatus = CVarGetInteger("gBombchuBowlingAmmunition", 10); + if(CVarGetInteger(CVAR_ENHANCEMENT("CustomizeBombchuBowling"), 0)) { + play->bombchuBowlingStatus = CVarGetInteger(CVAR_ENHANCEMENT("BombchuBowlingAmmo"), 10); } else { play->bombchuBowlingStatus = 10; diff --git a/soh/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c b/soh/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c index 02ff9140d..4fcaa88e2 100644 --- a/soh/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c +++ b/soh/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c @@ -139,7 +139,7 @@ void EnBomChu_UpdateFloorPoly(EnBomChu* this, CollisionPoly* floorPoly, PlayStat f32 normDotUp; MtxF mf; - if (CVarGetInteger("gBombchusOOB", 0) && floorPoly == NULL) { + if (CVarGetInteger(CVAR_ENHANCEMENT("BombchusOOB"), 0) && floorPoly == NULL) { EnBomChu_Explode(this, play); return; } diff --git a/soh/src/overlays/actors/ovl_En_Box/z_en_box.c b/soh/src/overlays/actors/ovl_En_Box/z_en_box.c index dfd8fae27..7ec29b818 100644 --- a/soh/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/soh/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -629,7 +629,7 @@ void EnBox_Update(Actor* thisx, PlayState* play) { if (((!IS_RANDO && ((this->dyna.actor.params >> 5 & 0x7F) == 0x7C)) || (IS_RANDO && this->getItemEntry.getItemId == RG_ICE_TRAP)) && this->actionFunc == EnBox_Open && this->skelanime.curFrame > 45 && this->iceSmokeTimer < 100) { - if (!CVarGetInteger("gAddTraps.enabled", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("ExtraTraps.Enabled"), 0)) { EnBox_SpawnIceSmoke(this, play); } } @@ -637,8 +637,8 @@ void EnBox_Update(Actor* thisx, PlayState* play) { void EnBox_UpdateSizeAndTexture(EnBox* this, PlayState* play) { EnBox_CreateExtraChestTextures(); - int csmc = CVarGetInteger("gChestSizeAndTextureMatchesContents", CSMC_DISABLED); - int requiresStoneAgony = CVarGetInteger("gChestSizeDependsStoneOfAgony", 0); + int csmc = CVarGetInteger(CVAR_ENHANCEMENT("ChestSizeAndTextureMatchContents"), CSMC_DISABLED); + int requiresStoneAgony = CVarGetInteger(CVAR_ENHANCEMENT("ChestSizeDependsStoneOfAgony"), 0); GetItemCategory getItemCategory; int isVanilla = csmc == CSMC_DISABLED || (requiresStoneAgony && !CHECK_QUEST_ITEM(QUEST_STONE_OF_AGONY)) || diff --git a/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index 6be3a219f..c4ed47bf6 100644 --- a/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -262,7 +262,7 @@ void EnClearTag_Init(Actor* thisx, PlayState* play) { // Change Arwing to regular enemy instead of boss with enemy randomizer and crowd control. // This way Arwings will be considered for "clear enemy" rooms properly. - if (CVarGetInteger("gRandomizedEnemies", 0) || CVarGetInteger("gCrowdControl", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) || CVarGetInteger("gCrowdControl", 0)) { Actor_ChangeCategory(play, &play->actorCtx, thisx, ACTORCAT_ENEMY); } @@ -478,7 +478,7 @@ void EnClearTag_Update(Actor* thisx, PlayState* play2) { // Introduce a range requirement in Enemy Rando so Arwings don't shoot the player from // across the map. Especially noticeable in big maps like Lake Hylia and Hyrule Field. - uint8_t enemyRandoShootLaser = !CVarGetInteger("gRandomizedEnemies", 0) || this->actor.xzDistToPlayer < 1000.0f; + uint8_t enemyRandoShootLaser = !CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) || this->actor.xzDistToPlayer < 1000.0f; // Check if the Arwing should fire its laser. if ((this->frameCounter % 4) == 0 && (Rand_ZeroOne() < 0.75f) && diff --git a/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c index 04123c7b3..1a799763a 100644 --- a/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -123,7 +123,7 @@ void EnCow_Init(Actor* thisx, PlayState* play) { func_809DEE9C(this); this->actionFunc = func_809DF96C; if (play->sceneNum == SCENE_LINKS_HOUSE) { - if (!LINK_IS_ADULT && !CVarGetInteger("gCowOfTime", 0)) { + if (!LINK_IS_ADULT && !CVarGetInteger(CVAR_ENHANCEMENT("CowOfTime"), 0)) { Actor_Kill(&this->actor); return; } diff --git a/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c index b1b967220..bb7236e04 100644 --- a/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -364,7 +364,7 @@ void EnCrow_Die(EnCrow* this, PlayState* play) { } else { Item_DropCollectible(play, &this->actor.world.pos, ITEM00_RUPEE_RED); } - if (!CVarGetInteger("gRandomizedEnemies", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0)) { EnCrow_SetupRespawn(this); } else { Actor_Kill(this); diff --git a/soh/src/overlays/actors/ovl_En_Dog/z_en_dog.c b/soh/src/overlays/actors/ovl_En_Dog/z_en_dog.c index 38a1cf95b..2c49accfe 100644 --- a/soh/src/overlays/actors/ovl_En_Dog/z_en_dog.c +++ b/soh/src/overlays/actors/ovl_En_Dog/z_en_dog.c @@ -373,7 +373,7 @@ void EnDog_FollowPlayer(EnDog* this, PlayState* play) { return; } - if (CVarGetInteger("gDogFollowsEverywhere", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("DogFollowsEverywhere"), 0)) { // If the dog is too far away it's usually because they are stuck in a hole or on a different floor, this gives them a push if (this->actor.xyzDistToPlayerSq > 250000.0f) { Player* player = GET_PLAYER(play); @@ -394,7 +394,7 @@ void EnDog_FollowPlayer(EnDog* this, PlayState* play) { } if (this->actor.xzDistToPlayer > 400.0f) { - if (CVarGetInteger("gDogFollowsEverywhere", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("DogFollowsEverywhere"), 0)) { // Instead of stopping following when the dog gets too far, just speed them up. speed = this->actor.xzDistToPlayer / 25.0f; } else { @@ -419,7 +419,7 @@ void EnDog_FollowPlayer(EnDog* this, PlayState* play) { Math_ApproachF(&this->actor.speedXZ, speed, 0.6f, 1.0f); - if (!(this->actor.xzDistToPlayer > 400.0f) || CVarGetInteger("gDogFollowsEverywhere", 0)) { + if (!(this->actor.xzDistToPlayer > 400.0f) || CVarGetInteger(CVAR_ENHANCEMENT("DogFollowsEverywhere"), 0)) { Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 10, 1000, 1); this->actor.shape.rot = this->actor.world.rot; } diff --git a/soh/src/overlays/actors/ovl_En_Door/z_en_door.c b/soh/src/overlays/actors/ovl_En_Door/z_en_door.c index 2a571e34e..cbfd5f018 100644 --- a/soh/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/soh/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -349,11 +349,11 @@ void EnDoor_Draw(Actor* thisx, PlayState* play) { } } if (this->lockTimer != 0) { - if (CVarGetInteger("gShowDoorLocksOnBothSides", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("ShowDoorLocksOnBothSides"), 0)) { Matrix_Push(); } Actor_DrawDoorLock(play, this->lockTimer, DOORLOCK_NORMAL); - if (CVarGetInteger("gShowDoorLocksOnBothSides", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("ShowDoorLocksOnBothSides"), 0)) { Matrix_Pop(); Matrix_RotateZYX(0, 0x8000, 0, MTXMODE_APPLY); Actor_DrawDoorLock(play, this->lockTimer, DOORLOCK_NORMAL); diff --git a/soh/src/overlays/actors/ovl_En_Du/z_en_du.c b/soh/src/overlays/actors/ovl_En_Du/z_en_du.c index 19af8a4c5..0327cb445 100644 --- a/soh/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/soh/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -276,7 +276,7 @@ void func_809FE040(EnDu* this) { this->unk_1E6 = 0; } // #region SOH[Enhancement] - if (CVarGetInteger("gEnhancements.FixDaruniaDanceSpeed", 1)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("FixDaruniaDanceSpeed"), 1)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfoFix, animationIndices[this->unk_1E6]); // #endregion } else { @@ -298,7 +298,7 @@ void func_809FE104(EnDu* this) { this->unk_1E6++; if (this->unk_1E6 < 4) { // #region SOH[Enhancement] - if (CVarGetInteger("gEnhancements.FixDaruniaDanceSpeed", 1) && this->unk_1E6 <= 1) { + if (CVarGetInteger(CVAR_ENHANCEMENT("FixDaruniaDanceSpeed"), 1) && this->unk_1E6 <= 1) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfoFix, animationIndices[this->unk_1E6]); // #endregion } else { @@ -498,7 +498,7 @@ void func_809FE890(EnDu* this, PlayState* play) { if (csAction->action == 7 || csAction->action == 8) { this->unk_1E6 = 0; // #region SOH[Enhancement] - if (CVarGetInteger("gEnhancements.FixDaruniaDanceSpeed", 1)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("FixDaruniaDanceSpeed"), 1)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfoFix, ENDU_ANIM_7); // #endregion } else { diff --git a/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c index f996fe6c1..eba2799b7 100644 --- a/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -631,15 +631,15 @@ void func_80A0329C(EnElf* this, PlayState* play) { if ((heightDiff > 0.0f) && (heightDiff < 60.0f)) { if (!func_80A01F90(&this->actor.world.pos, &refActor->actor.world.pos, 10.0f)) { - if (CVarGetInteger("gFairyEffect", 0) && !(this->fairyFlags & FAIRY_FLAG_BIG)) + if (CVarGetInteger(CVAR_ENHANCEMENT("FairyEffect"), 0) && !(this->fairyFlags & FAIRY_FLAG_BIG)) { - if (CVarGetInteger("gFairyPercentRestore", 0)) + if (CVarGetInteger(CVAR_ENHANCEMENT("FairyPercentRestore"), 0)) { - Health_ChangeBy(play, (gSaveContext.healthCapacity * CVarGetInteger("gFairyHealth", 100) / 100 + 15) / 16 * 16); + Health_ChangeBy(play, (gSaveContext.healthCapacity * CVarGetInteger(CVAR_ENHANCEMENT("FairyHealth"), 100) / 100 + 15) / 16 * 16); } else { - Health_ChangeBy(play, CVarGetInteger("gFairyHealth", 8) * 16); + Health_ChangeBy(play, CVarGetInteger(CVAR_ENHANCEMENT("FairyHealth"), 8) * 16); } } else diff --git a/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c b/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c index 146f0deaa..74d5fcd06 100644 --- a/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c +++ b/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c @@ -169,7 +169,7 @@ void EnEncount1_SpawnLeevers(EnEncount1* this, PlayState* play) { break; } } - int32_t modifiedSpawnRate = CVarGetInteger("gEnhancements.LeeverSpawnRate", 0); + int32_t modifiedSpawnRate = CVarGetInteger(CVAR_ENHANCEMENT("LeeverSpawnRate"), 0); if (modifiedSpawnRate) { this->timer = 20 * modifiedSpawnRate; } @@ -248,9 +248,9 @@ void EnEncount1_SpawnStalchildOrWolfos(EnEncount1* this, PlayState* play) { // been spawned and/or killed. int8_t enemyCount = play->actorCtx.actorLists[ACTORCAT_ENEMY].length; if ((this->curNumSpawn < this->maxCurSpawns && this->totalNumSpawn < this->maxTotalSpawns) || - (CVarGetInteger("gRandomizedEnemies", 0) && enemyCount < 15)) { + (CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) && enemyCount < 15)) { while ((this->curNumSpawn < this->maxCurSpawns && this->totalNumSpawn < this->maxTotalSpawns) || - (CVarGetInteger("gRandomizedEnemies", 0) && enemyCount < 15)) { + (CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) && enemyCount < 15)) { if (play->sceneNum == SCENE_HYRULE_FIELD) { if ((player->floorSfxOffset == 0) || (player->actor.floorBgId != BGCHECK_SCENE) || !(player->actor.bgCheckFlags & 1) || (player->stateFlags1 & PLAYER_STATE1_IN_WATER)) { @@ -282,7 +282,7 @@ void EnEncount1_SpawnStalchildOrWolfos(EnEncount1* this, PlayState* play) { break; } if ((player->actor.yDistToWater != BGCHECK_Y_MIN) && - (floorY < (player->actor.world.pos.y + player->actor.yDistToWater*(CVarGetInteger("gEnemySpawnsOverWaterboxes", 0) ? 1 : -1)))) { + (floorY < (player->actor.world.pos.y + player->actor.yDistToWater*(CVarGetInteger(CVAR_ENHANCEMENT("EnemySpawnsOverWaterboxes"), 0) ? 1 : -1)))) { break; } spawnPos.y = floorY; diff --git a/soh/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c b/soh/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c index 834096220..37ceedb87 100644 --- a/soh/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c +++ b/soh/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c @@ -388,7 +388,7 @@ void EnExRuppy_Draw(Actor* thisx, PlayState* play) { if (!this->invisible) { OPEN_DISPS(play->state.gfxCtx); - if (CVarGetInteger("gNewDrops", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0)) { // purple/gold rupees need less scaling f32 mtxScale = this->colorIdx >= 3 ? 17.5f : 25.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); diff --git a/soh/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c b/soh/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c index e6e096e47..ce0d39ded 100644 --- a/soh/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c +++ b/soh/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c @@ -212,7 +212,7 @@ void EnGSwitch_SilverRupeeTracker(EnGSwitch* this, PlayState* play) { static s8 majorScale[] = { 0, 2, 4, 5, 7, 9, 11, 13, 15, 17 }; if (this->noteIndex < sCollectedCount) { - if (sCollectedCount < (CVarGetInteger("gSilverRupeeJingleExtend", 0) ? 10 : 5)) { + if (sCollectedCount < (CVarGetInteger(CVAR_ENHANCEMENT("SilverRupeeJingleExtend"), 0) ? 10 : 5)) { // "sound?" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 音? ☆☆☆☆☆ %d\n" VT_RST, this->noteIndex); Audio_PlaySoundTransposed(&D_801333D4, NA_SE_EV_FIVE_COUNT_LUPY, majorScale[this->noteIndex]); @@ -480,7 +480,7 @@ void EnGSwitch_DrawRupee(Actor* thisx, PlayState* play) { if (!this->broken) { OPEN_DISPS(play->state.gfxCtx); - if (CVarGetInteger("gNewDrops", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0)) { // purple/gold/silver rupees need less scaling f32 mtxScale = this->colorIdx >= 3 ? 17.5f : 25.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); diff --git a/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c b/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c index 90d2981f0..f19ce1bae 100644 --- a/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -252,7 +252,7 @@ s32 EnGe3_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p rot->x += this->headRot.y; default: - if (CVarGetInteger("gGerudoWarriorClothingFix", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("GerudoWarriorClothingFix"), 0)) { // This is a hack to fix the color-changing clothes this Gerudo has on N64 versions OPEN_DISPS(play->state.gfxCtx); switch (limbIndex) { diff --git a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index 6aa1b7d41..11c29227f 100644 --- a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -493,7 +493,7 @@ s32 EnGirlA_CanBuy_DekuNuts(PlayState* play, EnGirlA* this) { if (gSaveContext.rupees < this->basePrice) { return CANBUY_RESULT_NEED_RUPEES; } - if ((Item_CheckObtainability(ITEM_NUT) == ITEM_NONE) && !CVarGetInteger("gFastDrops", 0)) { + if ((Item_CheckObtainability(ITEM_NUT) == ITEM_NONE) && !CVarGetInteger(CVAR_ENHANCEMENT("FastDrops"), 0)) { return CANBUY_RESULT_SUCCESS_FANFARE; } return CANBUY_RESULT_SUCCESS; @@ -506,7 +506,7 @@ s32 EnGirlA_CanBuy_DekuSticks(PlayState* play, EnGirlA* this) { if (gSaveContext.rupees < this->basePrice) { return CANBUY_RESULT_NEED_RUPEES; } - if ((Item_CheckObtainability(ITEM_STICK) == ITEM_NONE) && !CVarGetInteger("gFastDrops", 0)) { + if ((Item_CheckObtainability(ITEM_STICK) == ITEM_NONE) && !CVarGetInteger(CVAR_ENHANCEMENT("FastDrops"), 0)) { return CANBUY_RESULT_SUCCESS_FANFARE; } return CANBUY_RESULT_SUCCESS; @@ -705,7 +705,7 @@ s32 EnGirlA_CanBuy_DekuSeeds(PlayState* play, EnGirlA* this) { if (gSaveContext.rupees < this->basePrice) { return CANBUY_RESULT_NEED_RUPEES; } - if ((Item_CheckObtainability(ITEM_SEEDS) == ITEM_NONE) && !CVarGetInteger("gFastDrops", 0)) { + if ((Item_CheckObtainability(ITEM_SEEDS) == ITEM_NONE) && !CVarGetInteger(CVAR_ENHANCEMENT("FastDrops"), 0)) { return CANBUY_RESULT_SUCCESS_FANFARE; } return CANBUY_RESULT_SUCCESS; diff --git a/soh/src/overlays/actors/ovl_En_Go/z_en_go.c b/soh/src/overlays/actors/ovl_En_Go/z_en_go.c index 3094f2171..777c1cff2 100644 --- a/soh/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/soh/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -98,7 +98,7 @@ u16 EnGo_GetTextID(PlayState* play, Actor* thisx) { if (!IS_RANDO && gSaveContext.bgsFlag) { return 0x305E; } else if (INV_CONTENT(ITEM_TRADE_ADULT) >= ITEM_CLAIM_CHECK) { - if (Environment_GetBgsDayCount() >= CVarGetInteger("gForgeTime", 3)) { + if (Environment_GetBgsDayCount() >= CVarGetInteger(CVAR_ENHANCEMENT("ForgeTime"), 3)) { return 0x305E; } else { return 0x305D; diff --git a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c index a4aede2e5..5f1c8fa03 100644 --- a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -1082,7 +1082,7 @@ void EnGo2_BiggoronSetTextId(EnGo2* this, PlayState* play, Player* player) { if (func_8002F368(play) == EXCH_ITEM_CLAIM_CHECK) { if (IS_RANDO && Flags_GetTreasure(play, 0x1F)) { textId = 0x3003; - } else if (Environment_GetBgsDayCount() >= CVarGetInteger("gForgeTime", 3)) { + } else if (Environment_GetBgsDayCount() >= CVarGetInteger(CVAR_ENHANCEMENT("ForgeTime"), 3)) { textId = 0x305E; } else { textId = 0x305D; @@ -1091,7 +1091,7 @@ void EnGo2_BiggoronSetTextId(EnGo2* this, PlayState* play, Player* player) { } else { if (IS_RANDO && Flags_GetTreasure(play, 0x1F)) { textId = 0x305E; - } else if (Environment_GetBgsDayCount() >= CVarGetInteger("gForgeTime", 3)) { + } else if (Environment_GetBgsDayCount() >= CVarGetInteger(CVAR_ENHANCEMENT("ForgeTime"), 3)) { textId = 0x3002; } else { textId = 0x305D; diff --git a/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c b/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c index 391d7dc5d..ccb14cdbd 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -337,9 +337,9 @@ void func_80A56B40(EnHeishi4* this, PlayState* play) { Player* player = GET_PLAYER(play); // Only allow sneaking when not wearing a mask as that triggers different dialogue. MM Bunny hood disables // these interactions, so bunny hood is fine in that case. - if (CVarGetInteger("gMarketSneak", 0) && + if (CVarGetInteger(CVAR_ENHANCEMENT("MarketSneak"), 0) && (player->currentMask == PLAYER_MASK_NONE || - (player->currentMask == PLAYER_MASK_BUNNY && CVarGetInteger("gMMBunnyHood", 0)))) { + (player->currentMask == PLAYER_MASK_BUNNY && CVarGetInteger(CVAR_ENHANCEMENT("MMBunnyHood"), 0)))) { this->actionFunc = EnHeishi4_MarketSneak; } else { this->actionFunc = func_80A56614; diff --git a/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c index e0ff7470d..f02609d00 100644 --- a/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -438,7 +438,7 @@ u16 func_80A6F810(PlayState* play, Actor* thisx) { if (followingDog != 0) { this->unk_215 = false; - return ((followingDog == 1) || (CVarGetInteger("gAllDogsRichard", 0))) ? 0x709F : 0x709E; + return ((followingDog == 1) || (CVarGetInteger(CVAR_ENHANCEMENT("AllDogsRichard"), 0))) ? 0x709F : 0x709E; } else { return 0x709D; } diff --git a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c index aaf0e0342..ac8c0b7bd 100644 --- a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -233,7 +233,7 @@ void func_80A74398(Actor* thisx, PlayState* play) { Effect_Add(play, &this->blureIdx, EFFECT_BLURE1, 0, 0, &blureInit); func_80A74714(this); - uint8_t enemyRandoCCActive = CVarGetInteger("gRandomizedEnemies", 0) || CVarGetInteger("gCrowdControl", 0); + uint8_t enemyRandoCCActive = CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) || CVarGetInteger("gCrowdControl", 0); if (this->switchFlags != 0xFF) { // In vanilla gameplay, Iron Knuckles are despawned based on specific flags in specific scenarios. @@ -303,7 +303,7 @@ void func_80A747C0(EnIk* this, PlayState* play) { this->skelAnime.playSpeed = 1.0f; // Disable miniboss music with Enemy Randomizer because the music would keep // playing if the enemy was never defeated, which is common with Enemy Randomizer. - if (!CVarGetInteger("gRandomizedEnemies", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0)) { func_800F5ACC(NA_BGM_MINI_BOSS); } } @@ -663,7 +663,7 @@ void func_80A75A38(EnIk* this, PlayState* play) { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xB0); // Don't set flag when Enemy Rando or CrowdControl are on. // Instead Iron Knuckles rely on the "clear room" flag. - if (this->switchFlags != 0xFF && !CVarGetInteger("gRandomizedEnemies", 0) && !CVarGetInteger("gCrowdControl", 0)) { + if (this->switchFlags != 0xFF && !CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) && !CVarGetInteger("gCrowdControl", 0)) { Flags_SetSwitch(play, this->switchFlags); } Actor_Kill(&this->actor); @@ -1484,7 +1484,7 @@ void EnIk_Init(Actor* thisx, PlayState* play) { } // Immediately trigger Iron Knuckle for Enemy Rando and Crowd Control - if ((CVarGetInteger("gRandomizedEnemies", 0) || CVarGetInteger("gCrowdControl", 0)) && (thisx->params == 2 || thisx->params == 3)) { + if ((CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) || CVarGetInteger("gCrowdControl", 0)) && (thisx->params == 2 || thisx->params == 3)) { this->skelAnime.playSpeed = 1.0f; } } diff --git a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index 0a118916b..4bec916e2 100644 --- a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -118,7 +118,7 @@ void func_80A90264(EnKakasi2* this, PlayState* play) { this->unk_194++; bool skipScarecrow = play->msgCtx.msgMode == MSGMODE_OCARINA_PLAYING && - ((CVarGetInteger("gSkipScarecrow", 0) && gSaveContext.scarecrowSpawnSongSet) || + ((CVarGetInteger(CVAR_ENHANCEMENT("InstantScarecrow"), 0) && gSaveContext.scarecrowSpawnSongSet) || (IS_RANDO && Randomizer_GetSettingValue(RSK_SKIP_SCARECROWS_SONG))); if ((BREG(1) != 0) || skipScarecrow && (this->actor.xzDistToPlayer < this->maxSpawnDistance.x) && diff --git a/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 25299f5b0..1f813c2d6 100644 --- a/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -1095,7 +1095,7 @@ void func_80A98DB4(EnKo* this, PlayState* play) { dist = this->actor.xzDistToPlayer; } - if (CVarGetInteger("gDisableKokiriDrawDistance", 0) != 0) { + if (CVarGetInteger(CVAR_ENHANCEMENT("DisableKokiriDrawDistance"), 0) != 0) { this->appearDist = 32767.0f; Math_SmoothStepToF(&this->modelAlpha, (this->appearDist < dist) ? 0.0f : 255.0f, 0.3f, 40.0f, 1.0f); f32 test = this->appearDist; diff --git a/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index 75e54c140..04b0ca1e3 100644 --- a/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -137,9 +137,9 @@ void EnKusa_DropCollectible(EnKusa* this, PlayState* play) { Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, dropParams << 4); break; case ENKUSA_TYPE_1: - if (CVarGetInteger("gNoRandomDrops", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NoRandomDrops"), 0)) { } - else if (CVarGetInteger("gNoHeartDrops", 0)) { + else if (CVarGetInteger(CVAR_ENHANCEMENT("NoHeartDrops"), 0)) { Item_DropCollectible(play, &this->actor.world.pos, ITEM00_SEEDS); } else if (Rand_ZeroOne() < 0.5f) { diff --git a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c index ad3bd0ab5..8e61e5517 100644 --- a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -301,7 +301,7 @@ s32 EnKz_FollowPath(EnKz* this, PlayState* play) { pathDiffZ = pointPos->z - this->actor.world.pos.z; Math_SmoothStepToS(&this->actor.world.rot.y, (Math_FAtan2F(pathDiffX, pathDiffZ) * (0x8000 / M_PI)), 0xA, 0x3E8, 1); - if ((SQ(pathDiffX) + SQ(pathDiffZ)) < 10.0f * CVarGetInteger("gMweepSpeed", 1)) { + if ((SQ(pathDiffX) + SQ(pathDiffZ)) < 10.0f * CVarGetInteger(CVAR_ENHANCEMENT("MweepSpeed"), 1)) { this->waypoint++; if (this->waypoint >= path->count) { this->waypoint = 0; @@ -415,7 +415,7 @@ void EnKz_SetupMweep(EnKz* this, PlayState* play) { initPos.z += 260.0f; Play_CameraSetAtEye(play, this->cutsceneCamera, &pos, &initPos); func_8002DF54(play, &this->actor, 8); - this->actor.speedXZ = 0.1f * CVarGetInteger("gMweepSpeed", 1); + this->actor.speedXZ = 0.1f * CVarGetInteger(CVAR_ENHANCEMENT("MweepSpeed"), 1); this->actionFunc = EnKz_Mweep; } diff --git a/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c index 43f6a6665..b0aff3750 100644 --- a/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -512,7 +512,7 @@ void EnMb_SetupClubAttack(EnMb* this) { // Rotate Club Moblin towards player in Enemy Randomizer because they're // borderline useless otherwise in most scenarios. - if (CVarGetInteger("gRandomizedEnemies", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0)) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 100.0f, 0); Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 3, 100.0f, 0); } @@ -717,7 +717,7 @@ void EnMb_ClubWaitAfterAttack(EnMb* this, PlayState* play) { // Rotate Club Moblin towards player in Enemy Randomizer because they're // borderline useless otherwise in most scenarios. - if (CVarGetInteger("gRandomizedEnemies", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0)) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 100.0f, 0); Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 3, 100.0f, 0); } @@ -844,7 +844,7 @@ void EnMb_ClubAttack(EnMb* this, PlayState* play) { // Rotate Club Moblin towards player in Enemy Randomizer because they're // borderline useless otherwise in most scenarios. - if (!CVarGetInteger("gRandomizedEnemies", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0)) { Math_SmoothStepToS(&this->actor.shape.rot.y, relYawTarget[this->attack - 1] + this->actor.world.rot.y, 1, 0x2EE, 0); } else { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 100.0f, 0); @@ -891,7 +891,7 @@ void EnMb_ClubAttack(EnMb* this, PlayState* play) { // Disable camera shake when the Moblin attacks with Enemy Randomizer enabled. // This camera shake gets very annoying as these Moblins can spawn in many rooms, // and also often (initially) out of reach for the player. - if (!CVarGetInteger("gRandomizedEnemies", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0)) { Camera_AddQuake(&play->mainCamera, 2, 0x19, 5); } func_800358DC(&this->actor, &effSpawnPos, &this->actor.world.rot, flamesParams, 20, flamesUnused, play, @@ -1267,7 +1267,7 @@ void EnMb_ClubWaitPlayerNear(EnMb* this, PlayState* play) { // Rotate Club Moblin towards player in Enemy Randomizer because they're // borderline useless otherwise in most scenarios. - if (CVarGetInteger("gRandomizedEnemies", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0)) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 100.0f, 0); Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 3, 100.0f, 0); } @@ -1278,7 +1278,7 @@ void EnMb_ClubWaitPlayerNear(EnMb* this, PlayState* play) { // Add a height check to the Moblin's Club attack when Enemy Randomizer is on. // Without the height check, the Moblin will attack (and play the sound effect) a lot even though // the Moblin is very far away from the player in vertical rooms (like the first room in Deku Tree). - s8 enemyRando = CVarGetInteger("gRandomizedEnemies", 0); + s8 enemyRando = CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0); if (!enemyRando || (enemyRando && this->actor.yDistToPlayer <= 100.0f && this->actor.yDistToPlayer >= -100.0f)) { EnMb_SetupClubAttack(this); } diff --git a/soh/src/overlays/actors/ovl_En_Md/z_en_md.c b/soh/src/overlays/actors/ovl_En_Md/z_en_md.c index 9181b452b..7cdce3852 100644 --- a/soh/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/soh/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -638,7 +638,7 @@ void func_80AAB5A4(EnMd* this, PlayState* play) { f32 temp; if (play->sceneNum != SCENE_MIDOS_HOUSE) { - if (CVarGetInteger("gDisableKokiriDrawDistance", 0) != 0) { + if (CVarGetInteger(CVAR_ENHANCEMENT("DisableKokiriDrawDistance"), 0) != 0) { temp = (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && !Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH) && (play->sceneNum == SCENE_KOKIRI_FOREST)) ? 100.0f diff --git a/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c index 91730e5bf..3f94ac8ea 100644 --- a/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -666,7 +666,7 @@ void func_80AB6D08(EnNiw* this, PlayState* play) { } this->path = 1; - this->timer5 = 80 * CVarGetInteger("gCuccoStayDurationMultiplier", 1); + this->timer5 = 80 * CVarGetInteger(CVAR_ENHANCEMENT("CuccoStayDurationMult"), 1); this->actor.speedXZ = 0.0f; this->actor.velocity.y = 4.0f; } else { diff --git a/soh/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/soh/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c index 2add8c4a9..63f4fe3a3 100644 --- a/soh/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/soh/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -75,7 +75,7 @@ void EnNutsball_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 400.0f, ActorShadow_DrawCircle, 13.0f); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); - if (CVarGetInteger("gRandomizedEnemies", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0)) { this->objBankIndex = 0; } else { this->objBankIndex = Object_GetIndex(&play->objectCtx, sObjectIDs[this->actor.params]); @@ -176,7 +176,7 @@ void EnNutsball_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx); - if (CVarGetInteger("gNewDrops", 0) != 0) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0) != 0) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, 0, 1 * (play->state.frames * 6), diff --git a/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index 9533e8309..5d75b7343 100644 --- a/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -506,7 +506,7 @@ void EnOkuta_ProjectileFly(EnOkuta* this, PlayState* play) { pos.x = this->actor.world.pos.x; pos.y = this->actor.world.pos.y + 11.0f; pos.z = this->actor.world.pos.z; - if (CVarGetInteger("gNewDrops", 0) != 0) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0) != 0) { static s16 sEffectScales[] = { 145, 135, 115, 85, 75, 53, 45, 40, 35, }; @@ -763,7 +763,7 @@ void EnOkuta_Draw(Actor* thisx, PlayState* play) { } else { OPEN_DISPS(play->state.gfxCtx); - if (CVarGetInteger("gNewDrops", 0) != 0) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0) != 0) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, 0, 1 * (play->state.frames * 6), diff --git a/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c index 303c58819..93d51171c 100644 --- a/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -373,7 +373,7 @@ void func_80ACA7E0(EnOwl* this, PlayState* play) { void EnOwl_ConfirmKokiriMessage(EnOwl* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) { // swap the order of the responses if better owl is enabled - uint8_t index = CVarGetInteger("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); + uint8_t index = CVarGetInteger(CVAR_ENHANCEMENT("BetterOwl"), 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: Message_ContinueTextbox(play, 0x2065); @@ -402,7 +402,7 @@ void EnOwl_WaitOutsideKokiri(EnOwl* this, PlayState* play) { void func_80ACA998(EnOwl* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) { // swap the order of the responses if better owl is enabled - uint8_t index = CVarGetInteger("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); + uint8_t index = CVarGetInteger(CVAR_ENHANCEMENT("BetterOwl"), 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: Message_ContinueTextbox(play, 0x2069); @@ -448,7 +448,7 @@ void EnOwl_WaitHyruleCastle(EnOwl* this, PlayState* play) { void func_80ACAB88(EnOwl* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) { // swap the order of the responses if better owl is enabled - uint8_t index = CVarGetInteger("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); + uint8_t index = CVarGetInteger(CVAR_ENHANCEMENT("BetterOwl"), 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: // obtained zelda's letter @@ -491,7 +491,7 @@ void EnOwl_WaitKakariko(EnOwl* this, PlayState* play) { void func_80ACAD34(EnOwl* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) { // swap the order of the responses if better owl is enabled - uint8_t index = CVarGetInteger("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); + uint8_t index = CVarGetInteger(CVAR_ENHANCEMENT("BetterOwl"), 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: Message_ContinueTextbox(play, 0x206F); @@ -529,7 +529,7 @@ void EnOwl_WaitGerudo(EnOwl* this, PlayState* play) { void func_80ACAEB8(EnOwl* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) { // swap the order of the responses if better owl is enabled - uint8_t index = CVarGetInteger("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); + uint8_t index = CVarGetInteger(CVAR_ENHANCEMENT("BetterOwl"), 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: Message_ContinueTextbox(play, 0x2071); @@ -651,7 +651,7 @@ void EnOwl_WaitDeathMountainShortcut(EnOwl* this, PlayState* play) { void func_80ACB344(EnOwl* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) { // swap the order of the responses if better owl is enabled - uint8_t index = CVarGetInteger("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); + uint8_t index = CVarGetInteger(CVAR_ENHANCEMENT("BetterOwl"), 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: Message_ContinueTextbox(play, 0x607A); @@ -676,7 +676,7 @@ void func_80ACB3E0(EnOwl* this, PlayState* play) { void func_80ACB440(EnOwl* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) { // swap the order of the responses if better owl is enabled - uint8_t index = CVarGetInteger("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); + uint8_t index = CVarGetInteger(CVAR_ENHANCEMENT("BetterOwl"), 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: Message_ContinueTextbox(play, 0x10C1); @@ -713,7 +713,7 @@ void EnOwl_WaitLWPreSaria(EnOwl* this, PlayState* play) { void func_80ACB5C4(EnOwl* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) { // swap the order of the responses if better owl is enabled - uint8_t index = CVarGetInteger("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); + uint8_t index = CVarGetInteger(CVAR_ENHANCEMENT("BetterOwl"), 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: Message_ContinueTextbox(play, 0x10C5); diff --git a/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index 7b444f241..5526ad49c 100644 --- a/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -328,7 +328,7 @@ void EnPeehat_Ground_SetStateGround(EnPeehat* this) { void EnPeehat_Ground_StateGround(EnPeehat* this, PlayState* play) { // Keep the peahat as the version that doesn't spawn extra enemies and can actually be killed // when Enemy Randomizer is on. - if (IS_DAY || CVarGetInteger("gRandomizedEnemies", 0)) { + if (IS_DAY || CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0)) { this->actor.flags |= ACTOR_FLAG_TARGETABLE; if (this->riseDelayTimer == 0) { if (this->actor.xzDistToPlayer < this->xzDistToRise) { diff --git a/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 793c73865..0ffd1459e 100644 --- a/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -254,7 +254,7 @@ void func_80AE2744(EnRd* this, PlayState* play) { // Add a height check to redeads/gibdos freeze when Enemy Randomizer is on. // Without the height check, redeads/gibdos can freeze the player from insane distances in // vertical rooms (like the first room in Deku Tree), making these rooms nearly unplayable. - s8 enemyRandoCCActive = CVarGetInteger("gRandomizedEnemies", 0) || CVarGetInteger("gCrowdControl", 0); + s8 enemyRandoCCActive = CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) || CVarGetInteger("gCrowdControl", 0); if (!enemyRandoCCActive || (enemyRandoCCActive && this->actor.yDistToPlayer <= 100.0f && this->actor.yDistToPlayer >= -100.0f)) { if ((this->actor.params != 2) && (this->unk_305 == 0)) { func_80AE37BC(this); @@ -668,7 +668,7 @@ void func_80AE3C98(EnRd* this, PlayState* play) { if (SkelAnime_Update(&this->skelAnime)) { if (this->unk_30C == 0) { - s8 enemyRandoCCActive = CVarGetInteger("gRandomizedEnemies", 0) || CVarGetInteger("gCrowdControl", 0); + s8 enemyRandoCCActive = CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) || CVarGetInteger("gCrowdControl", 0); // Don't set this flag in Enemy Rando as it can overlap with other objects using the same flag. if (!Flags_GetSwitch(play, this->unk_312 & 0x7F) && !enemyRandoCCActive) { Flags_SetSwitch(play, this->unk_312 & 0x7F); diff --git a/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c index 9e09a705c..708d5ddf2 100644 --- a/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -750,7 +750,7 @@ void EnSa_Update(Actor* thisx, PlayState* play) { } if (this->actionFunc != func_80AF68E4) { - if (CVarGetInteger("gDisableKokiriDrawDistance", 0) != 0) { + if (CVarGetInteger(CVAR_ENHANCEMENT("DisableKokiriDrawDistance"), 0) != 0) { this->alpha = func_80034DD4(&this->actor, play, this->alpha, 32767); } else { diff --git a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c index 943a2fbb0..185a39c51 100644 --- a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -111,7 +111,7 @@ void func_80AFB768(EnSi* this, PlayState* play) { } else { Item_Give(play, giveItemId); } - if ((!CVarGetInteger("gSkulltulaFreeze", 0) || giveItemId != ITEM_SKULL_TOKEN) && + if ((!CVarGetInteger(CVAR_ENHANCEMENT("SkulltulaFreeze"), 0) || giveItemId != ITEM_SKULL_TOKEN) && getItemId != RG_ICE_TRAP) { player->actor.freezeTimer = 20; } @@ -181,7 +181,7 @@ void func_80AFB950(EnSi* this, PlayState* play) { Player* player = GET_PLAYER(play); if (Message_GetState(&play->msgCtx) != TEXT_STATE_CLOSING && - (!CVarGetInteger("gSkulltulaFreeze", 0) || getItemId == RG_ICE_TRAP || giveItemId != ITEM_SKULL_TOKEN)) { + (!CVarGetInteger(CVAR_ENHANCEMENT("SkulltulaFreeze"), 0) || getItemId == RG_ICE_TRAP || giveItemId != ITEM_SKULL_TOKEN)) { player->actor.freezeTimer = 10; } else { SET_GS_FLAGS((this->actor.params & 0x1F00) >> 8, this->actor.params & 0xFF); diff --git a/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c index 6a5862747..e985fe862 100644 --- a/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -192,7 +192,7 @@ void EnSkb_Destroy(Actor* thisx, PlayState* play) { void func_80AFCD60(EnSkb* this) { // Don't despawn stallchildren during daytime when enemy randomizer is enabled. - if (IS_DAY && !CVarGetInteger("gRandomizedEnemies", 0)) { + if (IS_DAY && !CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0)) { func_80AFCF48(this); } else if (Actor_IsFacingPlayer(&this->actor, 0x11C7) && (this->actor.xzDistToPlayer < (60.0f + (this->actor.params * 6.0f)))) { @@ -290,7 +290,7 @@ void EnSkb_Advance(EnSkb* this, PlayState* play) { } } // Don't despawn stallchildren during daytime or when a stalchildren walks too far away from his "home" when enemy randomizer is enabled. - if ((Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) > 800.0f || IS_DAY) && !CVarGetInteger("gRandomizedEnemies", 0)) { + if ((Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) > 800.0f || IS_DAY) && !CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0)) { func_80AFCF48(this); } else if (Actor_IsFacingPlayer(&this->actor, 0x11C7) && (this->actor.xzDistToPlayer < (60.0f + (this->actor.params * 6.0f)))) { diff --git a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c index 67c695872..d4b26eb12 100644 --- a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -1413,7 +1413,7 @@ void EnSkj_StartOcarinaMinigame(EnSkj* this, PlayState* play) { if (dialogState == TEXT_STATE_CLOSING) { // #region SOH [Enhancement] - if (CVarGetInteger("gInstantOcarinaGameWin", 0) && CVarGetInteger("gCustomizeOcarinaGame", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("InstantOcarinaGameWin"), 0) && CVarGetInteger(CVAR_ENHANCEMENT("CustomizeOcarinaGame"), 0)) { play->msgCtx.ocarinaMode = OCARINA_MODE_0F; this->songFailTimer = 160; this->actionFunc = EnSkj_WaitForPlayback; @@ -1475,8 +1475,8 @@ void EnSkj_WaitForPlayback(EnSkj* this, PlayState* play) { case MSGMODE_MEMORY_GAME_PLAYER_PLAYING: if (this->songFailTimer != 0) { // #region SOH [Enhancement] - if (CVarGetInteger("gOcarinaUnlimitedFailTime", 0) == 1 && - CVarGetInteger("gCustomizeOcarinaGame", 0) == 1) { + if (CVarGetInteger(CVAR_ENHANCEMENT("OcarinaUnlimitedFailTime"), 0) == 1 && + CVarGetInteger(CVAR_ENHANCEMENT("CustomizeOcarinaGame"), 0) == 1) { // don't decrement timer // #endregion } else { diff --git a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c index f62f8b998..00f859e70 100644 --- a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -354,7 +354,7 @@ s32 func_80B0C9F0(EnSw* this, PlayState* play) { } Enemy_StartFinishingBlow(play, &this->actor); if (((this->actor.params & 0xE000) >> 0xD) != 0) { - if (CVarGetInteger("gGsCutscene", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("GSCutscene"), 0)) { OnePointCutscene_Init(play, 2200, 90, &this->actor, MAIN_CAM); } this->skelAnime.playSpeed = 8.0f; @@ -571,7 +571,7 @@ void func_80B0D590(EnSw* this, PlayState* play) { this->collider.elements[0].info.ocElemFlags = 1; } - Math_ApproachF(&this->actor.scale.x, !IS_DAY || CVarGetInteger("gNightGSAlwaysSpawn", 0) ? 0.02f : 0.0f, 0.2f, 0.01f); + Math_ApproachF(&this->actor.scale.x, !IS_DAY || CVarGetInteger(CVAR_ENHANCEMENT("NightGSAlwaysSpawn"), 0) ? 0.02f : 0.0f, 0.2f, 0.01f); Actor_SetScale(&this->actor, this->actor.scale.x); } diff --git a/soh/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c b/soh/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c index f0d9d3897..dbd6007a2 100644 --- a/soh/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c +++ b/soh/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c @@ -111,8 +111,8 @@ void EnSyatekiItm_Idle(EnSyatekiItm* this, PlayState* play) { player->actor.world.rot.x = player->actor.shape.rot.x = player->actor.world.rot.z = player->actor.shape.rot.z = 0; s32 ammunition = 15; - if(CVarGetInteger("gCustomizeShootingGallery", 0)) { - ammunition = CVarGetInteger(LINK_IS_ADULT ? "gAdultShootingGalleryAmmunition" : "gChildShootingGalleryAmmunition", 15); + if(CVarGetInteger(CVAR_ENHANCEMENT("CustomizeShootingGallery"), 0)) { + ammunition = CVarGetInteger(LINK_IS_ADULT ? CVAR_ENHANCEMENT("ShootingGalleryAmmoAdult") : CVAR_ENHANCEMENT("ShootingGalleryAmmoChild"), 15); } func_8008EF44(play, ammunition); this->roundNum = this->hitCount = 0; @@ -132,7 +132,7 @@ void EnSyatekiItm_StartRound(EnSyatekiItm* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->unkTimer == 0) { - if (LINK_IS_ADULT && !(CVarGetInteger("gCustomizeShootingGallery", 0) && CVarGetInteger("gConstantAdultGallery", 0))) { + if (LINK_IS_ADULT && !(CVarGetInteger(CVAR_ENHANCEMENT("CustomizeShootingGallery"), 0) && CVarGetInteger(CVAR_ENHANCEMENT("ConstantAdultGallery"), 0))) { for (i = 0, j = 0; i < SYATEKI_ROUND_MAX; i++) { if (this->roundFlags[i]) { j++; diff --git a/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index 6ab91ddc0..252279e35 100644 --- a/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -293,7 +293,7 @@ void EnSyatekiMan_StartGame(EnSyatekiMan* this, PlayState* play) { Message_CloseTextbox(play); gallery = ((EnSyatekiItm*)this->actor.parent); if (gallery->actor.update != NULL) { - if(CVarGetInteger("gCustomizeShootingGallery", 0) && CVarGetInteger("gInstantShootingGalleryWin", 0)) { + if(CVarGetInteger(CVAR_ENHANCEMENT("CustomizeShootingGallery"), 0) && CVarGetInteger(CVAR_ENHANCEMENT("InstantShootingGalleryWin"), 0)) { gallery->hitCount = 10; gallery->signal = ENSYATEKI_END; } else { @@ -406,8 +406,8 @@ void EnSyatekiMan_EndGame(EnSyatekiMan* this, PlayState* play) { case SYATEKI_RESULT_ALMOST: this->timer = 20; s32 ammunition = 15; - if(CVarGetInteger("gCustomizeShootingGallery", 0)) { - ammunition = CVarGetInteger(LINK_IS_ADULT ? "gAdultShootingGalleryAmmunition" : "gChildShootingGalleryAmmunition", 15); + if(CVarGetInteger(CVAR_ENHANCEMENT("CustomizeShootingGallery"), 0)) { + ammunition = CVarGetInteger(LINK_IS_ADULT ? CVAR_ENHANCEMENT("ShootingGalleryAmmoAdult") : CVAR_ENHANCEMENT("ShootingGalleryAmmoChild"), 15); } func_8008EF44(play, ammunition); this->actionFunc = EnSyatekiMan_RestartGame; diff --git a/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 55fbed824..d00ebbb18 100644 --- a/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -408,7 +408,7 @@ s32 EnTk_ChooseReward(EnTk* this) { f32 luck; s32 reward; - if ((IS_RANDO || CVarGetInteger("gDampeWin", 0)) && !Flags_GetCollectible(gPlayState, COLLECTFLAG_GRAVEDIGGING_HEART_PIECE) && this->heartPieceSpawned == 0) { + if ((IS_RANDO || CVarGetInteger(CVAR_ENHANCEMENT("DampeWin"), 0)) && !Flags_GetCollectible(gPlayState, COLLECTFLAG_GRAVEDIGGING_HEART_PIECE) && this->heartPieceSpawned == 0) { return 3; } @@ -502,7 +502,7 @@ void EnTk_Init(Actor* thisx, PlayState* play) { CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - if (CVarGetInteger("gDampeAllNight", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("DampeAllNight"), 0)) { if (!!LINK_IS_ADULT || play->sceneNum != SCENE_GRAVEYARD) { Actor_Kill(&this->actor); return; @@ -610,7 +610,7 @@ void EnTk_Dig(EnTk* this, PlayState* play) { this->rewardTimer = 0; - if (this->validDigHere == 1 || IS_RANDO || CVarGetInteger("gDampeWin", 0)) { + if (this->validDigHere == 1 || IS_RANDO || CVarGetInteger(CVAR_ENHANCEMENT("DampeWin"), 0)) { rewardOrigin.x = 0.0f; rewardOrigin.y = 0.0f; rewardOrigin.z = -40.0f; @@ -625,15 +625,15 @@ void EnTk_Dig(EnTk* this, PlayState* play) { this->currentReward = EnTk_ChooseReward(this); if (this->currentReward == 3) { - if (IS_RANDO || CVarGetInteger("gDampeWin", 0)) { + if (IS_RANDO || CVarGetInteger(CVAR_ENHANCEMENT("DampeWin"), 0)) { /* * Upgrade the purple rupee reward to the heart piece if this * is the first grand prize dig. */ - if (!Flags_GetItemGetInf(ITEMGETINF_1C) && !(IS_RANDO || CVarGetInteger("gDampeWin", 0))) { + if (!Flags_GetItemGetInf(ITEMGETINF_1C) && !(IS_RANDO || CVarGetInteger(CVAR_ENHANCEMENT("DampeWin"), 0))) { Flags_SetItemGetInf(ITEMGETINF_1C); this->currentReward = 4; - } else if ((IS_RANDO || CVarGetInteger("gDampeWin", 0)) && !Flags_GetCollectible(gPlayState, COLLECTFLAG_GRAVEDIGGING_HEART_PIECE) && this->heartPieceSpawned == 0) { + } else if ((IS_RANDO || CVarGetInteger(CVAR_ENHANCEMENT("DampeWin"), 0)) && !Flags_GetCollectible(gPlayState, COLLECTFLAG_GRAVEDIGGING_HEART_PIECE) && this->heartPieceSpawned == 0) { this->currentReward = 4; } } @@ -646,7 +646,7 @@ void EnTk_Dig(EnTk* this, PlayState* play) { // If true, spawn the heart piece and set the vanilla itemGetInf flag and new temp clear flag. if (!heartPieceSpawned && (!(gSaveContext.itemGetInf[1] & ITEMGETINFFLAG_GRAVEDIGGING_HEART_PIECE) || - CVarGetInteger("gGravediggingTourFix", 0) && + CVarGetInteger(CVAR_ENHANCEMENT("GravediggingTourFix"), 0) && !Flags_GetCollectible(play, COLLECTFLAG_GRAVEDIGGING_HEART_PIECE))) { this->currentReward = 4; gSaveContext.itemGetInf[1] |= ITEMGETINFFLAG_GRAVEDIGGING_HEART_PIECE; @@ -668,7 +668,7 @@ void EnTk_Dig(EnTk* this, PlayState* play) { if (this->skelAnime.curFrame >= 32.0f && this->rewardTimer == 10) { /* Play a reward sound shortly after digging */ - if (!(IS_RANDO || CVarGetInteger("gDampeWin", 0)) && this->validDigHere == 0) { + if (!(IS_RANDO || CVarGetInteger(CVAR_ENHANCEMENT("DampeWin"), 0)) && this->validDigHere == 0) { /* Bad dig spot */ Audio_PlayActorSound2(&this->actor, NA_SE_SY_ERROR); } else if (this->currentReward == 4) { diff --git a/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index f919bb39a..ef2b79cdb 100644 --- a/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -128,7 +128,7 @@ void EnTorch2_Init(Actor* thisx, PlayState* play2) { // Change Dark Link to regular enemy instead of boss with enemy randomizer and crowd control. // This way Dark Link will be considered for "clear enemy" rooms properly. - if (CVarGetInteger("gRandomizedEnemies", 0) || CVarGetInteger("gCrowdControl", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) || CVarGetInteger("gCrowdControl", 0)) { Actor_ChangeCategory(play, &play->actorCtx, thisx, ACTORCAT_ENEMY); } @@ -279,7 +279,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { } // Disable miniboss music with Enemy Randomizer because the music would keep // playing if the enemy was never defeated, which is common with Enemy Randomizer. - if (!CVarGetInteger("gRandomizedEnemies", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0)) { func_800F5ACC(NA_BGM_MINI_BOSS); } sActionState = ENTORCH2_ATTACK; diff --git a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c index d52b82d8d..ae4ac753f 100644 --- a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -293,7 +293,7 @@ void func_80B20768(EnToryo* this, PlayState* play) { // Animation Count should be no more than 1 to guarantee putaway is complete after giving the saw // As this is vanilla behavior, it only applies with the Fix toggle or Skip Text enabled. - bool checkAnim = (CVarGetInteger("gFixSawSoftlock", 0) != 0 || CVarGetInteger("gSkipText", 0) != 0) ? play->animationCtx.animationCount <= 1 : true; + bool checkAnim = (CVarGetInteger(CVAR_ENHANCEMENT("FixSawSoftlock"), 0) != 0 || CVarGetInteger(CVAR_ENHANCEMENT("SkipText"), 0) != 0) ? play->animationCtx.animationCount <= 1 : true; if (this->unk_1E4 == 3 && checkAnim) { Actor_ProcessTalkRequest(&this->actor, play); Message_ContinueTextbox(play, this->actor.textId); diff --git a/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.c b/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.c index d7a838d8a..9b6154a8b 100644 --- a/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.c +++ b/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.c @@ -246,7 +246,7 @@ void EnVali_SetupDivideAndDie(EnVali* this, PlayState* play) { // Offset small jellyfish with Enemy Randomizer, otherwise it gets // stuck in a loop spawning more big jellyfish with seeded spawns. - if (CVarGetInteger("gRandomizedEnemies", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0)) { this->actor.world.rot.y += rand() % 50; } diff --git a/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 2f90ad1a0..1a711b644 100644 --- a/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -405,7 +405,7 @@ void EnWallmas_ReturnToCeiling(EnWallmas* this, PlayState* play) { } } if (this->actor.params == WMT_SHADOWTAG) { - if (!CVarGetInteger("gShadowTag", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("ShadowTag"), 0)) { Actor_Kill(&this->actor); } } @@ -439,7 +439,7 @@ void EnWallmas_Die(EnWallmas* this, PlayState* play) { Actor_Kill(&this->actor); } if (this->actor.params == WMT_SHADOWTAG) { - if (!CVarGetInteger("gShadowTag", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("ShadowTag"), 0)) { Actor_Kill(&this->actor); } else { EnWallmas_Init(this, play); diff --git a/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c index 41a485bbc..2c243e254 100644 --- a/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -390,7 +390,7 @@ void EnWf_WaitToAppear(EnWf* this, PlayState* play) { // Disable miniboss music with Enemy Randomizer because the music would keep // playing if the enemy was never defeated, which is common with Enemy Randomizer. - if ((this->actor.params != WOLFOS_NORMAL) && (this->switchFlag != 0xFF) && !CVarGetInteger("gRandomizedEnemies", 0)) { + if ((this->actor.params != WOLFOS_NORMAL) && (this->switchFlag != 0xFF) && !CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0)) { func_800F5ACC(NA_BGM_MINI_BOSS); } } diff --git a/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index 4adb7afe7..2b0d6c126 100644 --- a/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -101,7 +101,7 @@ static f32 sSpawnSin; s32 EnWood02_SpawnZoneCheck(EnWood02* this, PlayState* play, Vec3f* pos) { f32 phi_f12; - if (CVarGetInteger("gDisableDrawDistance", 0) != 0) { + if (CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 0) != 0) { return true; } @@ -177,7 +177,7 @@ void EnWood02_Init(Actor* thisx, PlayState* play2) { // as the night scene, For the always spawn GS enhancement we apply the needed // params to have the GS drop when bonking if ((this->actor.params & 0xFF) == WOOD_TREE_CONICAL_MEDIUM && IS_DAY && - play->sceneNum == SCENE_KAKARIKO_VILLAGE && CVarGetInteger("gNightGSAlwaysSpawn", 0)) { + play->sceneNum == SCENE_KAKARIKO_VILLAGE && CVarGetInteger(CVAR_ENHANCEMENT("NightGSAlwaysSpawn"), 0)) { this->actor.params = 0x2001; this->actor.home.rot.z = 0x71; } @@ -352,7 +352,7 @@ void EnWood02_Update(Actor* thisx, PlayState* play2) { dropsSpawnPt = this->actor.world.pos; dropsSpawnPt.y += 200.0f; - if ((this->unk_14C >= 0) && (this->unk_14C < 0x64) && (CVarGetInteger("gTreeStickDrops", 0)) && !(INV_CONTENT(ITEM_STICK) == ITEM_NONE)) { + if ((this->unk_14C >= 0) && (this->unk_14C < 0x64) && (CVarGetInteger(CVAR_ENHANCEMENT("TreesDropSticks"), 0)) && !(INV_CONTENT(ITEM_STICK) == ITEM_NONE)) { (numDrops = (Rand_ZeroOne() * 4)); for (i = 0; i < numDrops; ++i) { Item_DropCollectible(play, &dropsSpawnPt, ITEM00_STICK); diff --git a/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c index f5275618b..57ac15ecf 100644 --- a/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -428,7 +428,7 @@ u16 EnZo_GetTextId(PlayState* play, Actor* thisx) { } if (Flags_GetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED) || - (CVarGetInteger("gFixZoraHintDialogue", 0) && + (CVarGetInteger(CVAR_ENHANCEMENT("FixZoraHintDialogue"), 0) && Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_RUTOS_LETTER))) { return 0x4010; } diff --git a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c index 9a31ceb50..7bf1ac7d1 100644 --- a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -2901,24 +2901,24 @@ f32 Fishing_GetMinimumRequiredScore() { // RANDOTODO: update the enhancement sliders to not allow // values above rando fish weight values when rando'd if(sLinkAge == 1) { - weight = CVarGetInteger("gCustomizeFishing", 0) ? CVarGetInteger("gChildMinimumWeightFish", 10) : 10; + weight = CVarGetInteger(CVAR_ENHANCEMENT("CustomizeFishing"), 0) ? CVarGetInteger(CVAR_ENHANCEMENT("MinimumFishWeightChild"), 10) : 10; } else { - weight = CVarGetInteger("gCustomizeFishing", 0) ? CVarGetInteger("gAdultMinimumWeightFish", 13) : 13; + weight = CVarGetInteger(CVAR_ENHANCEMENT("CustomizeFishing"), 0) ? CVarGetInteger(CVAR_ENHANCEMENT("MinimumFishWeightAdult"), 13) : 13; } return sqrt(((f32)weight - 0.5f) / 0.0036f); } bool getInstantFish() { - return CVarGetInteger("gCustomizeFishing", 0) && CVarGetInteger("gInstantFishing", 0); + return CVarGetInteger(CVAR_ENHANCEMENT("CustomizeFishing"), 0) && CVarGetInteger(CVAR_ENHANCEMENT("InstantFishing"), 0); } bool getGuaranteeBite() { - return CVarGetInteger("gCustomizeFishing", 0) && CVarGetInteger("gGuaranteeFishingBite", 0); + return CVarGetInteger(CVAR_ENHANCEMENT("CustomizeFishing"), 0) && CVarGetInteger(CVAR_ENHANCEMENT("GuaranteeFishingBite"), 0); } bool getFishNeverEscape() { - return CVarGetInteger("gCustomizeFishing", 0) && CVarGetInteger("gFishNeverEscape", 0); + return CVarGetInteger(CVAR_ENHANCEMENT("CustomizeFishing"), 0) && CVarGetInteger(CVAR_ENHANCEMENT("FishNeverEscape"), 0); } void Fishing_UpdateFish(Actor* thisx, PlayState* play2) { @@ -5513,7 +5513,7 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) { player->actor.speedXZ = 0.0f; // #region SOH [Enhancement] - if (CVarGetInteger("gQuitFishingAtDoor", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("QuitFishingAtDoor"), 0)) { Fishing_QuitAtDoor(this, play); } // #endregion diff --git a/soh/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c b/soh/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c index a9e5ca2a7..9d0cb7619 100644 --- a/soh/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/soh/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -141,7 +141,7 @@ void ObjComb_ChooseItemDrop(ObjComb* this, PlayState* play) { } else if (Rand_ZeroOne() < 0.5f) { params = -1; } - if (params >= 0 && !CVarGetInteger("gNoRandomDrops", 0)) { + if (params >= 0 && !CVarGetInteger(CVAR_ENHANCEMENT("NoRandomDrops"), 0)) { Item_DropCollectible(play, &this->actor.world.pos, params); } } diff --git a/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index 217fc434f..18c898547 100644 --- a/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -123,7 +123,7 @@ void ObjLightswitch_InitCollider(ObjLightswitch* this, PlayState* play) { s32 pad; // Initialize this with the sun switch, so it can't be affected by toggling while the actor is loaded - sunLightArrowsEnabledOnSunSwitchLoad = CVarGetInteger("gSunlightArrows", 0) || (IS_RANDO && Randomizer_GetSettingValue(RSK_SUNLIGHT_ARROWS)); + sunLightArrowsEnabledOnSunSwitchLoad = CVarGetInteger(CVAR_ENHANCEMENT("SunlightArrows"), 0) || (IS_RANDO && Randomizer_GetSettingValue(RSK_SUNLIGHT_ARROWS)); Collider_InitJntSph(play, &this->collider); // If "Sunlight Arrows" is enabled, set up the collider to allow Light Arrow hits diff --git a/soh/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c b/soh/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c index 2f5cf4ee3..a59dc5ab6 100644 --- a/soh/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c +++ b/soh/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c @@ -275,7 +275,7 @@ void ObjMure_InitialAction(ObjMure* this, PlayState* play) { } void ObjMure_CulledState(ObjMure* this, PlayState* play) { - if (fabsf(this->actor.projectedPos.z) < sZClip[this->type] || CVarGetInteger("gDisableDrawDistance", 0) != 0) { + if (fabsf(this->actor.projectedPos.z) < sZClip[this->type] || CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 0) != 0) { this->actionFunc = ObjMure_ActiveState; this->actor.flags |= ACTOR_FLAG_UPDATE_WHILE_CULLED; ObjMure_SpawnActors(this, play); @@ -399,7 +399,7 @@ static ObjMureActionFunc sTypeGroupBehaviorFunc[] = { void ObjMure_ActiveState(ObjMure* this, PlayState* play) { ObjMure_CheckChildren(this, play); if (sZClip[this->type] + 40.0f <= fabsf(this->actor.projectedPos.z) && - CVarGetInteger("gDisableDrawDistance", 1) != 0) { + CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 1) != 0) { this->actionFunc = ObjMure_CulledState; this->actor.flags &= ~ACTOR_FLAG_UPDATE_WHILE_CULLED; ObjMure_KillActors(this, play); diff --git a/soh/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c b/soh/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c index b883072b9..0aad27c04 100644 --- a/soh/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c +++ b/soh/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c @@ -191,7 +191,7 @@ void func_80B9A658(ObjMure2* this) { void func_80B9A668(ObjMure2* this, PlayState* play) { if (Math3D_Dist1DSq(this->actor.projectedPos.x, this->actor.projectedPos.z) < (sDistSquared1[this->actor.params & 3] * this->unk_184) || - CVarGetInteger("gDisableDrawDistance", 0) != 0) { + CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 0) != 0) { this->actor.flags |= ACTOR_FLAG_UPDATE_WHILE_CULLED; ObjMure2_SpawnActors(this, play); func_80B9A6E8(this); @@ -205,7 +205,7 @@ void func_80B9A6E8(ObjMure2* this) { void func_80B9A6F8(ObjMure2* this, PlayState* play) { func_80B9A534(this); - if (CVarGetInteger("gDisableDrawDistance", 0) != 0) { + if (CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 0) != 0) { return; } diff --git a/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index 09ce9dff6..ae26db3ac 100644 --- a/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -568,9 +568,9 @@ void ObjOshihiki_Push(ObjOshihiki* this, PlayState* play) { f32 pushDistSigned; s32 stopFlag; - this->pushSpeed = this->pushSpeed + (CVarGetInteger("gFasterBlockPush", 0) * 0.25) + 0.5f; + this->pushSpeed = this->pushSpeed + (CVarGetInteger(CVAR_ENHANCEMENT("FasterBlockPush"), 0) * 0.25) + 0.5f; this->stateFlags |= PUSHBLOCK_PUSH; - this->pushSpeed = CLAMP_MAX(this->pushSpeed, 2.0f + (CVarGetInteger("gFasterBlockPush", 0) * 0.5)); + this->pushSpeed = CLAMP_MAX(this->pushSpeed, 2.0f + (CVarGetInteger(CVAR_ENHANCEMENT("FasterBlockPush"), 0) * 0.5)); stopFlag = Math_StepToF(&this->pushDist, 20.0f, this->pushSpeed); pushDistSigned = ((this->direction >= 0.0f) ? 1.0f : -1.0f) * this->pushDist; thisx->world.pos.x = thisx->home.pos.x + (pushDistSigned * this->yawSin); @@ -596,7 +596,7 @@ void ObjOshihiki_Push(ObjOshihiki* this, PlayState* play) { this->dyna.unk_150 = 0.0f; this->pushDist = 0.0f; this->pushSpeed = 0.0f; - this->timer = 10 - ((CVarGetInteger("gFasterBlockPush", 0) * 3) / 2); + this->timer = 10 - ((CVarGetInteger(CVAR_ENHANCEMENT("FasterBlockPush"), 0) * 3) / 2); if (this->floorBgIds[this->highestFloor] == BGCHECK_SCENE) { ObjOshihiki_SetupOnScene(this, play); } else { diff --git a/soh/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c b/soh/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c index 202bcc09f..4da1c3eba 100644 --- a/soh/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c +++ b/soh/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c @@ -34,7 +34,7 @@ void ObjRoomtimer_Init(Actor* thisx, PlayState* play) { // Shabom room in Jabu Jabu has a lengthened timer in Enemy Randomizer. Flag doesn't match what the game // expects. Instead set it back to the same flag as what it would be in vanilla. - if (CVarGetInteger("gRandomizedEnemies", 0) && play->sceneNum == SCENE_JABU_JABU && play->roomCtx.curRoom.num == 12) { + if (CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) && play->sceneNum == SCENE_JABU_JABU && play->roomCtx.curRoom.num == 12) { this->switchFlag = 30; } else { this->switchFlag = (params >> 10) & 0x3F; diff --git a/soh/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c b/soh/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c index 0076a6385..dfc236251 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c +++ b/soh/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c @@ -80,7 +80,7 @@ void OceffWipe_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx); - int fastOcarinaPlayback = (CVarGetInteger("gFastOcarinaPlayback", 0) != 0); + int fastOcarinaPlayback = (CVarGetInteger(CVAR_ENHANCEMENT("FastOcarinaPlayback"), 0) != 0); if (this->timer < 32) { z = Math_SinS(this->timer << 9) * (fastOcarinaPlayback ? 1200.0f : 1400.0f); } else { diff --git a/soh/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c b/soh/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c index 38014b5e2..a6b422062 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c +++ b/soh/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c @@ -72,7 +72,7 @@ void OceffWipe2_Draw(Actor* thisx, PlayState* play) { eye = GET_ACTIVE_CAM(play)->eye; Camera_GetSkyboxOffset(&vec, GET_ACTIVE_CAM(play)); - int fastOcarinaPlayback = (CVarGetInteger("gFastOcarinaPlayback", 0) != 0); + int fastOcarinaPlayback = (CVarGetInteger(CVAR_ENHANCEMENT("FastOcarinaPlayback"), 0) != 0); if (this->timer < 32) { z = Math_SinS(this->timer << 9) * (fastOcarinaPlayback ? 1200.0f : 1330.0f); } else { diff --git a/soh/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c b/soh/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c index df3fc1a87..28f02100d 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c +++ b/soh/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c @@ -73,7 +73,7 @@ void OceffWipe3_Draw(Actor* thisx, PlayState* play) { eye = GET_ACTIVE_CAM(play)->eye; Camera_GetSkyboxOffset(&vec, GET_ACTIVE_CAM(play)); - int fastOcarinaPlayback = (CVarGetInteger("gFastOcarinaPlayback", 0) != 0); + int fastOcarinaPlayback = (CVarGetInteger(CVAR_ENHANCEMENT("FastOcarinaPlayback"), 0) != 0); if (this->counter < 32) { z = Math_SinS(this->counter << 9) * (fastOcarinaPlayback ? 1200.0f : 1330.0f); } else { diff --git a/soh/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c b/soh/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c index 5a66b2991..6c96e639f 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c +++ b/soh/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c @@ -68,7 +68,7 @@ void OceffWipe4_Draw(Actor* thisx, PlayState* play) { eye = GET_ACTIVE_CAM(play)->eye; Camera_GetSkyboxOffset(&vec, GET_ACTIVE_CAM(play)); - int fastOcarinaPlayback = (CVarGetInteger("gFastOcarinaPlayback", 0) != 0); + int fastOcarinaPlayback = (CVarGetInteger(CVAR_ENHANCEMENT("FastOcarinaPlayback"), 0) != 0); if (this->timer < 16) { z = Math_SinS(this->timer * 1024) * (fastOcarinaPlayback ? 1200.0f : 1330.0f); } else { diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 834d9fb96..b90681120 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -2251,7 +2251,7 @@ void Player_ProcessItemButtons(Player* this, PlayState* play) { s32 i; if (this->currentMask != PLAYER_MASK_NONE) { - if (CVarGetInteger("gMMBunnyHood", BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA) { + if (CVarGetInteger(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA) { s32 maskItem = this->currentMask - PLAYER_MASK_KEATON + ITEM_MASK_KEATON; bool hasOnDpad = false; if (CVarGetInteger("gDpadEquips", 0) != 0) { @@ -2377,7 +2377,7 @@ void Player_StartChangingHeldItem(Player* this, PlayState* play) { } void Player_UpdateItems(Player* this, PlayState* play) { - if ((this->actor.category == ACTORCAT_PLAYER) && (CVarGetInteger("gQuickPutaway", 0) || !(this->stateFlags1 & PLAYER_STATE1_START_PUTAWAY)) && + if ((this->actor.category == ACTORCAT_PLAYER) && (CVarGetInteger(CVAR_ENHANCEMENT("QuickPutaway"), 0) || !(this->stateFlags1 & PLAYER_STATE1_START_PUTAWAY)) && ((this->heldItemAction == this->itemAction) || (this->stateFlags1 & PLAYER_STATE1_SHIELDING)) && (gSaveContext.health != 0) && (play->csCtx.state == CS_STATE_IDLE) && (this->csAction == 0) && (play->shootingGalleryStatus == 0) && (play->activeCamera == MAIN_CAM) && @@ -2393,7 +2393,7 @@ void Player_UpdateItems(Player* this, PlayState* play) { // Determine projectile type for bow or slingshot s32 func_80834380(PlayState* play, Player* this, s32* itemPtr, s32* typePtr) { bool useBow = LINK_IS_ADULT; - if(CVarGetInteger("gBowSlingShotAmmoFix", 0)){ + if(CVarGetInteger(CVAR_ENHANCEMENT("BowSlingshotAmmoFix"), 0)){ useBow = this->heldItemAction != PLAYER_IA_SLINGSHOT; } if (useBow) { @@ -2937,7 +2937,7 @@ s32 Player_UpperAction_CarryActor(Player* this, PlayState* play) { } void func_808357E8(Player* this, Gfx** dLists) { - if (LINK_IS_ADULT && (CVarGetInteger("gEnhancements.EquimentAlwaysVisible", 0))) { + if (LINK_IS_ADULT && (CVarGetInteger(CVAR_ENHANCEMENT("EquimentAlwaysVisible"), 0))) { this->leftHandDLists = &dLists[1]; } else { this->leftHandDLists = &dLists[gSaveContext.linkAge]; @@ -3021,7 +3021,7 @@ s32 func_808359FC(Player* this, PlayState* play) { } s32 spawn_boomerang_ivan(EnPartner* this, PlayState* play) { - if (!CVarGetInteger("gIvanCoopModeEnabled", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("IvanCoopModeEnabled"), 0)) { return 0; } @@ -3055,7 +3055,7 @@ s32 func_80835B60(Player* this, PlayState* play) { return 1; } - if (sUseHeldItem && CVarGetInteger("gFastBoomerang", 0)) { + if (sUseHeldItem && CVarGetInteger(CVAR_ENHANCEMENT("FastBoomerang"), 0)) { this->boomerangQuickRecall = true; } @@ -3179,7 +3179,7 @@ void Player_UseItem(PlayState* play, Player* this, s32 item) { ((itemAction == PLAYER_IA_MAGIC_BEAN) && (AMMO(ITEM_BEAN) == 0)) || (temp = Player_ActionToExplosive(this, itemAction), ((temp >= 0) && ((AMMO(sExplosiveInfos[temp].itemId) == 0) || - (play->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].length >= 3 && !CVarGetInteger("gRemoveExplosiveLimit", 0))))))) { + (play->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].length >= 3 && !CVarGetInteger(CVAR_ENHANCEMENT("RemoveExplosiveLimit"), 0))))))) { // Prevent some items from being used if player is out of ammo. // Also prevent explosives from being used if there are 3 or more active (outside of bombchu bowling) func_80078884(NA_SE_SY_ERROR); @@ -3241,7 +3241,7 @@ void Player_UseItem(PlayState* play, Player* this, s32 item) { (item != this->heldItemId) && (sItemChangeTypes[gPlayerModelTypes[this->modelGroup][PLAYER_MODELGROUPENTRY_ANIM]][nextAnimType] != PLAYER_ITEM_CHG_0) && - (!CVarGetInteger("gSeparateArrows", 0) || + (!CVarGetInteger(CVAR_ENHANCEMENT("SeparateArrows"), 0) || itemAction < PLAYER_IA_BOW || itemAction > PLAYER_IA_BOW_0E || this->heldItemAction < PLAYER_IA_BOW || this->heldItemAction > PLAYER_IA_BOW_0E)) { // Start the held item change process @@ -4038,7 +4038,7 @@ s32 func_80837B18_modified(PlayState* play, Player* this, s32 damage, u8 modifie s32 modifiedDamage = damage; if (modified) { - modifiedDamage *= (1 << CVarGetInteger("gDamageMul", 0)); + modifiedDamage *= (1 << CVarGetInteger(CVAR_ENHANCEMENT("DamageMult"), 0)); } return Health_ChangeBy(play, modifiedDamage); @@ -4263,7 +4263,7 @@ s32 func_808382DC(Player* this, PlayState* play) { if (this->unk_A86 != 0) { if (!Player_InBlockingCsMode(play, this)) { - Player_InflictDamageModified(play, -16 * (1 << CVarGetInteger("gVoidDamageMul", 0)), false); + Player_InflictDamageModified(play, -16 * (1 << CVarGetInteger(CVAR_ENHANCEMENT("VoidDamageMult"), 0)), false); this->unk_A86 = 0; } } else { @@ -5096,7 +5096,7 @@ void func_8083A0F4(PlayState* play, Player* this) { // Same actor is used for small and large silver rocks, use actor params to identify large ones bool isLargeSilverRock = interactActorId == ACTOR_EN_ISHI && interactRangeActor->params & 1 == 1; - if (CVarGetInteger("gFasterHeavyBlockLift", 0) && (isLargeSilverRock || interactActorId == ACTOR_BG_HEAVY_BLOCK)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 0) && (isLargeSilverRock || interactActorId == ACTOR_BG_HEAVY_BLOCK)) { LinkAnimation_PlayOnceSetSpeed(play, &this->skelAnime, anim, 5.0f); } else { LinkAnimation_PlayOnce(play, &this->skelAnime, anim); @@ -5355,7 +5355,7 @@ s32 func_8083AD4C(PlayState* play, Player* this) { if (func_8002DD6C(this)) { bool shouldUseBowCamera = LINK_IS_ADULT; - if(CVarGetInteger("gBowSlingShotAmmoFix", 0)){ + if(CVarGetInteger(CVAR_ENHANCEMENT("BowSlingshotAmmoFix"), 0)){ shouldUseBowCamera = this->heldItemAction != PLAYER_IA_SLINGSHOT; } @@ -5423,7 +5423,7 @@ void func_8083AF44(PlayState* play, Player* this, s32 magicSpell) { //! magic value, it will be consumed to zero. Magic_RequestChange(play, sMagicSpellCosts[magicSpell], MAGIC_CONSUME_WAIT_PREVIEW); - u8 isFastFarores = CVarGetInteger("gFastFarores", 0) && this->itemAction == PLAYER_IA_FARORES_WIND; + u8 isFastFarores = CVarGetInteger(CVAR_ENHANCEMENT("FastFarores"), 0) && this->itemAction == PLAYER_IA_FARORES_WIND; if (isFastFarores) { LinkAnimation_PlayOnceSetSpeed(play, &this->skelAnime, &gPlayerAnim_link_magic_tame, 0.83f * 2); @@ -6018,7 +6018,7 @@ s32 func_8083C6B8(PlayState* play, Player* this) { sp24 = this->actor.world.pos; sp24.y += 50.0f; - if (CVarGetInteger("gHoverFishing", 0) + if (CVarGetInteger(CVAR_ENHANCEMENT("HoverFishing"), 0) ? 0 : !(this->actor.bgCheckFlags & 1) || (this->actor.world.pos.z > 1300.0f) || BgCheck_SphVsFirstPoly(&play->colCtx, &sp24, 20.0f)) { @@ -6265,7 +6265,7 @@ s32 func_8083D12C(PlayState* play, Player* this, Input* arg2) { func_80832340(play, this); // Skip take breath animation on surface if Link didn't grab an item while underwater and the setting is enabled - if (CVarGetInteger("gSkipSwimDeepEndAnim", 0) && !(this->stateFlags1 & PLAYER_STATE1_ITEM_OVER_HEAD)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("SkipSwimDeepEndAnim"), 0) && !(this->stateFlags1 & PLAYER_STATE1_ITEM_OVER_HEAD)) { auto lastAnimFrame = Animation_GetLastFrame(&gPlayerAnim_link_swimer_swim_deep_end); LinkAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_swimer_swim_deep_end, 1.0f, lastAnimFrame, lastAnimFrame, ANIMMODE_ONCE, -6.0f); @@ -6547,7 +6547,7 @@ void func_8083DFE0(Player* this, f32* arg1, s16* arg2) { } } - if (CVarGetInteger("gMMBunnyHood", BUNNY_HOOD_VANILLA) == BUNNY_HOOD_FAST_AND_JUMP && this->currentMask == PLAYER_MASK_BUNNY) { + if (CVarGetInteger(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_VANILLA) == BUNNY_HOOD_FAST_AND_JUMP && this->currentMask == PLAYER_MASK_BUNNY) { maxSpeed *= 1.5f; } @@ -6751,7 +6751,7 @@ s32 Player_ActionChange_2(Player* this, PlayState* play) { if(gSaveContext.pendingIceTrapCount) { gSaveContext.pendingIceTrapCount--; GameInteractor_ExecuteOnItemReceiveHooks(ItemTable_RetrieveEntry(MOD_RANDOMIZER, RG_ICE_TRAP)); - if (CVarGetInteger("gAddTraps.enabled", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("ExtraTraps.Enabled"), 0)) { return 1; } this->stateFlags1 &= ~(PLAYER_STATE1_GETTING_ITEM | PLAYER_STATE1_ITEM_OVER_HEAD); @@ -6805,7 +6805,7 @@ s32 Player_ActionChange_2(Player* this, PlayState* play) { // Skip cutscenes from picking up consumables with "Fast Pickup Text" enabled, even when the player never picked it up before. // But only for bushes/rocks/enemies because otherwise it can lead to softlocks in deku mask theatre and potentially other places. - uint8_t skipItemCutscene = CVarGetInteger("gFastDrops", 0) && isDropToSkip; + uint8_t skipItemCutscene = CVarGetInteger(CVAR_ENHANCEMENT("FastDrops"), 0) && isDropToSkip; // Same as above but for rando. Rando is different because we want to enable cutscenes for items that the player already has because // those items could be a randomized item coming from scrubs, freestanding PoH's and keys. So we need to once again overrule @@ -6844,7 +6844,7 @@ s32 Player_ActionChange_2(Player* this, PlayState* play) { giEntry = this->getItemEntry; } EnBox* chest = (EnBox*)interactedActor; - if (CVarGetInteger("gFastChests", 0) != 0) { + if (CVarGetInteger(CVAR_ENHANCEMENT("FastChests"), 0) != 0) { giEntry.gi = -1 * abs(giEntry.gi); } @@ -7129,10 +7129,10 @@ s32 Player_TryEnteringCrawlspace(Player* this, PlayState* play, u32 interactWall func_80832224(this); this->actor.prevPos = this->actor.world.pos; // #region SOH [Enhancement] - if (CVarGetInteger("gCrawlSpeed", 1) > 1) { + if (CVarGetInteger(CVAR_ENHANCEMENT("CrawlSpeed"), 1) > 1) { // increase animation speed when entering a tunnel LinkAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_child_tunnel_start, - ((CVarGetInteger("gCrawlSpeed", 1) + 1.0f) / 2.0f), 0.0f, + ((CVarGetInteger(CVAR_ENHANCEMENT("CrawlSpeed"), 1) + 1.0f) / 2.0f), 0.0f, Animation_GetLastFrame(&gPlayerAnim_link_child_tunnel_start), ANIMMODE_ONCE, 0.0f); Player_AnimReplaceApplyFlags(play, this, 0x9D); @@ -7222,10 +7222,10 @@ s32 Player_TryLeavingCrawlspace(Player* this, PlayState* play) { if (this->linearVelocity > 0.0f) { this->actor.shape.rot.y = this->actor.wallYaw + 0x8000; // #region SOH [Enhancement] - if (CVarGetInteger("gCrawlSpeed", 1) > 1) { + if (CVarGetInteger(CVAR_ENHANCEMENT("CrawlSpeed"), 1) > 1) { // animation when exiting a tunnel forward LinkAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_child_tunnel_end, - ((CVarGetInteger("gCrawlSpeed", 1) + 1.0f) / 2.0f), 0.0f, + ((CVarGetInteger(CVAR_ENHANCEMENT("CrawlSpeed"), 1) + 1.0f) / 2.0f), 0.0f, Animation_GetLastFrame(&gPlayerAnim_link_child_tunnel_end), ANIMMODE_ONCE, 0.0f); Player_AnimReplaceApplyFlags(play, this, 0x9D); @@ -7240,9 +7240,9 @@ s32 Player_TryLeavingCrawlspace(Player* this, PlayState* play) { this->actor.shape.rot.y = this->actor.wallYaw; // #region SOH [Enhancement] // animation when exiting a tunnel backward - if (CVarGetInteger("gCrawlSpeed",1) > 1) { + if (CVarGetInteger(CVAR_ENHANCEMENT("CrawlSpeed"),1) > 1) { LinkAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_child_tunnel_start, - -1.0f * ((CVarGetInteger("gCrawlSpeed", 1) + 1.0f) / 2.0f), + -1.0f * ((CVarGetInteger(CVAR_ENHANCEMENT("CrawlSpeed"), 1) + 1.0f) / 2.0f), Animation_GetLastFrame(&gPlayerAnim_link_child_tunnel_start), 0.0f, ANIMMODE_ONCE, 0.0f); Player_AnimReplaceApplyFlags(play, this, 0x9D); OnePointCutscene_Init(play, 9602, 999, NULL, MAIN_CAM); @@ -7547,9 +7547,9 @@ void func_8084029C(Player* this, f32 arg1) { } if ((this->currentBoots == PLAYER_BOOTS_HOVER || - (CVarGetInteger("gIvanCoopModeEnabled", 0) && this->ivanFloating)) && + (CVarGetInteger(CVAR_ENHANCEMENT("IvanCoopModeEnabled"), 0) && this->ivanFloating)) && !(this->actor.bgCheckFlags & 1) && - (this->hoverBootsTimer != 0 || (CVarGetInteger("gIvanCoopModeEnabled", 0) && this->ivanFloating))) { + (this->hoverBootsTimer != 0 || (CVarGetInteger(CVAR_ENHANCEMENT("IvanCoopModeEnabled"), 0) && this->ivanFloating))) { func_8002F8F0(&this->actor, NA_SE_PL_HOBBERBOOTS_LV - SFX_FLAG); } else if (func_8084021C(this->unk_868, arg1, 29.0f, 10.0f) || func_8084021C(this->unk_868, arg1, 29.0f, 24.0f)) { func_808327F8(this, this->linearVelocity); @@ -7742,7 +7742,7 @@ void func_808409CC(PlayState* play, Player* this) { if (sp34 < 4) { if (((sp34 != 0) && (sp34 != 3)) || ((this->rightHandType == PLAYER_MODELTYPE_RH_SHIELD) && ((sp34 == 3) || Player_GetMeleeWeaponHeld(this)))) { - if ((sp34 == 1) && Player_HoldsTwoHandedWeapon(this) && CVarGetInteger("gTwoHandedIdle", 0) == 1) { + if ((sp34 == 1) && Player_HoldsTwoHandedWeapon(this) && CVarGetInteger(CVAR_ENHANCEMENT("TwoHandedIdle"), 0) == 1) { sp34 = 4; } sp38 = sp34 + 9; @@ -8285,7 +8285,7 @@ void Player_Action_80842180(Player* this, PlayState* play) { } } - if (CVarGetInteger("gMMBunnyHood", BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA && this->currentMask == PLAYER_MASK_BUNNY) { + if (CVarGetInteger(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA && this->currentMask == PLAYER_MASK_BUNNY) { sp2C *= 1.5f; } @@ -8462,7 +8462,7 @@ s32 func_808428D8(Player* this, PlayState* play) { this->meleeWeaponAnimation = PLAYER_MWA_STAB_1H; this->yaw = this->actor.shape.rot.y + this->unk_6BE; - if (!CVarGetInteger("gCrouchStabHammerFix", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("CrouchStabHammerFix"), 0)) { return 1; } @@ -8473,7 +8473,7 @@ s32 func_808428D8(Player* this, PlayState* play) { swordId = Player_GetMeleeWeaponHeld(this) - 1; } - if (swordId != 4 && !CVarGetInteger("gCrouchStabFix", 0)) { // 4 = Megaton Hammer + if (swordId != 4 && !CVarGetInteger(CVAR_ENHANCEMENT("CrouchStabFix"), 0)) { // 4 = Megaton Hammer return 1; } @@ -8907,12 +8907,12 @@ void func_80843AE8(PlayState* play, Player* this) { LinkAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_derth_rebirth, 1.0f, 99.0f, Animation_GetLastFrame(&gPlayerAnim_link_derth_rebirth), ANIMMODE_ONCE, 0.0f); } - if (CVarGetInteger("gFairyReviveEffect", 0)) { - if (CVarGetInteger("gFairyRevivePercentRestore", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("FairyReviveEffect"), 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("FairyRevivePercentRestore"), 0)) { gSaveContext.healthAccumulator = - (gSaveContext.healthCapacity * CVarGetInteger("gFairyReviveHealth", 100) / 100 + 15) / 16 * 16; + (gSaveContext.healthCapacity * CVarGetInteger(CVAR_ENHANCEMENT("FairyReviveHealth"), 100) / 100 + 15) / 16 * 16; } else { - gSaveContext.healthAccumulator = CVarGetInteger("gFairyReviveHealth", 20) * 16; + gSaveContext.healthAccumulator = CVarGetInteger(CVAR_ENHANCEMENT("FairyReviveHealth"), 20) * 16; } } else { gSaveContext.healthAccumulator = 0x140; @@ -9013,7 +9013,7 @@ s32 func_80843E64(PlayState* play, Player* this) { impactInfo = &D_80854600[impactIndex]; - if (Player_InflictDamageModified(play, impactInfo->damage * (1 << CVarGetInteger("gFallDamageMul", 0)), + if (Player_InflictDamageModified(play, impactInfo->damage * (1 << CVarGetInteger(CVAR_ENHANCEMENT("FallDamageMult"), 0)), false)) { return -1; } @@ -9833,7 +9833,7 @@ void Player_Action_80846120(Player* this, PlayState* play) { if (LinkAnimation_OnFrame(&this->skelAnime, 229.0f)) { Actor* heldActor = this->heldActor; - if (CVarGetInteger("gFasterHeavyBlockLift", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 0)) { // This is the difference in rotation when the animation is sped up 5x heldActor->shape.rot.x -= 3510; } @@ -9932,7 +9932,7 @@ void Player_Action_808464B0(Player* this, PlayState* play) { heldActor->velocity.y = 0.0f; heldActor->speedXZ = 0.0f; func_80834644(play, this); - if (heldActor->id == ACTOR_EN_BOM_CHU && !CVarGetInteger("gDisableFirstPersonChus", 0)) { + if (heldActor->id == ACTOR_EN_BOM_CHU && !CVarGetInteger(CVAR_ENHANCEMENT("DisableFirstPersonChus"), 0)) { func_8083B8F4(this, play); } } @@ -10190,7 +10190,7 @@ void Player_Init(Actor* thisx, PlayState* play2) { Player_UseItem(play, this, ITEM_NONE); Player_SetEquipmentData(play, this); this->prevBoots = this->currentBoots; - if (CVarGetInteger("gMMBunnyHood", BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA) { + if (CVarGetInteger(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA) { if (INV_CONTENT(ITEM_TRADE_CHILD) == ITEM_SOLD_OUT) { sMaskMemory = PLAYER_MASK_NONE; } @@ -10446,7 +10446,7 @@ void func_808473D4(PlayState* play, Player* this) { if (doAction != DO_ACTION_PUTAWAY) { this->unk_837 = 20; } else if (this->unk_837 != 0) { - if (CVarGetInteger("gInstantPutaway", 0) != 0) { + if (CVarGetInteger(CVAR_ENHANCEMENT("InstantPutaway"), 0) != 0) { this->unk_837 = 0; } else { doAction = DO_ACTION_NONE; @@ -10483,7 +10483,7 @@ s32 Player_UpdateHoverBoots(Player* this) { s32 cond; if ((this->currentBoots == PLAYER_BOOTS_HOVER || - (CVarGetInteger("gIvanCoopModeEnabled", 0) && this->ivanFloating)) && + (CVarGetInteger(CVAR_ENHANCEMENT("IvanCoopModeEnabled"), 0) && this->ivanFloating)) && (this->hoverBootsTimer != 0)) { this->hoverBootsTimer--; } else { @@ -10491,7 +10491,7 @@ s32 Player_UpdateHoverBoots(Player* this) { } cond = (this->currentBoots == PLAYER_BOOTS_HOVER || - (CVarGetInteger("gIvanCoopModeEnabled", 0) && this->ivanFloating)) && + (CVarGetInteger(CVAR_ENHANCEMENT("IvanCoopModeEnabled"), 0) && this->ivanFloating)) && ((this->actor.yDistToWater >= 0.0f) || (func_80838144(sFloorType) >= 0) || func_8083816C(sFloorType)); if (cond && (this->actor.bgCheckFlags & 1) && (this->hoverBootsTimer != 0)) { @@ -10654,7 +10654,7 @@ void Player_ProcessSceneCollision(PlayState* play, Player* this) { sTouchedWallFlags = func_80041DB8(&play->colCtx, this->actor.wallPoly, this->actor.wallBgId); // conflicts arise from these two being enabled at once, and with ClimbEverything on, FixVineFall is redundant anyway - if (CVarGetInteger("gFixVineFall", 0) && !CVarGetInteger(CVAR_CHEAT("ClimbEverything"), 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("FixVineFall"), 0) && !CVarGetInteger(CVAR_CHEAT("ClimbEverything"), 0)) { /* This fixes the "started climbing a wall and then immediately fell off" bug. * The main idea is if a climbing wall is detected, double-check that it will * still be valid once climbing begins by doing a second raycast with a small @@ -11073,7 +11073,7 @@ void func_80848EF8(Player* this, PlayState* play) { if (CVarGetInteger("gCosmetics.Hud_StoneOfAgony.Changed", 0)) { stoneOfAgonyColor = CVarGetColor24("gCosmetics.Hud_StoneOfAgony.Value", stoneOfAgonyColor); } - if (CVarGetInteger("gVisualAgony", 0) && !this->stateFlags1 && !GameInteractor_NoUIActive()) { + if (CVarGetInteger(CVAR_ENHANCEMENT("VisualAgony"), 0) && !this->stateFlags1 && !GameInteractor_NoUIActive()) { s16 Top_Margins = (CVarGetInteger("gHUDMargin_T", 0) * -1); s16 Left_Margins = CVarGetInteger("gHUDMargin_L", 0); s16 Right_Margins = CVarGetInteger("gHUDMargin_R", 0); @@ -11157,7 +11157,7 @@ void func_80848EF8(Player* this, PlayState* play) { if (this->unk_6A0 > 4000000.0f) { this->unk_6A0 = 0.0f; - if (CVarGetInteger("gVisualAgony", 0) && !this->stateFlags1 && !GameInteractor_NoUIActive()) { + if (CVarGetInteger(CVAR_ENHANCEMENT("VisualAgony"), 0) && !this->stateFlags1 && !GameInteractor_NoUIActive()) { // This audio is placed here and not in previous CVar check to prevent ears ra.. :) Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E0); } @@ -11627,7 +11627,7 @@ void Player_Update(Actor* thisx, PlayState* play) { if (func_8084FCAC(this, play)) { if (gSaveContext.dogParams < 0) { // Disable object dependency to prevent losing dog in scenes other than market - if (Object_GetIndex(&play->objectCtx, OBJECT_DOG) < 0 && !CVarGetInteger("gDogFollowsEverywhere", 0)) { + if (Object_GetIndex(&play->objectCtx, OBJECT_DOG) < 0 && !CVarGetInteger(CVAR_ENHANCEMENT("DogFollowsEverywhere"), 0)) { gSaveContext.dogParams = 0; } else { gSaveContext.dogParams &= 0x7FFF; @@ -11638,7 +11638,7 @@ void Player_Update(Actor* thisx, PlayState* play) { sDogSpawnPos.z, 0, this->actor.shape.rot.y, 0, dogParams | 0x8000, true); if (dog != NULL) { // Room -1 allows actor to cross between rooms, similar to Navi - dog->room = CVarGetInteger("gDogFollowsEverywhere", 0) ? -1 : 0; + dog->room = CVarGetInteger(CVAR_ENHANCEMENT("DogFollowsEverywhere"), 0) ? -1 : 0; } } } @@ -11799,7 +11799,7 @@ void Player_DrawGameplay(PlayState* play, Player* this, s32 lod, Gfx* cullDList, } - if (this->currentMask != PLAYER_MASK_BUNNY || !CVarGetInteger("gHideBunnyHood", 0)) { + if (this->currentMask != PLAYER_MASK_BUNNY || !CVarGetInteger(CVAR_ENHANCEMENT("HideBunnyHood"), 0)) { gSPDisplayList(POLY_OPA_DISP++, sMaskDlists[this->currentMask - 1]); } @@ -11807,7 +11807,7 @@ void Player_DrawGameplay(PlayState* play, Player* this, s32 lod, Gfx* cullDList, } if ((this->currentBoots == PLAYER_BOOTS_HOVER || - (CVarGetInteger("gIvanCoopModeEnabled", 0) && this->ivanFloating)) && + (CVarGetInteger(CVAR_ENHANCEMENT("IvanCoopModeEnabled"), 0) && this->ivanFloating)) && !(this->actor.bgCheckFlags & 1) && !(this->stateFlags1 & PLAYER_STATE1_ON_HORSE) && (this->hoverBootsTimer != 0)) { s32 sp5C; @@ -11892,7 +11892,7 @@ void Player_Draw(Actor* thisx, PlayState* play2) { lod = 1; } - if (CVarGetInteger("gDisableLOD", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("DisableLOD"), 0)) { lod = 0; } @@ -12072,7 +12072,7 @@ s16 func_8084ABD8(PlayState* play, Player* this, s32 arg2, s16 arg3) { if (CVarGetInteger("gMoveWhileFirstPerson", 0)) { f32 movementSpeed = LINK_IS_ADULT ? 9.0f : 8.25f; - if (CVarGetInteger("gMMBunnyHood", BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA && this->currentMask == PLAYER_MASK_BUNNY) { + if (CVarGetInteger(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA && this->currentMask == PLAYER_MASK_BUNNY) { movementSpeed *= 1.5f; } @@ -12296,7 +12296,7 @@ s32 func_8084B3CC(PlayState* play, Player* this) { if (!func_8002DD6C(this) || Player_HoldsHookshot(this)) { s32 projectileItemToUse = ITEM_BOW; - if(CVarGetInteger("gBowSlingShotAmmoFix", 0)){ + if(CVarGetInteger(CVAR_ENHANCEMENT("BowSlingshotAmmoFix"), 0)){ projectileItemToUse = LINK_IS_ADULT ? ITEM_BOW : ITEM_SLINGSHOT; } @@ -12637,7 +12637,7 @@ void Player_Action_8084BF1C(Player* this, PlayState* play) { phi_f2 = -1.0f; } - this->skelAnime.playSpeed = phi_f2 * phi_f0 + phi_f2 * CVarGetInteger("gClimbSpeed", 0); + this->skelAnime.playSpeed = phi_f2 * phi_f0 + phi_f2 * CVarGetInteger(CVAR_ENHANCEMENT("ClimbSpeed"), 0); if (this->av2.actionVar2 >= 0) { if ((this->actor.wallPoly != NULL) && (this->actor.wallBgId != BGCHECK_SCENE)) { @@ -12810,8 +12810,8 @@ void Player_Action_8084C760(Player* this, PlayState* play) { // player speed in a tunnel if (!Player_TryLeavingCrawlspace(this, play)) { // #region SOH [Enhancement] - if (CVarGetInteger("gCrawlSpeed", 1) > 1) { - this->linearVelocity = sControlInput->rel.stick_y * 0.03f * CVarGetInteger("gCrawlSpeed", 1); + if (CVarGetInteger(CVAR_ENHANCEMENT("CrawlSpeed"), 1) > 1) { + this->linearVelocity = sControlInput->rel.stick_y * 0.03f * CVarGetInteger(CVAR_ENHANCEMENT("CrawlSpeed"), 1); // #endregion } else { this->linearVelocity = sControlInput->rel.stick_y * 0.03f; @@ -13462,7 +13462,7 @@ s32 func_8084DFF4(PlayState* play, Player* this) { } this->av1.actionVar1 = 1; equipItem = giEntry.itemId; - equipNow = CVarGetInteger("gAskToEquip", 0) && giEntry.modIndex == MOD_NONE && + equipNow = CVarGetInteger(CVAR_ENHANCEMENT("AskToEquip"), 0) && giEntry.modIndex == MOD_NONE && equipItem >= ITEM_SWORD_KOKIRI && equipItem <= ITEM_TUNIC_ZORA && CHECK_AGE_REQ_ITEM(equipItem); @@ -13836,29 +13836,29 @@ void Player_Action_8084EAC0(Player* this, PlayState* play) { } else { s32 sp28 = D_808549FC[this->itemAction - PLAYER_IA_BOTTLE_POTION_RED]; - if (CVarGetInteger("gRedPotionEffect", 0) && this->itemAction == PLAYER_IA_BOTTLE_POTION_RED) { - if (CVarGetInteger("gRedPercentRestore", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("RedPotionEffect"), 0) && this->itemAction == PLAYER_IA_BOTTLE_POTION_RED) { + if (CVarGetInteger(CVAR_ENHANCEMENT("RedPercentRestore"), 0)) { gSaveContext.healthAccumulator = - (gSaveContext.healthCapacity * CVarGetInteger("gRedPotionHealth", 100) / 100 + 15) / 16 * 16; + (gSaveContext.healthCapacity * CVarGetInteger(CVAR_ENHANCEMENT("RedPotionHealth"), 100) / 100 + 15) / 16 * 16; } else { - gSaveContext.healthAccumulator = CVarGetInteger("gRedPotionHealth", 20) * 16; + gSaveContext.healthAccumulator = CVarGetInteger(CVAR_ENHANCEMENT("RedPotionHealth"), 20) * 16; } - } else if (CVarGetInteger("gBluePotionEffects", 0) && + } else if (CVarGetInteger(CVAR_ENHANCEMENT("BluePotionEffects"), 0) && this->itemAction == PLAYER_IA_BOTTLE_POTION_BLUE) { - if (CVarGetInteger("gBlueHealthPercentRestore", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("BlueHealthPercentRestore"), 0)) { gSaveContext.healthAccumulator = - (gSaveContext.healthCapacity * CVarGetInteger("gBluePotionHealth", 100) / 100 + 15) / 16 * 16; + (gSaveContext.healthCapacity * CVarGetInteger(CVAR_ENHANCEMENT("BluePotionHealth"), 100) / 100 + 15) / 16 * 16; } else { - gSaveContext.healthAccumulator = CVarGetInteger("gBluePotionHealth", 20) * 16; + gSaveContext.healthAccumulator = CVarGetInteger(CVAR_ENHANCEMENT("BluePotionHealth"), 20) * 16; } - if (CVarGetInteger("gBlueManaPercentRestore", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("BlueManaPercentRestore"), 0)) { if (gSaveContext.magicState != MAGIC_STATE_ADD) { Magic_Fill(play); } Magic_RequestChange(play, - (gSaveContext.magicLevel * 48 * CVarGetInteger("gBluePotionMana", 100) / 100 + 15) / + (gSaveContext.magicLevel * 48 * CVarGetInteger(CVAR_ENHANCEMENT("BluePotionMana"), 100) / 100 + 15) / 16 * 16, MAGIC_ADD); } else { @@ -13866,18 +13866,18 @@ void Player_Action_8084EAC0(Player* this, PlayState* play) { Magic_Fill(play); } - Magic_RequestChange(play, CVarGetInteger("gBluePotionMana", 100), MAGIC_ADD); + Magic_RequestChange(play, CVarGetInteger(CVAR_ENHANCEMENT("BluePotionMana"), 100), MAGIC_ADD); ; } - } else if (CVarGetInteger("gGreenPotionEffect", 0) && + } else if (CVarGetInteger(CVAR_ENHANCEMENT("GreenPotionEffect"), 0) && this->itemAction == PLAYER_IA_BOTTLE_POTION_GREEN) { - if (CVarGetInteger("gGreenPercentRestore", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("GreenPercentRestore"), 0)) { if (gSaveContext.magicState != MAGIC_STATE_ADD) { Magic_Fill(play); } Magic_RequestChange(play, - (gSaveContext.magicLevel * 48 * CVarGetInteger("gGreenPotionMana", 100) / 100 + 15) / + (gSaveContext.magicLevel * 48 * CVarGetInteger(CVAR_ENHANCEMENT("GreenPotionMana"), 100) / 100 + 15) / 16 * 16, MAGIC_ADD); } else { @@ -13885,25 +13885,25 @@ void Player_Action_8084EAC0(Player* this, PlayState* play) { Magic_Fill(play); } - Magic_RequestChange(play, CVarGetInteger("gGreenPotionMana", 100), MAGIC_ADD); + Magic_RequestChange(play, CVarGetInteger(CVAR_ENHANCEMENT("GreenPotionMana"), 100), MAGIC_ADD); ; } - } else if (CVarGetInteger("gMilkEffect", 0) && (this->itemAction == PLAYER_IA_BOTTLE_MILK_FULL || + } else if (CVarGetInteger(CVAR_ENHANCEMENT("MilkEffect"), 0) && (this->itemAction == PLAYER_IA_BOTTLE_MILK_FULL || this->itemAction == PLAYER_IA_BOTTLE_MILK_HALF)) { - if (CVarGetInteger("gMilkPercentRestore", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("MilkPercentRestore"), 0)) { gSaveContext.healthAccumulator = - (gSaveContext.healthCapacity * CVarGetInteger("gMilkHealth", 100) / 100 + 15) / 16 * 16; + (gSaveContext.healthCapacity * CVarGetInteger(CVAR_ENHANCEMENT("MilkHealth"), 100) / 100 + 15) / 16 * 16; } else { - gSaveContext.healthAccumulator = CVarGetInteger("gMilkHealth", 5) * 16; + gSaveContext.healthAccumulator = CVarGetInteger(CVAR_ENHANCEMENT("MilkHealth"), 5) * 16; } - if (CVarGetInteger("gSeparateHalfMilkEffect", 0) && + if (CVarGetInteger(CVAR_ENHANCEMENT("SeparateHalfMilkEffect"), 0) && this->itemAction == PLAYER_IA_BOTTLE_MILK_HALF) { - if (CVarGetInteger("gHalfMilkPercentRestore", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("HalfMilkPercentRestore"), 0)) { gSaveContext.healthAccumulator = - (gSaveContext.healthCapacity * CVarGetInteger("gHalfMilkHealth", 100) / 100 + 15) / 16 * + (gSaveContext.healthCapacity * CVarGetInteger(CVAR_ENHANCEMENT("HalfMilkHealth"), 100) / 100 + 15) / 16 * 16; } else { - gSaveContext.healthAccumulator = CVarGetInteger("gHalfMilkHealth", 5) * 16; + gSaveContext.healthAccumulator = CVarGetInteger(CVAR_ENHANCEMENT("HalfMilkHealth"), 5) * 16; } } } else { @@ -13959,7 +13959,7 @@ void Player_Action_8084ECA4(Player* this, PlayState* play) { if (LinkAnimation_Update(play, &this->skelAnime)) { if (this->av1.actionVar1 != 0) { if (this->av2.actionVar2 == 0) { - if (CVarGetInteger("gFastDrops", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("FastDrops"), 0)) { this->av1.actionVar1 = 0; } else { Message_StartTextbox(play, D_80854A04[this->av1.actionVar1 - 1].textId, &this->actor); @@ -13998,7 +13998,7 @@ void Player_Action_8084ECA4(Player* this, PlayState* play) { this->av2.actionVar2 = 0; this->interactRangeActor->parent = &this->actor; Player_UpdateBottleHeld(play, this, catchInfo->itemId, ABS(catchInfo->itemAction)); - if (!CVarGetInteger("gFastDrops", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("FastDrops"), 0)) { this->stateFlags1 |= PLAYER_STATE1_IN_ITEM_CS | PLAYER_STATE1_IN_CUTSCENE; Player_AnimPlayOnceAdjusted(play, this, sp24->unk_04); func_80835EA4(play, 4); @@ -14033,12 +14033,12 @@ void Player_Action_8084EED8(Player* this, PlayState* play) { Player_PlaySfx(this, NA_SE_EV_BOTTLE_CAP_OPEN); Player_PlaySfx(this, NA_SE_EV_FIATY_HEAL - SFX_FLAG); } else if (LinkAnimation_OnFrame(&this->skelAnime, 47.0f)) { - if (CVarGetInteger("gFairyEffect", 0)) { - if (CVarGetInteger("gFairyPercentRestore", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("FairyEffect"), 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("FairyPercentRestore"), 0)) { gSaveContext.healthAccumulator = - (gSaveContext.healthCapacity * CVarGetInteger("gFairyHealth", 100) / 100 + 15) / 16 * 16; + (gSaveContext.healthCapacity * CVarGetInteger(CVAR_ENHANCEMENT("FairyHealth"), 100) / 100 + 15) / 16 * 16; } else { - gSaveContext.healthAccumulator = CVarGetInteger("gFairyHealth", 8) * 16; + gSaveContext.healthAccumulator = CVarGetInteger(CVAR_ENHANCEMENT("FairyHealth"), 8) * 16; } } else { gSaveContext.healthAccumulator = 0x140; @@ -14695,7 +14695,7 @@ static AnimSfxEntry D_80854A8C[][2] = { }; void Player_Action_808507F4(Player* this, PlayState* play) { - u8 isFastFarores = CVarGetInteger("gFastFarores", 0) && this->itemAction == PLAYER_IA_FARORES_WIND; + u8 isFastFarores = CVarGetInteger(CVAR_ENHANCEMENT("FastFarores"), 0) && this->itemAction == PLAYER_IA_FARORES_WIND; if (LinkAnimation_Update(play, &this->skelAnime)) { if (this->av1.actionVar1 < 0) { if ((this->itemAction == PLAYER_IA_NAYRUS_LOVE) || isFastFarores || (gSaveContext.magicState == MAGIC_STATE_IDLE)) { @@ -15890,7 +15890,7 @@ void func_80852C50(PlayState* play, Player* this, CsCmdActorAction* arg2) { sp24 = D_808547C4[this->cueId]; func_80852B4C(play, this, linkCsAction, &D_80854E50[ABS(sp24)]); - if (CVarGetInteger("gFixEyesOpenWhileSleeping", 0) && (play->csCtx.linkAction->action == 28 || play->csCtx.linkAction->action == 29)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("FixEyesOpenWhileSleeping"), 0) && (play->csCtx.linkAction->action == 28 || play->csCtx.linkAction->action == 29)) { this->skelAnime.jointTable[22].x = 8; } } diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c b/soh/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c index a1a46f6de..85c585462 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c @@ -222,7 +222,7 @@ static void draw_ico_sphere(Gfx** p_gfx_p, f32 x, f32 y, f32 z, f32 radius, Grap } void EffectSsSolderSrchBall_Draw(PlayState* play, u32 index, EffectSs* this) { - if (CVarGetInteger("gGuardVision", 0) == 0) { + if (CVarGetInteger(CVAR_ENHANCEMENT("GuardVision"), 0) == 0) { return; } diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index 327c1dd11..0517bfab6 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -1318,10 +1318,10 @@ void FileChoose_UpdateQuestMenu(GameState* thisx) { this->kbdY = 0; this->charIndex = 0; this->charBgAlpha = 0; - this->newFileNameCharCount = CVarGetInteger("gLinkDefaultName", 0) ? 4 : 0; + this->newFileNameCharCount = CVarGetInteger(CVAR_ENHANCEMENT("LinkDefaultName"), 0) ? 4 : 0; this->nameEntryBoxPosX = 120; this->nameEntryBoxAlpha = 0; - memcpy(Save_GetSaveMetaInfo(this->buttonIndex)->playerName, CVarGetInteger("gLinkDefaultName", 0) ? &linkName : &emptyName, 8); + memcpy(Save_GetSaveMetaInfo(this->buttonIndex)->playerName, CVarGetInteger(CVAR_ENHANCEMENT("LinkDefaultName"), 0) ? &linkName : &emptyName, 8); return; } } @@ -2005,7 +2005,7 @@ void FileChoose_DrawFileInfo(GameState* thisx, s16 fileIndex, s16 isActive) { &deathCountSplit[2]); // draw death count - if (CVarGetInteger("gFileSelectMoreInfo", 0) == 0 || this->menuMode != FS_MENU_MODE_SELECT) { + if (CVarGetInteger(CVAR_ENHANCEMENT("FileSelectMoreInfo"), 0) == 0 || this->menuMode != FS_MENU_MODE_SELECT) { for (i = 0, vtxOffset = 0; i < 3; i++, vtxOffset += 4) { FileChoose_DrawCharacter(this->state.gfxCtx, sp54->fontBuf + deathCountSplit[i] * FONT_CHAR_TEX_SIZE, vtxOffset); @@ -2029,7 +2029,7 @@ void FileChoose_DrawFileInfo(GameState* thisx, s16 fileIndex, s16 isActive) { i = Save_GetSaveMetaInfo(fileIndex)->healthCapacity / 0x10; - if (CVarGetInteger("gFileSelectMoreInfo", 0) == 0 || this->menuMode != FS_MENU_MODE_SELECT) { + if (CVarGetInteger(CVAR_ENHANCEMENT("FileSelectMoreInfo"), 0) == 0 || this->menuMode != FS_MENU_MODE_SELECT) { // draw hearts for (vtxOffset = 0, j = 0; j < i; j++, vtxOffset += 4) { gSPVertex(POLY_OPA_DISP++, &this->windowContentVtx[D_8081284C[fileIndex] + vtxOffset] + 0x30, 4, 0); @@ -2046,7 +2046,7 @@ void FileChoose_DrawFileInfo(GameState* thisx, s16 fileIndex, s16 isActive) { textAlpha = 255; } - if (CVarGetInteger("gFileSelectMoreInfo", 0) != 0 && this->menuMode == FS_MENU_MODE_SELECT) { + if (CVarGetInteger(CVAR_ENHANCEMENT("FileSelectMoreInfo"), 0) != 0 && this->menuMode == FS_MENU_MODE_SELECT) { DrawMoreInfo(this, fileIndex, textAlpha); } else { // draw quest items @@ -2336,7 +2336,7 @@ void FileChoose_DrawWindowContents(GameState* thisx) { this->fileInfoAlpha[fileIndex]); // Draw the small file name box instead when more meta info is enabled - if (CVarGetInteger("gFileSelectMoreInfo", 0) != 0 && this->menuMode == FS_MENU_MODE_SELECT) { + if (CVarGetInteger(CVAR_ENHANCEMENT("FileSelectMoreInfo"), 0) != 0 && this->menuMode == FS_MENU_MODE_SELECT) { // Location of file 1 small name box vertices gSPVertex(POLY_OPA_DISP++, &this->windowContentVtx[68], 4, 0); @@ -2976,7 +2976,7 @@ void FileChoose_LoadGame(GameState* thisx) { gSaveContext.seqId = (u8)NA_BGM_DISABLED; gSaveContext.natureAmbienceId = 0xFF; gSaveContext.showTitleCard = true; - if (!CVarGetInteger("gDogFollowsEverywhere", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("DogFollowsEverywhere"), 0)) { gSaveContext.dogParams = 0; } gSaveContext.timer1State = 0; @@ -3282,7 +3282,7 @@ void FileChoose_Main(GameState* thisx) { sWindowContentColors[0][2] = 255; } - if (CVarGetInteger("gTimeFlowFileSelect", 0) != 0) { + if (CVarGetInteger(CVAR_ENHANCEMENT("TimeFlowFileSelect"), 0) != 0) { gSaveContext.skyboxTime += 0x10; } diff --git a/soh/src/overlays/gamestates/ovl_title/z_title.c b/soh/src/overlays/gamestates/ovl_title/z_title.c index 59afae8a5..f74c0298d 100644 --- a/soh/src/overlays/gamestates/ovl_title/z_title.c +++ b/soh/src/overlays/gamestates/ovl_title/z_title.c @@ -167,7 +167,7 @@ void Title_Draw(TitleContext* this) { Matrix_RotateZYX(0, sTitleRotY, 0, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(this->state.gfxCtx), G_MTX_LOAD); - if (CVarGetInteger("gAuthenticLogo", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("AuthenticLogo"), 0)) { gSPDisplayList(POLY_OPA_DISP++, gNintendo64LogoDL); } else { gSPDisplayList(POLY_OPA_DISP++, gShipLogoDL); @@ -192,7 +192,7 @@ void Title_Draw(TitleContext* this) { for (idx = 0, y = 94; idx < 16; idx++, y += 2) { - gDPLoadMultiTile(POLY_OPA_DISP++, CVarGetInteger("gAuthenticLogo", 0) ? nintendo_rogo_static_Tex_000000 : nintendo_rogo_static_Tex_LUS_000000, 0, G_TX_RENDERTILE, G_IM_FMT_I, G_IM_SIZ_8b, 192, 32, + gDPLoadMultiTile(POLY_OPA_DISP++, CVarGetInteger(CVAR_ENHANCEMENT("AuthenticLogo"), 0) ? nintendo_rogo_static_Tex_000000 : nintendo_rogo_static_Tex_LUS_000000, 0, G_TX_RENDERTILE, G_IM_FMT_I, G_IM_SIZ_8b, 192, 32, 0, idx * 2, 192 - 1, (idx + 1) * 2 - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); @@ -237,7 +237,7 @@ void Title_Main(GameState* thisx) { Title_Calc(this); Title_Draw(this); - if (!CVarGetInteger("gAuthenticLogo", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("AuthenticLogo"), 0)) { Gfx* gfx = POLY_OPA_DISP; s32 pad; diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c index 3aa4a25d6..d2050bc80 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c @@ -641,7 +641,7 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) { // Handles exiting the inventory editor with the L button // The editor is opened with `debugState` set to 1, and becomes closable after a frame once `debugState` is set to 2 s16 Debug_BTN = BTN_L; - if (CVarGetInteger("gNGCKaleidoSwitcher", 0) != 0) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NGCKaleidoSwitcher"), 0) != 0) { Debug_BTN = BTN_Z; } if (pauseCtx->debugState == 1) { diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index d9d03d7cc..a67530f50 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -132,10 +132,10 @@ void KaleidoScope_DrawPlayerWork(PlayState* play) { //Vec3s rot; // Removed for not having it use din the function f32 scale; Input* input = &play->state.input[0]; - s16 RotationSpeed = 150 * CVarGetInteger("gPauseLiveLinkRotationSpeed", 0); - u8 AllowStickRotation = (CVarGetInteger("gPauseLiveLinkRotation", 0) == 3) ? true : false; - u8 AllowCRotation = (CVarGetInteger("gPauseLiveLinkRotation", 0) == 2) ? true : false; - u8 AllowDPadRotation = (CVarGetInteger("gPauseLiveLinkRotation", 0) == 1) ? true : false; + s16 RotationSpeed = 150 * CVarGetInteger(CVAR_ENHANCEMENT("PauseLiveLinkRotationSpeed"), 0); + u8 AllowStickRotation = (CVarGetInteger(CVAR_ENHANCEMENT("PauseLiveLinkRotation"), 0) == 3) ? true : false; + u8 AllowCRotation = (CVarGetInteger(CVAR_ENHANCEMENT("PauseLiveLinkRotation"), 0) == 2) ? true : false; + u8 AllowDPadRotation = (CVarGetInteger(CVAR_ENHANCEMENT("PauseLiveLinkRotation"), 0) == 1) ? true : false; if (LINK_AGE_IN_YEARS == YEARS_CHILD) { @@ -542,8 +542,8 @@ void KaleidoScope_DrawEquipment(PlayState* play) { // Allow Toggling of Strength when Pressing A on Strength Upgrade Slot if ((pauseCtx->cursorSpecialPos == 0) && (pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 0) && CHECK_BTN_ALL(input->press.button, BTN_A) && - (pauseCtx->cursorX[PAUSE_EQUIP] == 0) && (pauseCtx->cursorY[PAUSE_EQUIP] == 2) && CVarGetInteger("gToggleStrength", 0)) { - CVarSetInteger("gStrengthDisabled", !CVarGetInteger("gStrengthDisabled", 0)); + (pauseCtx->cursorX[PAUSE_EQUIP] == 0) && (pauseCtx->cursorY[PAUSE_EQUIP] == 2) && CVarGetInteger(CVAR_ENHANCEMENT("ToggleStrength"), 0)) { + CVarSetInteger(CVAR_ENHANCEMENT("StrengthDisabled"), !CVarGetInteger(CVAR_ENHANCEMENT("StrengthDisabled"), 0)); // Equip success sound Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); // Wait 10 frames before accepting input again @@ -569,10 +569,10 @@ void KaleidoScope_DrawEquipment(PlayState* play) { // Only BGS/Giant's Knife is affected, and it will revert to Master Sword. // If we have the feature toggled on - if (CVarGetInteger("gEquipmentCanBeRemoved", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("EquipmentCanBeRemoved"), 0)) { - if (CVarGetInteger("gEnhancements.SwordToggle", SWORD_TOGGLE_NONE) == SWORD_TOGGLE_BOTH_AGES || - (CVarGetInteger("gEnhancements.SwordToggle", SWORD_TOGGLE_NONE) == SWORD_TOGGLE_CHILD) && LINK_IS_CHILD) { + if (CVarGetInteger(CVAR_ENHANCEMENT("SwordToggle"), SWORD_TOGGLE_NONE) == SWORD_TOGGLE_BOTH_AGES || + (CVarGetInteger(CVAR_ENHANCEMENT("SwordToggle"), SWORD_TOGGLE_NONE) == SWORD_TOGGLE_CHILD) && LINK_IS_CHILD) { // If we're on the "swords" section of the equipment screen AND we're on a currently-equipped sword if (pauseCtx->cursorY[PAUSE_EQUIP] == 0 && pauseCtx->cursorX[PAUSE_EQUIP] == CUR_EQUIP_VALUE(EQUIP_TYPE_SWORD)) { Inventory_ChangeEquipment(EQUIP_TYPE_SWORD, EQUIP_VALUE_SWORD_NONE); @@ -640,7 +640,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); pauseCtx->unk_1E4 = 7; sEquipTimer = 10; - } else if (CVarGetInteger("gAssignableTunicsAndBoots", 0) != 0) { + } else if (CVarGetInteger(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 0) != 0) { // Only allow assigning tunic and boots to c-buttons if (pauseCtx->cursorY[PAUSE_EQUIP] > 1) { if (CHECK_OWNED_EQUIP(pauseCtx->cursorY[PAUSE_EQUIP], pauseCtx->cursorX[PAUSE_EQUIP] - 1)) { @@ -680,7 +680,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { EQUIP_FAIL: if (CHECK_BTN_ALL(input->press.button, BTN_A)) { Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - } else if ((CVarGetInteger("gAssignableTunicsAndBoots", 0) != 0) && (pauseCtx->cursorY[PAUSE_EQUIP] > 1)) { + } else if ((CVarGetInteger(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 0) != 0) && (pauseCtx->cursorY[PAUSE_EQUIP] > 1)) { Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } } @@ -704,8 +704,8 @@ void KaleidoScope_DrawEquipment(PlayState* play) { // Do not Grey Out Strength Upgrade Name when Enabled // This needs to be outside the previous block since otherwise the nameColorSet is cleared to 0 by other menu pages when toggling if ((pauseCtx->pageIndex == PAUSE_EQUIP) && (pauseCtx->cursorX[PAUSE_EQUIP] == 0) && - (pauseCtx->cursorY[PAUSE_EQUIP] == 2) && CVarGetInteger("gToggleStrength", 0)) { - if (CVarGetInteger("gStrengthDisabled", 0)) { + (pauseCtx->cursorY[PAUSE_EQUIP] == 2) && CVarGetInteger(CVAR_ENHANCEMENT("ToggleStrength"), 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("StrengthDisabled"), 0)) { pauseCtx->nameColorSet = 1; } else { pauseCtx->nameColorSet = 0; @@ -735,7 +735,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { // Add zoom effect to strength item if cursor is hovering over it when toggle option is on if ((pauseCtx->cursorX[PAUSE_EQUIP] == 0) && (pauseCtx->cursorY[PAUSE_EQUIP] == 2) && - CVarGetInteger("gToggleStrength", 0) && pauseCtx->cursorSpecialPos == 0) { + CVarGetInteger(CVAR_ENHANCEMENT("ToggleStrength"), 0) && pauseCtx->cursorSpecialPos == 0) { u8 row = 2; u8 column = 0; u8 equipVtxIndex = 16 * row + 4 * column; @@ -765,7 +765,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { if ((drawGreyItems && ((sChildUpgradeItemBases[i] + CUR_UPG_VALUE(sChildUpgrades[i]) - 1) == ITEM_GAUNTLETS_SILVER || (sChildUpgradeItemBases[i] + CUR_UPG_VALUE(sChildUpgrades[i]) - 1) == ITEM_GAUNTLETS_GOLD)) || - (CVarGetInteger("gToggleStrength", 0) && CVarGetInteger("gStrengthDisabled", 0) && sChildUpgrades[i] == UPG_STRENGTH)) { + (CVarGetInteger(CVAR_ENHANCEMENT("ToggleStrength"), 0) && CVarGetInteger(CVAR_ENHANCEMENT("StrengthDisabled"), 0) && sChildUpgrades[i] == UPG_STRENGTH)) { gDPSetGrayscaleColor(POLY_KAL_DISP++, 109, 109, 109, 255); gSPGrayscale(POLY_KAL_DISP++, true); } @@ -785,8 +785,8 @@ void KaleidoScope_DrawEquipment(PlayState* play) { // Grey Out Strength Upgrades when Disabled and the Toggle Strength Option is on if ((drawGreyItems && (((sAdultUpgradeItemBases[i] + CUR_UPG_VALUE(sAdultUpgrades[i]) - 1) == ITEM_BRACELET && - !(IS_RANDO) && !CVarGetInteger("gToggleStrength", 0)))) || - (CVarGetInteger("gToggleStrength", 0) && CVarGetInteger("gStrengthDisabled", 0) && sAdultUpgrades[i] == UPG_STRENGTH)) { + !(IS_RANDO) && !CVarGetInteger(CVAR_ENHANCEMENT("ToggleStrength"), 0)))) || + (CVarGetInteger(CVAR_ENHANCEMENT("ToggleStrength"), 0) && CVarGetInteger(CVAR_ENHANCEMENT("StrengthDisabled"), 0) && sAdultUpgrades[i] == UPG_STRENGTH)) { gDPSetGrayscaleColor(POLY_KAL_DISP++, 109, 109, 109, 255); gSPGrayscale(POLY_KAL_DISP++, true); } @@ -816,7 +816,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { // Render A button indicator when hovered over strength if ((pauseCtx->cursorX[PAUSE_EQUIP] == 0) && (pauseCtx->cursorY[PAUSE_EQUIP] == 2) && - CVarGetInteger("gToggleStrength", 0) && pauseCtx->cursorSpecialPos == 0 + CVarGetInteger(CVAR_ENHANCEMENT("ToggleStrength"), 0) && pauseCtx->cursorSpecialPos == 0 && pauseCtx->unk_1E4 == 0 && pauseCtx->state == 6) { u8 row = 2; u8 column = 0; diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c index 1060131ab..004686a4e 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -70,7 +70,7 @@ void KaleidoScope_DrawAmmoCount(PauseContext* pauseCtx, GraphicsContext* gfxCtx, gDPPipeSync(POLY_KAL_DISP++); if (i != 0) { - gSPVertex(POLY_KAL_DISP++, &pauseCtx->itemVtx[((CVarGetInteger("gEnhancements.BetterAmmoRendering", 0) ? sAllAmmoVtxOffset[slot] : sAmmoVtxOffset[slot]) + 31) * 4], 4, 0); + gSPVertex(POLY_KAL_DISP++, &pauseCtx->itemVtx[((CVarGetInteger(CVAR_ENHANCEMENT("BetterAmmoRendering"), 0) ? sAllAmmoVtxOffset[slot] : sAmmoVtxOffset[slot]) + 31) * 4], 4, 0); gDPLoadTextureBlock(POLY_KAL_DISP++, ((u8*)_gAmmoDigit0Tex[i]), G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, @@ -79,7 +79,7 @@ void KaleidoScope_DrawAmmoCount(PauseContext* pauseCtx, GraphicsContext* gfxCtx, gSP1Quadrangle(POLY_KAL_DISP++, 0, 2, 3, 1, 0); } - gSPVertex(POLY_KAL_DISP++, &pauseCtx->itemVtx[((CVarGetInteger("gEnhancements.BetterAmmoRendering", 0) ? sAllAmmoVtxOffset[slot] : sAmmoVtxOffset[slot]) + 32) * 4], 4, 0); + gSPVertex(POLY_KAL_DISP++, &pauseCtx->itemVtx[((CVarGetInteger(CVAR_ENHANCEMENT("BetterAmmoRendering"), 0) ? sAllAmmoVtxOffset[slot] : sAmmoVtxOffset[slot]) + 32) * 4], 4, 0); gDPLoadTextureBlock(POLY_KAL_DISP++, ((u8*)_gAmmoDigit0Tex[ammo]), G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, @@ -313,7 +313,7 @@ bool CanMaskSelect() { // * zelda's letter check: Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER) // * kak gate check: Flags_GetInfTable(INFTABLE_SHOWED_ZELDAS_LETTER_TO_GATE_GUARD) // and the mask quest is complete: Flags_GetEventChkInf(EVENTCHKINF_PAID_BACK_BUNNY_HOOD_FEE) - return CVarGetInteger("gMaskSelect", 0) && + return CVarGetInteger(CVAR_ENHANCEMENT("MaskSelect"), 0) && Flags_GetEventChkInf(EVENTCHKINF_PAID_BACK_BUNNY_HOOD_FEE) && Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER) && Flags_GetInfTable(INFTABLE_SHOWED_ZELDAS_LETTER_TO_GATE_GUARD); @@ -339,7 +339,7 @@ void KaleidoScope_HandleItemCycles(PlayState* play) { //to allow adult link to wear it if the setting is enabled gSlotAgeReqs[SLOT_TRADE_CHILD] = ( - ((CVarGetInteger("gMMBunnyHood", BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA) && CVarGetInteger("gAdultBunnyHood", 0)) || + ((CVarGetInteger(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA) && CVarGetInteger(CVAR_ENHANCEMENT("AdultBunnyHood"), 0)) || CVarGetInteger(CVAR_CHEAT("TimelessEquipment"), 0) ) && INV_CONTENT(ITEM_TRADE_CHILD) == ITEM_MASK_BUNNY @@ -348,7 +348,7 @@ void KaleidoScope_HandleItemCycles(PlayState* play) { //also update the age requirement for the bunny hood itself gItemAgeReqs[ITEM_MASK_BUNNY] = - ((CVarGetInteger("gMMBunnyHood", BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA) && CVarGetInteger("gAdultBunnyHood", 0)) || + ((CVarGetInteger(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA) && CVarGetInteger(CVAR_ENHANCEMENT("AdultBunnyHood"), 0)) || CVarGetInteger(CVAR_CHEAT("TimelessEquipment"), 0) ? AGE_REQ_NONE : AGE_REQ_CHILD; @@ -779,7 +779,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { gDPSetCombineLERP(POLY_KAL_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); - u8 gBetterAmmoRendering = CVarGetInteger("gEnhancements.BetterAmmoRendering", 0); + u8 gBetterAmmoRendering = CVarGetInteger(CVAR_ENHANCEMENT("BetterAmmoRendering"), 0); for (i = 0; i < (gBetterAmmoRendering ? 24 : 15); i++) { if ((gBetterAmmoRendering ? ItemInSlotUsesAmmo(i) : gAmmoItems[i] != ITEM_NONE) && (gSaveContext.inventory.items[i] != ITEM_NONE)) { @@ -826,7 +826,7 @@ void KaleidoScope_SetupItemEquip(PlayState* play, u16 item, u16 slot, s16 animX, sEquipMoveTimer = 10; if ((pauseCtx->equipTargetItem == ITEM_ARROW_FIRE) || (pauseCtx->equipTargetItem == ITEM_ARROW_ICE) || (pauseCtx->equipTargetItem == ITEM_ARROW_LIGHT)) { - if (CVarGetInteger("gSkipArrowAnimation", 0)) { + if (CVarGetInteger(CVAR_ENHANCEMENT("SkipArrowAnimation"), 0)) { Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } else { u16 index = 0; @@ -1037,7 +1037,7 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { if (D_8082A488 == 0) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_ARROW_FIRE; - if (!CVarGetInteger("gSeparateArrows", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("SeparateArrows"), 0)) { pauseCtx->equipTargetSlot = SLOT_BOW; } sEquipMoveTimer = 6; @@ -1123,7 +1123,7 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { pauseCtx->equipTargetItem = ITEM_BOW_ARROW_LIGHT; break; } - if (!CVarGetInteger("gSeparateArrows", 0)) { + if (!CVarGetInteger(CVAR_ENHANCEMENT("SeparateArrows"), 0)) { pauseCtx->equipTargetSlot = SLOT_BOW; } } @@ -1156,7 +1156,7 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { if (pauseCtx->equipTargetItem == ITEM_BOW) { if (gSaveContext.equips.buttonItems[otherButtonIndex] >= ITEM_BOW_ARROW_FIRE && gSaveContext.equips.buttonItems[otherButtonIndex] <= ITEM_BOW_ARROW_LIGHT && - !CVarGetInteger("gSeparateArrows", 0)) { + !CVarGetInteger(CVAR_ENHANCEMENT("SeparateArrows"), 0)) { gSaveContext.equips.buttonItems[otherButtonIndex] = gSaveContext.equips.buttonItems[targetButtonIndex]; gSaveContext.equips.cButtonSlots[otherSlotIndex] = gSaveContext.equips.cButtonSlots[pauseCtx->equipTargetCBtn]; Interface_LoadItemIcon2(play, otherButtonIndex); diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index 12fa4d19e..131fb7339 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -1057,7 +1057,7 @@ void KaleidoScope_SwitchPage(PauseContext* pauseCtx, u8 pt) { gSaveContext.buttonStatus[buttonIndex] = D_8082AB6C[pauseCtx->pageIndex + pt][buttonIndex]; } - if ((CVarGetInteger("gAssignableTunicsAndBoots", 0) != 0) && (D_8082ABEC[pauseCtx->mode] == PAUSE_EQUIP)) { + if ((CVarGetInteger(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 0) != 0) && (D_8082ABEC[pauseCtx->mode] == PAUSE_EQUIP)) { gSaveContext.buttonStatus[1] = BTN_ENABLED; gSaveContext.buttonStatus[2] = BTN_ENABLED; gSaveContext.buttonStatus[3] = BTN_ENABLED; @@ -1079,7 +1079,7 @@ void KaleidoScope_SwitchPage(PauseContext* pauseCtx, u8 pt) { void KaleidoScope_HandlePageToggles(PauseContext* pauseCtx, Input* input) { s16 Debug_BTN = BTN_L; s16 PageLeft_BTN = BTN_Z; - if (CVarGetInteger("gNGCKaleidoSwitcher", 0) != 0) { + if (CVarGetInteger(CVAR_ENHANCEMENT("NGCKaleidoSwitcher"), 0) != 0) { Debug_BTN = BTN_Z; PageLeft_BTN = BTN_L; } @@ -1618,7 +1618,7 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) { POLY_KAL_DISP = KaleidoScope_QuadTextureIA8(POLY_KAL_DISP, sPromptChoiceTexs[gSaveContext.language][1], 48, 16, 16); } else if (((pauseCtx->state == 7 && pauseCtx->unk_1EC >= 4) || pauseCtx->state == 0xF) && - !CVarGetInteger("gSkipSaveConfirmation", 0)) { + !CVarGetInteger(CVAR_ENHANCEMENT("SkipSaveConfirmation"), 0)) { POLY_KAL_DISP = KaleidoScope_QuadTextureIA8(POLY_KAL_DISP, sSaveConfirmationTexs[gSaveContext.language], 152, 16, 0); } else if ((pauseCtx->state != 7) || (pauseCtx->unk_1EC < 4)) { @@ -1890,14 +1890,14 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { gSPDisplayList(POLY_KAL_DISP++, gItemNamePanelDL); - if (CVarGetInteger("gUniformLR", 0) == 0) { // Restore the misplace gDPSetPrimColor + if (CVarGetInteger(CVAR_ENHANCEMENT("FixMenuLR"), 0) == 0) { // Restore the misplace gDPSetPrimColor gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 90, 100, 130, 255); } if ((pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) && (pauseCtx->unk_1E4 == 0)) { gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, D_808321A0, D_808321A2, D_808321A4, D_808321A6); } else { - if (CVarGetInteger("gUniformLR", 0) != 0) { + if (CVarGetInteger(CVAR_ENHANCEMENT("FixMenuLR"), 0) != 0) { gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 180, 210, 255, 255); } } @@ -1905,14 +1905,14 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { gSPDisplayList(POLY_KAL_DISP++, gLButtonIconDL); - if (CVarGetInteger("gUniformLR", 0) == 0) { //Restore the misplace gDPSetPrimColor + if (CVarGetInteger(CVAR_ENHANCEMENT("FixMenuLR"), 0) == 0) { //Restore the misplace gDPSetPrimColor gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 180, 210, 255, 255); } if ((pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_RIGHT) && (pauseCtx->unk_1E4 == 0)) { gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, D_808321A0, D_808321A2, D_808321A4, D_808321A6); } else { - if (CVarGetInteger("gUniformLR", 0) != 0) { + if (CVarGetInteger(CVAR_ENHANCEMENT("FixMenuLR"), 0) != 0) { gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 180, 210, 255, 255); } } @@ -2827,7 +2827,7 @@ void KaleidoScope_InitVertices(PlayState* play, GraphicsContext* gfxCtx) { pauseCtx->cursorVtx[19].v.tc[1] = 0x400; // 24 items, 7 "item selected" backgrounds, 14 ammo digits (2 each for 7 items) -- then 4 vertices for each - pauseCtx->itemVtx = Graph_Alloc(gfxCtx, (24 + 7 + 2 * (CVarGetInteger("gEnhancements.BetterAmmoRendering", 0) ? ARRAY_COUNT(D_8082B11C_all) : ARRAY_COUNT(D_8082B11C))) * 4 * sizeof(Vtx)); + pauseCtx->itemVtx = Graph_Alloc(gfxCtx, (24 + 7 + 2 * (CVarGetInteger(CVAR_ENHANCEMENT("BetterAmmoRendering"), 0) ? ARRAY_COUNT(D_8082B11C_all) : ARRAY_COUNT(D_8082B11C))) * 4 * sizeof(Vtx)); for (phi_t4 = 0, phi_t2 = 0, phi_t5 = 58; phi_t4 < 4; phi_t4++, phi_t5 -= 32) { for (phi_t1 = -96, phi_t3 = 0; phi_t3 < 6; phi_t3++, phi_t2 += 4, phi_t1 += 32) { @@ -2917,7 +2917,7 @@ void KaleidoScope_InitVertices(PlayState* play, GraphicsContext* gfxCtx) { } } - u8 gBetterAmmoRendering = CVarGetInteger("gEnhancements.BetterAmmoRendering", 0); + u8 gBetterAmmoRendering = CVarGetInteger(CVAR_ENHANCEMENT("BetterAmmoRendering"), 0); for (phi_t3 = 0; phi_t3 < (gBetterAmmoRendering ? ARRAY_COUNT(D_8082B11C_all) : ARRAY_COUNT(D_8082B11C)); phi_t3++) { phi_t4 = gBetterAmmoRendering ? D_8082B11C_all[phi_t3] : D_8082B11C[phi_t3]; @@ -3302,7 +3302,7 @@ void func_808265BC(PlayState* play) { pauseCtx->pageIndex = D_8082ABEC[pauseCtx->mode]; - if ((CVarGetInteger("gAssignableTunicsAndBoots", 0) != 0) && (pauseCtx->pageIndex == PAUSE_EQUIP)) { + if ((CVarGetInteger(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 0) != 0) && (pauseCtx->pageIndex == PAUSE_EQUIP)) { gSaveContext.buttonStatus[1] = BTN_ENABLED; gSaveContext.buttonStatus[2] = BTN_ENABLED; gSaveContext.buttonStatus[3] = BTN_ENABLED; @@ -4157,7 +4157,7 @@ void KaleidoScope_Update(PlayState* play) &D_801333E8); Play_PerformSave(play); pauseCtx->unk_1EC = 4; - D_8082B25C = CVarGetInteger("gSkipSaveConfirmation", 0) ? 3 /* 0.1 sec */ : 90 /* 3 secs */; + D_8082B25C = CVarGetInteger(CVAR_ENHANCEMENT("SkipSaveConfirmation"), 0) ? 3 /* 0.1 sec */ : 90 /* 3 secs */; } } else if (CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_B)) { @@ -4405,7 +4405,7 @@ void KaleidoScope_Update(PlayState* play) gSaveContext.savedSceneNum = play->sceneNum; Save_SaveFile(); pauseCtx->state = 0xF; - D_8082B25C = CVarGetInteger("gSkipSaveConfirmation", 0) ? 3 /* 0.1 sec */ : 90 /* 3 secs */; + D_8082B25C = CVarGetInteger(CVAR_ENHANCEMENT("SkipSaveConfirmation"), 0) ? 3 /* 0.1 sec */ : 90 /* 3 secs */; } } break; @@ -4508,7 +4508,7 @@ void KaleidoScope_Update(PlayState* play) // Reset frame counter to prevent autosave on respawn play->gameplayFrames = 0; gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK; - gSaveContext.health = CVarGetInteger("gFullHealthSpawn", 0) ? gSaveContext.healthCapacity : 0x30; + gSaveContext.health = CVarGetInteger(CVAR_ENHANCEMENT("FullHealthSpawn"), 0) ? gSaveContext.healthCapacity : 0x30; Audio_QueueSeqCmd(0xF << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0xA); gSaveContext.healthAccumulator = 0; gSaveContext.magicState = MAGIC_STATE_IDLE;