add helper for forcing AI move targetting
This commit is contained in:
parent
1bb79b87f6
commit
c31809ed35
|
@ -1,6 +1,8 @@
|
||||||
import { vi } from "vitest";
|
import { vi } from "vitest";
|
||||||
import { MoveEffectPhase } from "#app/phases.js";
|
import { MoveEffectPhase } from "#app/phases.js";
|
||||||
import { GameManagerHelper } from "./gameManagerHelper";
|
import { GameManagerHelper } from "./gameManagerHelper";
|
||||||
|
import { BattlerIndex } from "#app/battle.js";
|
||||||
|
import { EnemyPokemon } from "#app/field/pokemon.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper to handle a Pokemon's move
|
* Helper to handle a Pokemon's move
|
||||||
|
@ -32,4 +34,13 @@ export class MoveHelper extends GameManagerHelper {
|
||||||
hitCheck.mockReturnValue(false);
|
hitCheck.mockReturnValue(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Forces an enemy Pokemon to attack into a certain slot
|
||||||
|
* @param pokemon Pokemon to force the attack of
|
||||||
|
* @param slot BattlerIndex to force the attack into
|
||||||
|
*/
|
||||||
|
forceAiTargets(pokemon: EnemyPokemon | undefined, slot: BattlerIndex | BattlerIndex[]) {
|
||||||
|
vi.spyOn(pokemon!, "getNextTargets").mockReturnValue(Array.isArray(slot) ? slot : [slot]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue