mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-19 13:59:27 +02:00
Merge 49b30f58ce
into 7131e1fb01
This commit is contained in:
commit
7a86b1acef
@ -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(14);
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user