Skip to content

Commit

Permalink
Brought Endure token RNG in line with game RNG formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
frutescens committed Nov 13, 2024
1 parent 530511f commit 8c77f35
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 8c77f35

Please sign in to comment.