mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-23 07:49:36 +02:00
PR Feedback
This commit is contained in:
parent
eac0d75c26
commit
11c84cbe0c
@ -30,12 +30,12 @@ export class FaintPhase extends PokemonPhase {
|
|||||||
/**
|
/**
|
||||||
* Destiny Bond tag belonging to the currently fainting Pokemon, if applicable
|
* Destiny Bond tag belonging to the currently fainting Pokemon, if applicable
|
||||||
*/
|
*/
|
||||||
private destinyTag: DestinyBondTag | undefined;
|
private destinyTag?: DestinyBondTag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The source that dealt fatal damage and should get KO'd by Destiny Bond, if applicable
|
* The source Pokemon that dealt fatal damage and should get KO'd by Destiny Bond, if applicable
|
||||||
*/
|
*/
|
||||||
private source: Pokemon | undefined;
|
private source?: Pokemon;
|
||||||
|
|
||||||
constructor(scene: BattleScene, battlerIndex: BattlerIndex, preventEndure: boolean = false, destinyTag?: DestinyBondTag, source?: Pokemon) {
|
constructor(scene: BattleScene, battlerIndex: BattlerIndex, preventEndure: boolean = false, destinyTag?: DestinyBondTag, source?: Pokemon) {
|
||||||
super(scene, battlerIndex);
|
super(scene, battlerIndex);
|
||||||
|
@ -43,7 +43,7 @@ describe("Moves - Destiny Bond", () => {
|
|||||||
|
|
||||||
it("should KO the opponent on the same turn", async () => {
|
it("should KO the opponent on the same turn", async () => {
|
||||||
const moveToUse = Moves.TACKLE;
|
const moveToUse = Moves.TACKLE;
|
||||||
vi.spyOn(allMoves[moveToUse], "accuracy", "get").mockReturnValue(100);
|
|
||||||
game.override.moveset(moveToUse);
|
game.override.moveset(moveToUse);
|
||||||
await game.classicMode.startBattle(defaultParty);
|
await game.classicMode.startBattle(defaultParty);
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ describe("Moves - Destiny Bond", () => {
|
|||||||
|
|
||||||
it("should KO the opponent on the next turn", async () => {
|
it("should KO the opponent on the next turn", async () => {
|
||||||
const moveToUse = Moves.TACKLE;
|
const moveToUse = Moves.TACKLE;
|
||||||
vi.spyOn(allMoves[moveToUse], "accuracy", "get").mockReturnValue(100);
|
|
||||||
game.override.moveset([ Moves.SPLASH, moveToUse ]);
|
game.override.moveset([ Moves.SPLASH, moveToUse ]);
|
||||||
await game.classicMode.startBattle(defaultParty);
|
await game.classicMode.startBattle(defaultParty);
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ describe("Moves - Destiny Bond", () => {
|
|||||||
|
|
||||||
it("should fail if used twice in a row", async () => {
|
it("should fail if used twice in a row", async () => {
|
||||||
const moveToUse = Moves.TACKLE;
|
const moveToUse = Moves.TACKLE;
|
||||||
vi.spyOn(allMoves[moveToUse], "accuracy", "get").mockReturnValue(100);
|
|
||||||
game.override.moveset([ Moves.SPLASH, moveToUse ]);
|
game.override.moveset([ Moves.SPLASH, moveToUse ]);
|
||||||
await game.classicMode.startBattle(defaultParty);
|
await game.classicMode.startBattle(defaultParty);
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ describe("Moves - Destiny Bond", () => {
|
|||||||
it("should not KO the opponent if the user dies to weather", async () => {
|
it("should not KO the opponent if the user dies to weather", async () => {
|
||||||
// Opponent will be reduced to 1 HP by False Swipe, then faint to Sandstorm
|
// Opponent will be reduced to 1 HP by False Swipe, then faint to Sandstorm
|
||||||
const moveToUse = Moves.FALSE_SWIPE;
|
const moveToUse = Moves.FALSE_SWIPE;
|
||||||
vi.spyOn(allMoves[moveToUse], "accuracy", "get").mockReturnValue(100);
|
|
||||||
game.override.moveset(moveToUse)
|
game.override.moveset(moveToUse)
|
||||||
.ability(Abilities.SAND_STREAM);
|
.ability(Abilities.SAND_STREAM);
|
||||||
await game.classicMode.startBattle(defaultParty);
|
await game.classicMode.startBattle(defaultParty);
|
||||||
@ -131,7 +131,7 @@ describe("Moves - Destiny Bond", () => {
|
|||||||
|
|
||||||
it("should not KO the opponent if the user had another turn", async () => {
|
it("should not KO the opponent if the user had another turn", async () => {
|
||||||
const moveToUse = Moves.TACKLE;
|
const moveToUse = Moves.TACKLE;
|
||||||
vi.spyOn(allMoves[moveToUse], "accuracy", "get").mockReturnValue(100);
|
|
||||||
game.override.moveset([ Moves.SPORE, moveToUse ]);
|
game.override.moveset([ Moves.SPORE, moveToUse ]);
|
||||||
await game.classicMode.startBattle(defaultParty);
|
await game.classicMode.startBattle(defaultParty);
|
||||||
|
|
||||||
@ -157,9 +157,7 @@ describe("Moves - Destiny Bond", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should not KO an ally", async () => {
|
it("should not KO an ally", async () => {
|
||||||
const movesToUse = [ Moves.DESTINY_BOND, Moves.CRUNCH ];
|
game.override.moveset([ Moves.DESTINY_BOND, Moves.CRUNCH ])
|
||||||
vi.spyOn(allMoves[movesToUse[1]], "accuracy", "get").mockReturnValue(100);
|
|
||||||
game.override.moveset(movesToUse)
|
|
||||||
.battleType("double");
|
.battleType("double");
|
||||||
await game.classicMode.startBattle([ Species.SHEDINJA, Species.BULBASAUR, Species.SQUIRTLE ]);
|
await game.classicMode.startBattle([ Species.SHEDINJA, Species.BULBASAUR, Species.SQUIRTLE ]);
|
||||||
|
|
||||||
@ -168,9 +166,10 @@ describe("Moves - Destiny Bond", () => {
|
|||||||
const playerPokemon0 = game.scene.getPlayerField()[0];
|
const playerPokemon0 = game.scene.getPlayerField()[0];
|
||||||
const playerPokemon1 = game.scene.getPlayerField()[1];
|
const playerPokemon1 = game.scene.getPlayerField()[1];
|
||||||
|
|
||||||
game.move.select(movesToUse[0], 0);
|
// Shedinja uses Destiny Bond, then ally Bulbasaur KO's Shedinja with Crunch
|
||||||
game.move.select(movesToUse[1], 1, BattlerIndex.PLAYER);
|
game.move.select(Moves.DESTINY_BOND, 0);
|
||||||
await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.ENEMY_2, BattlerIndex.PLAYER, BattlerIndex.PLAYER_2 ]);
|
game.move.select(Moves.CRUNCH, 1, BattlerIndex.PLAYER);
|
||||||
|
await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY, BattlerIndex.ENEMY_2 ]);
|
||||||
await game.phaseInterceptor.to("BerryPhase");
|
await game.phaseInterceptor.to("BerryPhase");
|
||||||
|
|
||||||
expect(enemyPokemon0?.isFainted()).toBe(false);
|
expect(enemyPokemon0?.isFainted()).toBe(false);
|
||||||
@ -182,6 +181,7 @@ describe("Moves - Destiny Bond", () => {
|
|||||||
it("should not cause a crash if the user is KO'd by Ceaseless Edge", async () => {
|
it("should not cause a crash if the user is KO'd by Ceaseless Edge", async () => {
|
||||||
const moveToUse = Moves.CEASELESS_EDGE;
|
const moveToUse = Moves.CEASELESS_EDGE;
|
||||||
vi.spyOn(allMoves[moveToUse], "accuracy", "get").mockReturnValue(100);
|
vi.spyOn(allMoves[moveToUse], "accuracy", "get").mockReturnValue(100);
|
||||||
|
|
||||||
game.override.moveset(moveToUse);
|
game.override.moveset(moveToUse);
|
||||||
await game.classicMode.startBattle(defaultParty);
|
await game.classicMode.startBattle(defaultParty);
|
||||||
|
|
||||||
@ -202,10 +202,7 @@ describe("Moves - Destiny Bond", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should not cause a crash if the user is KO'd by Pledge moves", async () => {
|
it("should not cause a crash if the user is KO'd by Pledge moves", async () => {
|
||||||
const movesToUse = [ Moves.GRASS_PLEDGE, Moves.WATER_PLEDGE ];
|
game.override.moveset([ Moves.GRASS_PLEDGE, Moves.WATER_PLEDGE ])
|
||||||
vi.spyOn(allMoves[movesToUse[0]], "accuracy", "get").mockReturnValue(100);
|
|
||||||
vi.spyOn(allMoves[movesToUse[1]], "accuracy", "get").mockReturnValue(100);
|
|
||||||
game.override.moveset(movesToUse)
|
|
||||||
.battleType("double");
|
.battleType("double");
|
||||||
await game.classicMode.startBattle(defaultParty);
|
await game.classicMode.startBattle(defaultParty);
|
||||||
|
|
||||||
@ -214,8 +211,8 @@ describe("Moves - Destiny Bond", () => {
|
|||||||
const playerPokemon0 = game.scene.getPlayerField()[0];
|
const playerPokemon0 = game.scene.getPlayerField()[0];
|
||||||
const playerPokemon1 = game.scene.getPlayerField()[1];
|
const playerPokemon1 = game.scene.getPlayerField()[1];
|
||||||
|
|
||||||
game.move.select(movesToUse[0], 0, BattlerIndex.ENEMY);
|
game.move.select(Moves.GRASS_PLEDGE, 0, BattlerIndex.ENEMY);
|
||||||
game.move.select(movesToUse[1], 1, BattlerIndex.ENEMY);
|
game.move.select(Moves.WATER_PLEDGE, 1, BattlerIndex.ENEMY);
|
||||||
await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.ENEMY_2, BattlerIndex.PLAYER, BattlerIndex.PLAYER_2 ]);
|
await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.ENEMY_2, BattlerIndex.PLAYER, BattlerIndex.PLAYER_2 ]);
|
||||||
await game.phaseInterceptor.to("BerryPhase");
|
await game.phaseInterceptor.to("BerryPhase");
|
||||||
|
|
||||||
@ -236,7 +233,7 @@ describe("Moves - Destiny Bond", () => {
|
|||||||
*/
|
*/
|
||||||
it("should not allow the opponent to revive via Reviver Seed", async () => {
|
it("should not allow the opponent to revive via Reviver Seed", async () => {
|
||||||
const moveToUse = Moves.TACKLE;
|
const moveToUse = Moves.TACKLE;
|
||||||
vi.spyOn(allMoves[moveToUse], "accuracy", "get").mockReturnValue(100);
|
|
||||||
game.override.moveset(moveToUse)
|
game.override.moveset(moveToUse)
|
||||||
.startingHeldItems([{ name: "REVIVER_SEED" }]);
|
.startingHeldItems([{ name: "REVIVER_SEED" }]);
|
||||||
await game.classicMode.startBattle(defaultParty);
|
await game.classicMode.startBattle(defaultParty);
|
||||||
|
Loading…
Reference in New Issue
Block a user