mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-06 15:39:27 +02:00
Compare commits
3 Commits
5c692f6617
...
a43ca36d25
Author | SHA1 | Date | |
---|---|---|---|
|
a43ca36d25 | ||
|
2d6267b668 | ||
|
8b65f9afab |
@ -44,6 +44,22 @@ describe("Abilities - Intimidate", () => {
|
||||
expect(enemy.getStatStage(Stat.ATK)).toBe(-2);
|
||||
});
|
||||
|
||||
// TODO: This fails due to a limitation in our switching logic - the animations and field entry occur concurrently
|
||||
// inside `SummonPhase`, unshifting 2 `PostSummmonPhase`s and proccing intimidate twice
|
||||
it.todo("should lower all opponents' ATK by 1 stage on initial switch prompt", async () => {
|
||||
await game.classicMode.runToSummon([SpeciesId.MIGHTYENA, SpeciesId.POOCHYENA]);
|
||||
await game.classicMode.startBattleWithSwitch(1);
|
||||
|
||||
const [poochyena, mightyena] = game.scene.getPlayerField();
|
||||
expect(poochyena.species.speciesId).toBe(SpeciesId.POOCHYENA);
|
||||
|
||||
const enemy = game.field.getEnemyPokemon();
|
||||
expect(enemy).toHaveStatStage(Stat.ATK, -1);
|
||||
|
||||
expect(poochyena).toHaveAbilityApplied(AbilityId.INTIMIDATE);
|
||||
expect(mightyena).not.toHaveAbilityApplied(AbilityId.INTIMIDATE);
|
||||
});
|
||||
|
||||
it("should lower ATK of all opponents in a double battle", async () => {
|
||||
game.override.battleStyle("double");
|
||||
await game.classicMode.startBattle([SpeciesId.MIGHTYENA]);
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { getGameMode } from "#app/game-mode";
|
||||
import overrides from "#app/overrides";
|
||||
import { BattleStyle } from "#enums/battle-style";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { GameModes } from "#enums/game-modes";
|
||||
import { Nature } from "#enums/nature";
|
||||
import type { SpeciesId } from "#enums/species-id";
|
||||
@ -100,4 +101,33 @@ export class ClassicModeHelper extends GameManagerHelper {
|
||||
await this.game.phaseInterceptor.to(CommandPhase);
|
||||
console.log("==================[New Turn]==================");
|
||||
}
|
||||
|
||||
/**
|
||||
* Queue inputs to switch at the start of the next battle, and then start it.
|
||||
* @param pokemonIndex - The 0-indexed position of the party pokemon to switch to.
|
||||
* Should never be called with 0 as that will select the currently active pokemon and freeze
|
||||
* @returns A Promise that resolves once the battle has been started and the switch prompt resolved
|
||||
* @todo Make this work for double battles
|
||||
* @example
|
||||
* ```ts
|
||||
* await game.classicMode.runToSummon([SpeciesId.MIGHTYENA, SpeciesId.POOCHYENA])
|
||||
* await game.startBattleWithSwitch(1);
|
||||
* ```
|
||||
*/
|
||||
public async startBattleWithSwitch(pokemonIndex: number): Promise<void> {
|
||||
this.game.scene.battleStyle = BattleStyle.SWITCH;
|
||||
this.game.onNextPrompt(
|
||||
"CheckSwitchPhase",
|
||||
UiMode.CONFIRM,
|
||||
() => {
|
||||
this.game.scene.ui.getHandler().setCursor(0);
|
||||
this.game.scene.ui.getHandler().processInput(Button.ACTION);
|
||||
},
|
||||
() => this.game.isCurrentPhase("CommandPhase") || this.game.isCurrentPhase("TurnInitPhase"),
|
||||
);
|
||||
this.game.doSelectPartyPokemon(pokemonIndex);
|
||||
|
||||
await this.game.phaseInterceptor.to("CommandPhase");
|
||||
console.log("==================[New Battle (Initial Switch)]==================");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user