diff --git a/run-clang-format.ps1 b/run-clang-format.ps1 index 3ff6998a6..b0700f644 100644 --- a/run-clang-format.ps1 +++ b/run-clang-format.ps1 @@ -38,7 +38,7 @@ $basePath = (Resolve-Path .).Path $files = Get-ChildItem -Path $basePath\soh -Recurse -File ` | Where-Object { ($_.Extension -eq '.c' -or $_.Extension -eq '.cpp' -or ` (($_.Extension -eq '.h' -or $_.Extension -eq '.hpp') -and ` - (-not ($_.FullName -like "*\soh\src\*" -or $_.FullName -like "*\soh\include\*")))) -and ` + (-not ($_.FullName -like "*\soh\src\*" -or $_.FullName -like "*\soh\include\*" -or $_.FullName -like "*\soh\soh\Enhancements\randomizer\generated\*")))) -and ` (-not ($_.FullName -like "*\soh\assets\*" -or $_.FullName -like "*\soh\build\*")) } for ($i = 0; $i -lt $files.Length; $i++) { diff --git a/run-clang-format.sh b/run-clang-format.sh index 20129e63d..7f3a3913b 100755 --- a/run-clang-format.sh +++ b/run-clang-format.sh @@ -26,4 +26,4 @@ # and pass it as an argument to clang-format # verbose to print files being formatted and X out of Y status -find soh -type f \( -name "*.c" -o -name "*.cpp" -o \( \( -name "*.h" -o -name "*.hpp" \) ! -path "soh/src/*" ! -path "soh/include/*" \) \) ! -path "soh/assets/*" -print0 | xargs -0 clang-format-14 -i --verbose +find soh -type f \( -name "*.c" -o -name "*.cpp" -o \( \( -name "*.h" -o -name "*.hpp" \) ! -path "soh/src/*" ! -path "soh/include/*" ! -path "soh/soh/Enhancements/randomizer/generated/*" \) \) ! -path "soh/assets/*" -print0 | xargs -0 clang-format-14 -i --verbose diff --git a/soh/compile_logic.py b/soh/compile_logic.py index 18db38604..8f029b7f1 100755 --- a/soh/compile_logic.py +++ b/soh/compile_logic.py @@ -194,7 +194,6 @@ LOGIC = { "AtNight", "LoweredWaterInBotw", "BigPoes", - "IsFireLoopLocked", } RANDO = { @@ -276,6 +275,7 @@ logicFUNC = { "HasBottle", "ScarecrowsSong", "SmallKeys", + "IsFireLoopLocked", "OcarinaButtons", "Hearts", "EffectiveHealth", diff --git a/soh/soh/Enhancements/randomizer/logic.cpp b/soh/soh/Enhancements/randomizer/logic.cpp index eea79e92d..154fb7148 100644 --- a/soh/soh/Enhancements/randomizer/logic.cpp +++ b/soh/soh/Enhancements/randomizer/logic.cpp @@ -1442,6 +1442,12 @@ bool Logic::SmallKeys(RandomizerRegion dungeon, uint8_t requiredAmountGlitchless } } +bool Logic::IsFireLoopLocked() { + return ctx->GetOption(RSK_KEYSANITY).Is(RO_DUNGEON_ITEM_LOC_ANYWHERE) || + ctx->GetOption(RSK_KEYSANITY).Is(RO_DUNGEON_ITEM_LOC_OVERWORLD) || + ctx->GetOption(RSK_KEYSANITY).Is(RO_DUNGEON_ITEM_LOC_ANY_DUNGEON); +} + std::map Logic::RandoGetToEquipFlag = { { RG_KOKIRI_SWORD, EQUIP_FLAG_SWORD_KOKIRI }, { RG_MASTER_SWORD, EQUIP_FLAG_SWORD_MASTER }, { RG_BIGGORON_SWORD, EQUIP_FLAG_SWORD_BGS }, { RG_DEKU_SHIELD, EQUIP_FLAG_SHIELD_DEKU }, @@ -2338,10 +2344,6 @@ void Logic::Reset(bool resetSaveContext /*= true*/) { } StartPerformanceTimer(PT_LOGIC_RESET); memset(inLogic, false, sizeof(inLogic)); - // Settings-dependent variables - IsFireLoopLocked = ctx->GetOption(RSK_KEYSANITY).Is(RO_DUNGEON_ITEM_LOC_ANYWHERE) || - ctx->GetOption(RSK_KEYSANITY).Is(RO_DUNGEON_ITEM_LOC_OVERWORLD) || - ctx->GetOption(RSK_KEYSANITY).Is(RO_DUNGEON_ITEM_LOC_ANY_DUNGEON); // AmmoCanDrop = /*AmmoDrops.IsNot(AMMODROPS_NONE)*/ false; TODO: AmmoDrop setting @@ -2407,7 +2409,7 @@ void Logic::Reset(bool resetSaveContext /*= true*/) { // If not keysanity, start with 1 logical key to account for automatically unlocking the basement door in // vanilla FiT - if (!IsFireLoopLocked && ctx->GetDungeon(Rando::FIRE_TEMPLE)->IsVanilla()) { + if (!IsFireLoopLocked() && ctx->GetDungeon(Rando::FIRE_TEMPLE)->IsVanilla()) { SetSmallKeyCount(SCENE_FIRE_TEMPLE, 1); } } diff --git a/soh/soh/Enhancements/randomizer/logic.h b/soh/soh/Enhancements/randomizer/logic.h index 1cb34bd42..86731b4aa 100644 --- a/soh/soh/Enhancements/randomizer/logic.h +++ b/soh/soh/Enhancements/randomizer/logic.h @@ -59,9 +59,6 @@ class Logic { bool ShadowTrialClear = false; bool LightTrialClear = false; - // Logical keysanity - bool IsFireLoopLocked = false; - // Bottle Count uint8_t Bottles = 0; uint8_t NumBottles = 0; @@ -194,6 +191,7 @@ class Logic { bool CanOpenOverworldDoor(RandomizerGet itemName); bool SmallKeys(RandomizerRegion dungeon, uint8_t requiredAmount); bool SmallKeys(RandomizerRegion dungeon, uint8_t requiredAmountGlitchless, uint8_t requiredAmountGlitched); + bool IsFireLoopLocked(); bool CanOpenUnderwaterChest(); bool CanDoGlitch(GlitchType glitch); bool CanEquipSwap(RandomizerGet itemName);