Skip to content

Commit

Permalink
Ignore ability in Tera Blast stat check.
Browse files Browse the repository at this point in the history
  • Loading branch information
vingkan committed Dec 27, 2023
1 parent 21e5ede commit 081ffba
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
14 changes: 13 additions & 1 deletion data/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19954,9 +19954,21 @@ export const Moves: {[moveid: string]: MoveData} = {
}
},
onModifyMove(move, pokemon) {
if (pokemon.terastallized && pokemon.getStat('atk', false, true) > pokemon.getStat('spa', false, true)) {
if (!pokemon.terastallized) return;

// When checking the attacker's stats to determine move category, ignore abilities that
// change the stat stage boosts at calculation time. This will not ignore abilities whose
// stat stage changes have already been applied to the boost table.
const originalIgnoreAbility = move.ignoreAbility;
move.ignoreAbility = true;
const unModifiedAtk = pokemon.getStat('atk', false, true);
const unModifiedSpAtk = pokemon.getStat('spa', false, true);
// Reset the move so that the target's abilities will be applied in damage calculation.
move.ignoreAbility = originalIgnoreAbility;
if (unModifiedAtk > unModifiedSpAtk) {
move.category = 'Physical';
}

if (pokemon.terastallized === 'Stellar') {
move.self = {boosts: {atk: -1, spa: -1}};
}
Expand Down
3 changes: 1 addition & 2 deletions test/sim/moves/terablast.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ describe('Tera Blast', function () {
assert.equal(battle.p1.pokemon[0].lastMove.category, 'Special');
});

// Skipped until https://github.com/smogon/pokemon-showdown/issues/9381 is fixed.
it.skip(`should be a special attack when terastallized even if target ignores stat changes`, function () {
it(`should be a special attack when terastallized even if target ignores stat changes`, function () {
const battle = common.createBattle([[
// Regidrago has equal base attack and special attack stats.
{species: 'regidrago', ability: 'dragonsmaw', moves: ['terablast', 'dragondance']},
Expand Down

0 comments on commit 081ffba

Please sign in to comment.