From 6dec84e39c0e1229160af14dddb0b9df6aeedfcb Mon Sep 17 00:00:00 2001 From: Mumble <171087428+frutescens@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:13:23 -0800 Subject: [PATCH] [Balance] No more double 50x bosses in Endless + cleaning up RNG (#4862) * Added double battle exclusion to Endless bosses. * Brought Endure token RNG in line with game RNG formatting. * Corrected incorrect modulo condition in isEndlessBoss * Moved new doubles conditional to be above overrides. * Fixed bad RNG calls for Covet and Thief too. * Updated unburden test. * Revert "Updated unburden test." This reverts commit 01788d40c2f5c32d89bd0cb899bfc67fc77f881e. * Revert "Fixed bad RNG calls for Covet and Thief too." This reverts commit c7fcfd195de7e98c1e582ec67c829e003663cad0. --------- Co-authored-by: frutescens --- src/battle-scene.ts | 5 +++++ src/game-mode.ts | 2 +- src/modifier/modifier.ts | 8 ++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index e659b588208..061fc6e28f2 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -1233,6 +1233,11 @@ export default class BattleScene extends SceneBase { newDouble = !!double; } + // Disable double battles on Endless/Endless Spliced Wave 50x boss battles (Introduced 1.2.0) + if (this.gameMode.isEndlessBoss(newWaveIndex)) { + newDouble = false; + } + if (!isNullOrUndefined(Overrides.BATTLE_TYPE_OVERRIDE)) { let doubleOverrideForWave: "single" | "double" | null = null; diff --git a/src/game-mode.ts b/src/game-mode.ts index 8f1bb9356e6..0f997bf651e 100644 --- a/src/game-mode.ts +++ b/src/game-mode.ts @@ -236,7 +236,7 @@ export class GameMode implements GameModeConfig { * @returns true if waveIndex is a multiple of 50 in Endless */ isEndlessBoss(waveIndex: integer): boolean { - return !!(waveIndex % 50) && + return waveIndex % 50 === 0 && (this.modeId === GameModes.ENDLESS || this.modeId === GameModes.SPLICED_ENDLESS); } diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 7aa4b9308d1..ac8dc556b98 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -3631,7 +3631,7 @@ export class EnemyEndureChanceModifier extends EnemyPersistentModifier { super(type, stackCount || 10); //Hardcode temporarily - this.chance = .02; + this.chance = 2; } match(modifier: Modifier) { @@ -3639,11 +3639,11 @@ export class EnemyEndureChanceModifier extends EnemyPersistentModifier { } clone() { - return new EnemyEndureChanceModifier(this.type, this.chance * 100, this.stackCount); + return new EnemyEndureChanceModifier(this.type, this.chance, this.stackCount); } getArgs(): any[] { - return [ this.chance * 100 ]; + return [ this.chance ]; } /** @@ -3652,7 +3652,7 @@ export class EnemyEndureChanceModifier extends EnemyPersistentModifier { * @returns `true` if {@linkcode Pokemon} endured */ override apply(target: Pokemon): boolean { - if (target.battleData.endured || Phaser.Math.RND.realInRange(0, 1) >= (this.chance * this.getStackCount())) { + if (target.battleData.endured || target.randSeedInt(100) >= (this.chance * this.getStackCount())) { return false; }