mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-19 22:09:27 +02:00
Make substitute use the move tag
This commit is contained in:
parent
55b8429787
commit
0112244de2
@ -3090,7 +3090,7 @@ export class SubstituteTag extends SerializableBattlerTag {
|
|||||||
constructor(sourceMove: MoveId, sourceId: number) {
|
constructor(sourceMove: MoveId, sourceId: number) {
|
||||||
super(
|
super(
|
||||||
BattlerTagType.SUBSTITUTE,
|
BattlerTagType.SUBSTITUTE,
|
||||||
[BattlerTagLapseType.PRE_MOVE, BattlerTagLapseType.AFTER_MOVE, BattlerTagLapseType.HIT],
|
[BattlerTagLapseType.MOVE, BattlerTagLapseType.AFTER_MOVE, BattlerTagLapseType.HIT],
|
||||||
0,
|
0,
|
||||||
sourceMove,
|
sourceMove,
|
||||||
sourceId,
|
sourceId,
|
||||||
|
@ -142,7 +142,7 @@ describe("BattlerTag - SubstituteTag", () => {
|
|||||||
vi.spyOn(messages, "getPokemonNameWithAffix").mockReturnValue("");
|
vi.spyOn(messages, "getPokemonNameWithAffix").mockReturnValue("");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("PRE_MOVE lapse triggers pre-move animation", async () => {
|
it("MOVE lapse triggers pre-move animation", async () => {
|
||||||
const subject = new SubstituteTag(MoveId.SUBSTITUTE, mockPokemon.id);
|
const subject = new SubstituteTag(MoveId.SUBSTITUTE, mockPokemon.id);
|
||||||
|
|
||||||
vi.spyOn(mockPokemon.scene as BattleScene, "triggerPokemonBattleAnim").mockImplementation(
|
vi.spyOn(mockPokemon.scene as BattleScene, "triggerPokemonBattleAnim").mockImplementation(
|
||||||
@ -154,7 +154,7 @@ describe("BattlerTag - SubstituteTag", () => {
|
|||||||
|
|
||||||
vi.spyOn((mockPokemon.scene as BattleScene).phaseManager, "queueMessage").mockReturnValue();
|
vi.spyOn((mockPokemon.scene as BattleScene).phaseManager, "queueMessage").mockReturnValue();
|
||||||
|
|
||||||
expect(subject.lapse(mockPokemon, BattlerTagLapseType.PRE_MOVE)).toBeTruthy();
|
expect(subject.lapse(mockPokemon, BattlerTagLapseType.MOVE)).toBeTruthy();
|
||||||
|
|
||||||
expect(subject.sourceInFocus).toBeTruthy();
|
expect(subject.sourceInFocus).toBeTruthy();
|
||||||
expect((mockPokemon.scene as BattleScene).triggerPokemonBattleAnim).toHaveBeenCalledTimes(1);
|
expect((mockPokemon.scene as BattleScene).triggerPokemonBattleAnim).toHaveBeenCalledTimes(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user