From fa6f05d997c0831d0911596989d8caac531be91b Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Mon, 22 Apr 2024 23:52:44 -0400 Subject: [PATCH] Revert "Apply status tokens in a random order to prevent bias" This reverts commit 1f8e36575d5c7e7c663f766c8948c5d4e87876ff. --- src/battle-scene.ts | 20 +------------------- src/phases.ts | 2 +- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index e06cea2993d..c3f920acbd2 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -1976,27 +1976,9 @@ export default class BattleScene extends SceneBase { return (player ? this.modifiers : this.enemyModifiers).find(m => (modifierFilter as ModifierPredicate)(m)); } - applyShuffledModifiers(scene: BattleScene, modifierType: { new(...args: any[]): Modifier }, player: boolean = true, ...args: any[]): PersistentModifier[] { - let modifiers = (player ? this.modifiers : this.enemyModifiers).filter(m => m instanceof modifierType && m.shouldApply(args)); - scene.executeWithSeedOffset(() => { - const shuffleModifiers = mods => { - if (mods.length === 1) - return mods; - const rand = Math.floor(Utils.randSeedInt(mods.length)); - return [mods[rand], ...shuffleModifiers(mods.filter((_, i) => i !== rand))]; - }; - modifiers = shuffleModifiers(modifiers); - }, scene.currentBattle.turn << 4, scene.waveSeed); - return this.applyModifiersInternal(modifiers, player, args); - } - applyModifiers(modifierType: { new(...args: any[]): Modifier }, player: boolean = true, ...args: any[]): PersistentModifier[] { - const modifiers = (player ? this.modifiers : this.enemyModifiers).filter(m => m instanceof modifierType && m.shouldApply(args)); - return this.applyModifiersInternal(modifiers, player, args); - } - - applyModifiersInternal(modifiers: PersistentModifier[], player: boolean, args: any[]): PersistentModifier[] { const appliedModifiers: PersistentModifier[] = []; + const modifiers = (player ? this.modifiers : this.enemyModifiers).filter(m => m instanceof modifierType && m.shouldApply(args)); for (let modifier of modifiers) { if (modifier.apply(args)) { console.log('Applied', modifier.type.name, !player ? '(enemy)' : ''); diff --git a/src/phases.ts b/src/phases.ts index deb1c2fb860..f59c6516e2d 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -2450,7 +2450,7 @@ export class MoveEffectPhase extends PokemonPhase { user, target, this.move.getMove()).then(() => { return Utils.executeIf(!target.isFainted() || target.canApplyAbility(), () => applyPostDefendAbAttrs(PostDefendAbAttr, target, user, this.move, hitResult).then(() => { if (!user.isPlayer() && this.move.getMove() instanceof AttackMove) - user.scene.applyShuffledModifiers(this.scene, EnemyAttackStatusEffectChanceModifier, false, target); + user.scene.applyModifiers(EnemyAttackStatusEffectChanceModifier, false, target); })).then(() => { applyPostAttackAbAttrs(PostAttackAbAttr, user, target, this.move, hitResult).then(() => { if (this.move.getMove() instanceof AttackMove)