mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-02-27 16:21:46 -05:00
scaling (#3393)
This commit is contained in:
parent
b80452b2b8
commit
81ec2805ee
soh/soh
@ -1127,6 +1127,17 @@ void RegisterRandomizedEnemySizes() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Actor_SetScale(actor, actor->scale.z * randomScale);
|
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;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1182,6 +1182,11 @@ void DrawEnhancementsMenu() {
|
|||||||
UIWidgets::PaddedEnhancementCheckbox("Randomized Enemy Sizes", "gRandomizedEnemySizes", true, false);
|
UIWidgets::PaddedEnhancementCheckbox("Randomized Enemy Sizes", "gRandomizedEnemySizes", true, false);
|
||||||
UIWidgets::Tooltip("Enemies and Bosses spawn with random sizes.");
|
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::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 "
|
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!");
|
"press the C-Buttons to use items and mess with Player 1!");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user