Reverted bool change + fixed test

This commit is contained in:
Bertie690 2025-05-22 08:38:17 -04:00
parent df3b386625
commit 2efb2ec375
2 changed files with 4 additions and 3 deletions

View File

@ -1366,7 +1366,7 @@ export class PreMoveMessageAttr extends MoveAttr {
* @param message - The message to display before move use, either as a string or a function producing one. * @param message - The message to display before move use, either as a string or a function producing one.
* @remarks * @remarks
* If {@linkcode message} evaluates to an empty string (`''`), no message will be displayed * If {@linkcode message} evaluates to an empty string (`''`), no message will be displayed
* (though the move will still suceed). * (though the move will still succeed).
*/ */
constructor(message: string | ((user: Pokemon, target: Pokemon, move: Move) => string)) { constructor(message: string | ((user: Pokemon, target: Pokemon, move: Move) => string)) {
super(); super();
@ -1380,8 +1380,9 @@ export class PreMoveMessageAttr extends MoveAttr {
if (message) { if (message) {
globalScene.queueMessage(message, 500); globalScene.queueMessage(message, 500);
return true;
} }
return true; return false;
} }
} }

View File

@ -115,7 +115,7 @@ describe("Moves - Chilly Reception", () => {
); );
}); });
it("should not display message if called indirectly", async () => { it("should succeed without message if called indirectly", async () => {
vi.spyOn(RandomMoveAttr.prototype, "getMoveOverride").mockReturnValue(Moves.CHILLY_RECEPTION); vi.spyOn(RandomMoveAttr.prototype, "getMoveOverride").mockReturnValue(Moves.CHILLY_RECEPTION);
await game.classicMode.startBattle([Species.SLOWKING, Species.MEOWTH]); await game.classicMode.startBattle([Species.SLOWKING, Species.MEOWTH]);