From 420bdab328f8bb2ee78e6157c1750a57791590fd Mon Sep 17 00:00:00 2001 From: aMannus Date: Tue, 28 Nov 2023 20:30:36 +0100 Subject: [PATCH] Random Enemy Sizes fixes (#3452) --- soh/soh/Enhancements/mods.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index 8c4d94bf5..95503fda9 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -1033,8 +1033,16 @@ void RegisterRandomizedEnemySizes() { Player* player = GET_PLAYER(gPlayState); Actor* actor = static_cast(refActor); - // Only apply to enemies and bosses. Exclude the wobbly platforms in Jabu because they need to act like platforms. - if (!CVarGetInteger("gRandomizedEnemySizes", 0) || (actor->category != ACTORCAT_ENEMY && actor->category != ACTORCAT_BOSS) || actor->id == ACTOR_EN_BROB) { + // Exclude wobbly platforms in Jabu because they need to act like platforms. + // Exclude Dead Hand hands and Bongo Bongo main body because they make the fights (near) impossible. + uint8_t excludedEnemy = actor->id == ACTOR_EN_BROB || actor->id == ACTOR_EN_DHA || (actor->id == ACTOR_BOSS_SST && actor->params == -1); + + // Dodongo, Volvagia and Dead Hand are always smaller because they're impossible when bigger. + uint8_t smallOnlyEnemy = + actor->id == ACTOR_BOSS_DODONGO || actor->id == ACTOR_BOSS_FD || actor->id == ACTOR_BOSS_FD2 || ACTOR_EN_DH; + + // Only apply to enemies and bosses. + if (!CVarGetInteger("gRandomizedEnemySizes", 0) || (actor->category != ACTORCAT_ENEMY && actor->category != ACTORCAT_BOSS) || excludedEnemy) { return; } @@ -1043,9 +1051,8 @@ void RegisterRandomizedEnemySizes() { uint8_t bigActor = rand() % 2; - // Big actor. Dodongo and Volvagia are always smaller because they're impossible when bigger. - if (bigActor && actor->id != ACTOR_BOSS_DODONGO && actor->id != ACTOR_BOSS_FD && - actor->id != ACTOR_BOSS_FD2) { + // Big actor + if (bigActor && !smallOnlyEnemy) { randomNumber = rand() % 200; // Between 100% and 300% size. randomScale = 1.0f + (randomNumber / 100);