Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Terastallization base power buff for priority moves called by Encore #10808

Merged
merged 3 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions sim/battle-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1667,10 +1667,12 @@ export class BattleActions {
basePower = 0;
}

const dexMove = this.dex.moves.get(move.id);
if (
basePower < 60 && source.getTypes(true).includes(move.type) && source.terastallized && move.priority <= 0 &&
basePower < 60 && source.getTypes(true).includes(move.type) && source.terastallized &&
dexMove.priority <= 0 && !dexMove.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;
}
Expand Down
15 changes: 15 additions & 0 deletions test/sim/misc/terastal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand Down
Loading