diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index d7123c570..275057bcf 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -1127,6 +1127,17 @@ void RegisterRandomizedEnemySizes() { } Actor_SetScale(actor, actor->scale.z * randomScale); + + if (CVarGetInteger("gEnemySizeScalesHealth", 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); + + // Ensure the scaled health doesn't go below zero + actor->colChkInfo.health = fmax(scaledHealth, 1.0f); + } else { + return; + } }); } diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index e46051969..7c1f51cf1 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -1182,6 +1182,11 @@ void DrawEnhancementsMenu() { UIWidgets::PaddedEnhancementCheckbox("Randomized Enemy Sizes", "gRandomizedEnemySizes", true, false); UIWidgets::Tooltip("Enemies and Bosses spawn with random sizes."); + if (CVarGetInteger("gRandomizedEnemySizes", 0)) { + UIWidgets::EnhancementCheckbox("Scale Health with Size", "gEnemySizeScalesHealth"); + 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::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!");