From dddc7ea04bd8796f5e9e8f930e30ac0629c6d5b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bastos=20Dias?= Date: Thu, 9 Jan 2025 03:25:18 +0000 Subject: [PATCH 1/3] Fix: Tera priority bump and Encore --- sim/battle-actions.ts | 3 ++- test/sim/misc/terastal.js | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/sim/battle-actions.ts b/sim/battle-actions.ts index 4128c3f85d54..aa236665ac76 100644 --- a/sim/battle-actions.ts +++ b/sim/battle-actions.ts @@ -1668,7 +1668,8 @@ export class BattleActions { } if ( - basePower < 60 && source.getTypes(true).includes(move.type) && source.terastallized && move.priority <= 0 && + basePower < 60 && source.getTypes(true).includes(move.type) && source.terastallized && + this.dex.moves.get(move.id).priority <= 0 && // Hard move.basePower check for moves like Dragon Energy that have variable BP !move.multihit && !((move.basePower === 0 || move.basePower === 150) && move.basePowerCallback) ) { diff --git a/test/sim/misc/terastal.js b/test/sim/misc/terastal.js index 85642c411d8d..e407e1d96e9d 100644 --- a/test/sim/misc/terastal.js +++ b/test/sim/misc/terastal.js @@ -166,6 +166,21 @@ describe("Terastallization", function () { battle.makeChoices('move leafage terastallize', 'auto'); assert.bounded(arceus.maxhp - arceus.hp, [38, 45], `Should be a 40 BP no-STAB Leafage`); }); + + it(`shouldn't boost <60 Base Power priority moves forced via Encore`, function () { + battle = common.createBattle([[ + {species: 'hariyama', moves: ['bulletpunch', 'sleeptalk'], teraType: 'Steel'}, + ], [ + {species: 'salazzle ', moves: ['encore', 'sleeptalk']}, + ]]); + + battle.makeChoices('move bulletpunch terastallize', 'move sleeptalk'); + const salazzle = battle.p2.active[0]; + assert.bounded(salazzle.maxhp - salazzle.hp, [38, 45], `Should be a 40 BP STAB Bullet Punch`); + salazzle.hp = salazzle.maxhp; + battle.makeChoices('move sleeptalk', 'move encore'); + assert.bounded(salazzle.maxhp - salazzle.hp, [38, 45], `Should be a 40 BP STAB Bullet Punch`); + }); }); it("should combine with Adaptability for an overall STAB of x2.25", () => { From fb90e67bf24cd79bee2559140b80e73aa3e1423f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bastos=20Dias?= <80102738+andrebastosdias@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:26:13 +0000 Subject: [PATCH 2/3] Line --- sim/battle-actions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sim/battle-actions.ts b/sim/battle-actions.ts index aa236665ac76..a5a596d822fe 100644 --- a/sim/battle-actions.ts +++ b/sim/battle-actions.ts @@ -1669,9 +1669,9 @@ export class BattleActions { if ( basePower < 60 && source.getTypes(true).includes(move.type) && source.terastallized && - this.dex.moves.get(move.id).priority <= 0 && + this.dex.moves.get(move.id).priority <= 0 && !move.multihit && // Hard move.basePower check for moves like Dragon Energy that have variable BP - !move.multihit && !((move.basePower === 0 || move.basePower === 150) && move.basePowerCallback) + !((move.basePower === 0 || move.basePower === 150) && move.basePowerCallback) ) { basePower = 60; } From b7db70f43422d1aec82f984d0261d5d9471a3e92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bastos=20Dias?= <80102738+andrebastosdias@users.noreply.github.com> Date: Fri, 10 Jan 2025 05:40:22 +0000 Subject: [PATCH 3/3] Fix check for multihit --- sim/battle-actions.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sim/battle-actions.ts b/sim/battle-actions.ts index a5a596d822fe..b0bed7756af9 100644 --- a/sim/battle-actions.ts +++ b/sim/battle-actions.ts @@ -1667,9 +1667,10 @@ export class BattleActions { basePower = 0; } + const dexMove = this.dex.moves.get(move.id); if ( basePower < 60 && source.getTypes(true).includes(move.type) && source.terastallized && - this.dex.moves.get(move.id).priority <= 0 && !move.multihit && + dexMove.priority <= 0 && !dexMove.multihit && // Hard move.basePower check for moves like Dragon Energy that have variable BP !((move.basePower === 0 || move.basePower === 150) && move.basePowerCallback) ) {