[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 01788d40c2.

* Revert "Fixed bad RNG calls for Covet and Thief too."

This reverts commit c7fcfd195d.

---------

Co-authored-by: frutescens <info@laptop>
This commit is contained in:
Mumble 2024-11-14 21:13:23 -08:00 committed by GitHub
parent b1138c1d70
commit 6dec84e39c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 5 deletions

View File

@ -1233,6 +1233,11 @@ export default class BattleScene extends SceneBase {
newDouble = !!double; 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)) { if (!isNullOrUndefined(Overrides.BATTLE_TYPE_OVERRIDE)) {
let doubleOverrideForWave: "single" | "double" | null = null; let doubleOverrideForWave: "single" | "double" | null = null;

View File

@ -236,7 +236,7 @@ export class GameMode implements GameModeConfig {
* @returns true if waveIndex is a multiple of 50 in Endless * @returns true if waveIndex is a multiple of 50 in Endless
*/ */
isEndlessBoss(waveIndex: integer): boolean { isEndlessBoss(waveIndex: integer): boolean {
return !!(waveIndex % 50) && return waveIndex % 50 === 0 &&
(this.modeId === GameModes.ENDLESS || this.modeId === GameModes.SPLICED_ENDLESS); (this.modeId === GameModes.ENDLESS || this.modeId === GameModes.SPLICED_ENDLESS);
} }

View File

@ -3631,7 +3631,7 @@ export class EnemyEndureChanceModifier extends EnemyPersistentModifier {
super(type, stackCount || 10); super(type, stackCount || 10);
//Hardcode temporarily //Hardcode temporarily
this.chance = .02; this.chance = 2;
} }
match(modifier: Modifier) { match(modifier: Modifier) {
@ -3639,11 +3639,11 @@ export class EnemyEndureChanceModifier extends EnemyPersistentModifier {
} }
clone() { clone() {
return new EnemyEndureChanceModifier(this.type, this.chance * 100, this.stackCount); return new EnemyEndureChanceModifier(this.type, this.chance, this.stackCount);
} }
getArgs(): any[] { getArgs(): any[] {
return [ this.chance * 100 ]; return [ this.chance ];
} }
/** /**
@ -3652,7 +3652,7 @@ export class EnemyEndureChanceModifier extends EnemyPersistentModifier {
* @returns `true` if {@linkcode Pokemon} endured * @returns `true` if {@linkcode Pokemon} endured
*/ */
override apply(target: Pokemon): boolean { 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; return false;
} }