Make substitute use the move tag

This commit is contained in:
Sirz Benjie 2025-08-18 22:33:48 -05:00
parent 55b8429787
commit 0112244de2
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E
2 changed files with 3 additions and 3 deletions

View File

@ -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,

View File

@ -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);