This commit is contained in:
Patrick12115 2023-12-28 12:04:30 -05:00 committed by GitHub
parent b80452b2b8
commit 81ec2805ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -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;
}
});
}

View File

@ -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!");