mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-21 06:49:35 +02:00
Fix status override to set the number of sleep turns
This commit is contained in:
parent
913a5bcec3
commit
12eed81cb5
@ -3991,7 +3991,7 @@ export class PlayerPokemon extends Pokemon {
|
|||||||
super(scene, 106, 148, species, level, abilityIndex, formIndex, gender, shiny, variant, ivs, nature, dataSource);
|
super(scene, 106, 148, species, level, abilityIndex, formIndex, gender, shiny, variant, ivs, nature, dataSource);
|
||||||
|
|
||||||
if (Overrides.STATUS_OVERRIDE) {
|
if (Overrides.STATUS_OVERRIDE) {
|
||||||
this.status = new Status(Overrides.STATUS_OVERRIDE);
|
this.status = new Status(Overrides.STATUS_OVERRIDE, 0, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Overrides.SHINY_OVERRIDE) {
|
if (Overrides.SHINY_OVERRIDE) {
|
||||||
@ -4471,7 +4471,7 @@ export class EnemyPokemon extends Pokemon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Overrides.OPP_STATUS_OVERRIDE) {
|
if (Overrides.OPP_STATUS_OVERRIDE) {
|
||||||
this.status = new Status(Overrides.OPP_STATUS_OVERRIDE);
|
this.status = new Status(Overrides.OPP_STATUS_OVERRIDE, 0, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Overrides.OPP_GENDER_OVERRIDE) {
|
if (Overrides.OPP_GENDER_OVERRIDE) {
|
||||||
@ -4480,9 +4480,11 @@ export class EnemyPokemon extends Pokemon {
|
|||||||
|
|
||||||
const speciesId = this.species.speciesId;
|
const speciesId = this.species.speciesId;
|
||||||
|
|
||||||
if (speciesId in Overrides.OPP_FORM_OVERRIDES
|
if (
|
||||||
|
speciesId in Overrides.OPP_FORM_OVERRIDES
|
||||||
&& Overrides.OPP_FORM_OVERRIDES[speciesId]
|
&& Overrides.OPP_FORM_OVERRIDES[speciesId]
|
||||||
&& this.species.forms[Overrides.OPP_FORM_OVERRIDES[speciesId]]) {
|
&& this.species.forms[Overrides.OPP_FORM_OVERRIDES[speciesId]]
|
||||||
|
) {
|
||||||
this.formIndex = Overrides.OPP_FORM_OVERRIDES[speciesId] ?? 0;
|
this.formIndex = Overrides.OPP_FORM_OVERRIDES[speciesId] ?? 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
import { CommandPhase } from "#app/phases/command-phase";
|
import { StatusEffect } from "#app/data/status-effect";
|
||||||
import { TurnInitPhase } from "#app/phases/turn-init-phase";
|
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { StatusEffect } from "#app/data/status-effect";
|
|
||||||
|
|
||||||
describe("Moves - Nightmare", () => {
|
describe("Moves - Nightmare", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
@ -39,16 +37,16 @@ describe("Moves - Nightmare", () => {
|
|||||||
|
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
const enemyMaxHP = enemyPokemon.hp;
|
const enemyMaxHP = enemyPokemon.hp;
|
||||||
|
|
||||||
game.move.select(Moves.NIGHTMARE);
|
game.move.select(Moves.NIGHTMARE);
|
||||||
await game.phaseInterceptor.to(TurnInitPhase);
|
await game.toNextTurn();
|
||||||
|
|
||||||
expect(enemyPokemon.hp).toBe(enemyMaxHP - Math.floor(enemyMaxHP / 4));
|
expect(enemyPokemon.hp).toBe(enemyMaxHP - Math.floor(enemyMaxHP / 4));
|
||||||
|
|
||||||
// take a second turn to make sure damage occurs again
|
// take a second turn to make sure damage occurs again
|
||||||
await game.phaseInterceptor.to(CommandPhase);
|
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
|
await game.toNextTurn();
|
||||||
|
|
||||||
await game.phaseInterceptor.to(TurnInitPhase);
|
|
||||||
expect(enemyPokemon.hp).toBe(enemyMaxHP - Math.floor(enemyMaxHP / 4) - Math.floor(enemyMaxHP / 4));
|
expect(enemyPokemon.hp).toBe(enemyMaxHP - Math.floor(enemyMaxHP / 4) - Math.floor(enemyMaxHP / 4));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user