From 30b1a059c266e3ef0572298b2e5bed678386dee1 Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Sun, 17 Aug 2025 16:16:22 -0700 Subject: [PATCH 1/2] [Misc] Change framerate of Pokemon based on its status effect --- src/field/pokemon.ts | 53 +++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 3a5d435fb36..a8b71a66eed 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -4952,31 +4952,48 @@ export abstract class Pokemon extends Phaser.GameObjects.Container { return true; } - let sleepTurnsRemaining: NumberHolder; + const sleepTurnsRemaining: NumberHolder = new NumberHolder(1); - if (effect === StatusEffect.SLEEP) { - sleepTurnsRemaining = new NumberHolder(this.randBattleSeedIntRange(2, 4)); + switch (effect) { + case StatusEffect.POISON: + case StatusEffect.TOXIC: + this.setFrameRate(8); + break; + case StatusEffect.PARALYSIS: + this.setFrameRate(5); + break; + case StatusEffect.SLEEP: { + sleepTurnsRemaining.value = this.randBattleSeedIntRange(2, 4); - this.setFrameRate(4); + this.setFrameRate(3); - // If the user is invulnerable, lets remove their invulnerability when they fall asleep - const invulnerableTags = [ - BattlerTagType.UNDERGROUND, - BattlerTagType.UNDERWATER, - BattlerTagType.HIDDEN, - BattlerTagType.FLYING, - ]; + // If the user is invulnerable, lets remove their invulnerability when they fall asleep + const invulnerableTags = [ + BattlerTagType.UNDERGROUND, + BattlerTagType.UNDERWATER, + BattlerTagType.HIDDEN, + BattlerTagType.FLYING, + ]; - const tag = invulnerableTags.find(t => this.getTag(t)); + const tag = invulnerableTags.find(t => this.getTag(t)); - if (tag) { - this.removeTag(tag); - this.getMoveQueue().pop(); + if (tag) { + this.removeTag(tag); + this.getMoveQueue().pop(); + } + break; } + case StatusEffect.FREEZE: + this.setFrameRate(0); + break; + case StatusEffect.BURN: + this.setFrameRate(12); + break; + case StatusEffect.FAINT: + break; } - sleepTurnsRemaining = sleepTurnsRemaining!; // tell TS compiler it's defined - this.status = new Status(effect, 0, sleepTurnsRemaining?.value); + this.status = new Status(effect, 0, sleepTurnsRemaining.value); return true; } @@ -5009,8 +5026,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); } From 49b30f58ce4005c1752de1900bf71d5c54e1774c Mon Sep 17 00:00:00 2001 From: damocleas Date: Sun, 17 Aug 2025 20:28:51 -0400 Subject: [PATCH 2/2] Update pokemon.ts burn 12 -> 14 --- src/field/pokemon.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index a8b71a66eed..65101dc54fd 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -4987,7 +4987,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container { this.setFrameRate(0); break; case StatusEffect.BURN: - this.setFrameRate(12); + this.setFrameRate(14); break; case StatusEffect.FAINT: break;