From ee297a58bb0d4d21d74c4fe28e5c76dd9edbe356 Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Wed, 20 Aug 2025 15:11:16 -0700 Subject: [PATCH] [Misc] Change framerate of Pokemon based on its status effect (#6284) --- src/field/pokemon.ts | 49 +++++++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index c8a5b802314..e73d1cdf273 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -5007,22 +5007,43 @@ export abstract class Pokemon extends Phaser.GameObjects.Container { effect: StatusEffect, sleepTurnsRemaining = effect !== StatusEffect.SLEEP ? 0 : this.randBattleSeedIntRange(2, 4), ): void { - if (effect === StatusEffect.SLEEP) { - this.setFrameRate(4); + switch (effect) { + case StatusEffect.POISON: + case StatusEffect.TOXIC: + this.setFrameRate(8); + break; + case StatusEffect.PARALYSIS: + this.setFrameRate(5); + break; + case StatusEffect.SLEEP: { + this.setFrameRate(3); - // If the user is semi-invulnerable when put asleep (such as due to Yawm), - // remove their invulnerability and cancel the upcoming move from the queue - const invulnTagTypes = [ - BattlerTagType.FLYING, - BattlerTagType.UNDERGROUND, - BattlerTagType.UNDERWATER, - BattlerTagType.HIDDEN, - ]; + // If the user is semi-invulnerable when put asleep (such as due to Yawm), + // remove their invulnerability and cancel the upcoming move from the queue + const invulnTagTypes = [ + BattlerTagType.FLYING, + BattlerTagType.UNDERGROUND, + BattlerTagType.UNDERWATER, + BattlerTagType.HIDDEN, + ]; - if (this.findTag(t => invulnTagTypes.includes(t.tagType))) { - this.findAndRemoveTags(t => invulnTagTypes.includes(t.tagType)); - this.getMoveQueue().shift(); + if (this.findTag(t => invulnTagTypes.includes(t.tagType))) { + this.findAndRemoveTags(t => invulnTagTypes.includes(t.tagType)); + this.getMoveQueue().shift(); + } + break; } + case StatusEffect.FREEZE: + this.setFrameRate(0); + break; + case StatusEffect.BURN: + this.setFrameRate(14); + break; + case StatusEffect.FAINT: + break; + default: + effect satisfies StatusEffect.NONE; + break; } this.status = new Status(effect, 0, sleepTurnsRemaining); @@ -5056,8 +5077,8 @@ export abstract class Pokemon extends Phaser.GameObjects.Container { public clearStatus(confusion: boolean, reloadAssets: boolean) { const lastStatus = this.status?.effect; this.status = null; + this.setFrameRate(10); if (lastStatus === StatusEffect.SLEEP) { - this.setFrameRate(10); if (this.getTag(BattlerTagType.NIGHTMARE)) { this.lapseTag(BattlerTagType.NIGHTMARE); }