Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Balance] No more double 50x bosses in Endless + cleaning up RNG #4862

Merged
merged 9 commits into from
Nov 15, 2024
5 changes: 5 additions & 0 deletions src/battle-scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

frutescens marked this conversation as resolved.
Show resolved Hide resolved
if (!isNullOrUndefined(Overrides.BATTLE_TYPE_OVERRIDE)) {
let doubleOverrideForWave: "single" | "double" | null = null;

Expand Down
2 changes: 1 addition & 1 deletion src/game-mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
8 changes: 4 additions & 4 deletions src/modifier/modifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3631,19 +3631,19 @@ export class EnemyEndureChanceModifier extends EnemyPersistentModifier {
super(type, stackCount || 10);

//Hardcode temporarily
this.chance = .02;
this.chance = 2;
}

match(modifier: Modifier) {
return modifier instanceof EnemyEndureChanceModifier;
}

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 ];
}

/**
Expand All @@ -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;
}

Expand Down
Loading