mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-01 05:42:19 -05:00
Random Enemy Sizes fixes (#3452)
This commit is contained in:
parent
717074ff86
commit
420bdab328
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user