Random Enemy Sizes fixes (#3452)

This commit is contained in:
aMannus 2023-11-28 20:30:36 +01:00 committed by GitHub
parent 717074ff86
commit 420bdab328
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1033,8 +1033,16 @@ void RegisterRandomizedEnemySizes() {
Player* player = GET_PLAYER(gPlayState); Player* player = GET_PLAYER(gPlayState);
Actor* actor = static_cast<Actor*>(refActor); Actor* actor = static_cast<Actor*>(refActor);
// Only apply to enemies and bosses. Exclude the wobbly platforms in Jabu because they need to act like platforms. // Exclude 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 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; return;
} }
@ -1043,9 +1051,8 @@ void RegisterRandomizedEnemySizes() {
uint8_t bigActor = rand() % 2; uint8_t bigActor = rand() % 2;
// Big actor. Dodongo and Volvagia are always smaller because they're impossible when bigger. // Big actor
if (bigActor && actor->id != ACTOR_BOSS_DODONGO && actor->id != ACTOR_BOSS_FD && if (bigActor && !smallOnlyEnemy) {
actor->id != ACTOR_BOSS_FD2) {
randomNumber = rand() % 200; randomNumber = rand() % 200;
// Between 100% and 300% size. // Between 100% and 300% size.
randomScale = 1.0f + (randomNumber / 100); randomScale = 1.0f + (randomNumber / 100);