[Misc] Change framerate of Pokemon based on its status effect (#6284)

This commit is contained in:
NightKev 2025-08-20 15:11:16 -07:00 committed by GitHub
parent d2e9615457
commit ee297a58bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5007,8 +5007,16 @@ 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
@ -5023,6 +5031,19 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
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;
if (lastStatus === StatusEffect.SLEEP) {
this.setFrameRate(10);
if (lastStatus === StatusEffect.SLEEP) {
if (this.getTag(BattlerTagType.NIGHTMARE)) {
this.lapseTag(BattlerTagType.NIGHTMARE);
}