mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-21 23:09:27 +02:00
[Misc] Change framerate of Pokemon based on its status effect (#6284)
This commit is contained in:
parent
d2e9615457
commit
ee297a58bb
@ -5007,22 +5007,43 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
effect: StatusEffect,
|
effect: StatusEffect,
|
||||||
sleepTurnsRemaining = effect !== StatusEffect.SLEEP ? 0 : this.randBattleSeedIntRange(2, 4),
|
sleepTurnsRemaining = effect !== StatusEffect.SLEEP ? 0 : this.randBattleSeedIntRange(2, 4),
|
||||||
): void {
|
): void {
|
||||||
if (effect === StatusEffect.SLEEP) {
|
switch (effect) {
|
||||||
this.setFrameRate(4);
|
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),
|
// 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
|
// remove their invulnerability and cancel the upcoming move from the queue
|
||||||
const invulnTagTypes = [
|
const invulnTagTypes = [
|
||||||
BattlerTagType.FLYING,
|
BattlerTagType.FLYING,
|
||||||
BattlerTagType.UNDERGROUND,
|
BattlerTagType.UNDERGROUND,
|
||||||
BattlerTagType.UNDERWATER,
|
BattlerTagType.UNDERWATER,
|
||||||
BattlerTagType.HIDDEN,
|
BattlerTagType.HIDDEN,
|
||||||
];
|
];
|
||||||
|
|
||||||
if (this.findTag(t => invulnTagTypes.includes(t.tagType))) {
|
if (this.findTag(t => invulnTagTypes.includes(t.tagType))) {
|
||||||
this.findAndRemoveTags(t => invulnTagTypes.includes(t.tagType));
|
this.findAndRemoveTags(t => invulnTagTypes.includes(t.tagType));
|
||||||
this.getMoveQueue().shift();
|
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);
|
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) {
|
public clearStatus(confusion: boolean, reloadAssets: boolean) {
|
||||||
const lastStatus = this.status?.effect;
|
const lastStatus = this.status?.effect;
|
||||||
this.status = null;
|
this.status = null;
|
||||||
|
this.setFrameRate(10);
|
||||||
if (lastStatus === StatusEffect.SLEEP) {
|
if (lastStatus === StatusEffect.SLEEP) {
|
||||||
this.setFrameRate(10);
|
|
||||||
if (this.getTag(BattlerTagType.NIGHTMARE)) {
|
if (this.getTag(BattlerTagType.NIGHTMARE)) {
|
||||||
this.lapseTag(BattlerTagType.NIGHTMARE);
|
this.lapseTag(BattlerTagType.NIGHTMARE);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user