diff --git a/sim/pokemon.ts b/sim/pokemon.ts index dbffa6995071..6b6503ac6317 100644 --- a/sim/pokemon.ts +++ b/sim/pokemon.ts @@ -1222,8 +1222,9 @@ export class Pokemon { const species = pokemon.species; if (pokemon.fainted || this.illusion || pokemon.illusion || (pokemon.volatiles['substitute'] && this.battle.gen >= 5) || (pokemon.transformed && this.battle.gen >= 2) || (this.transformed && this.battle.gen >= 5) || - species.name === 'Eternatus-Eternamax' || (['Ogerpon', 'Terapagos'].includes(species.baseSpecies) && - (this.terastallized || pokemon.terastallized)) || this.terastallized === 'Stellar') { + species.name === 'Eternatus-Eternamax' || ['Ogerpon', 'Terapagos'].includes(this.species.baseSpecies) || + (['Ogerpon', 'Terapagos'].includes(species.baseSpecies) && (this.terastallized || pokemon.terastallized)) || + this.terastallized === 'Stellar') { return false; } diff --git a/test/sim/abilities/terashell.js b/test/sim/abilities/terashell.js index 6625ffee518c..585077dc133c 100644 --- a/test/sim/abilities/terashell.js +++ b/test/sim/abilities/terashell.js @@ -64,18 +64,6 @@ describe('Tera Shell', function () { }); it(`should not work if the user's species is not currently Terapagos-Terastal`, function () { - battle = common.createBattle([[ - {species: 'Terapagos', ability: 'terashift', moves: ['transform']}, - ], [ - {species: 'Umbreon', ability: 'terashell', moves: ['flowertrick']}, - ]]); - - battle.makeChoices(); - const terapagos = battle.p1.active[0]; - let damage = terapagos.maxhp - terapagos.hp; - assert.bounded(damage, [51, 60], `Tera Shell should not have activated because current species is not Terapagos`); - - battle = common.createBattle([[ {species: 'Espeon', moves: ['transform']}, ], [ @@ -84,7 +72,7 @@ describe('Tera Shell', function () { battle.makeChoices(); const espeon = battle.p1.active[0]; - damage = espeon.maxhp - espeon.hp; + const damage = espeon.maxhp - espeon.hp; assert.bounded(damage, [33, 39], `Tera Shell should have activated because current species is Terapagos`); }); diff --git a/test/sim/misc/terapagos.js b/test/sim/misc/terapagos.js index a1276f21a290..2ba840da7b96 100644 --- a/test/sim/misc/terapagos.js +++ b/test/sim/misc/terapagos.js @@ -24,19 +24,13 @@ describe(`Terapagos`, function () { assert.false(!!ditto.terastallized); }); - it(`[Hackmons] should not cause Terapagos-Terastal to become Terapagos-Stellar if the user is Transformed`, function () { + it(`[Hackmons] can't use Transform`, function () { battle = common.createBattle([[ - {species: 'terapagos', ability: 'terashift', moves: ['transform'], teraType: 'Stellar'}, - {species: 'pikachu', moves: ['sleeptalk']}, + {species: 'terapagos', ability: 'terashift', moves: ['transform']}, ], [ {species: 'silicobra', moves: ['sleeptalk']}, ]]); - battle.makeChoices(); - battle.makeChoices('move sleeptalk terastallize', 'auto'); - battle.makeChoices('switch 2', 'auto'); - battle.makeChoices('switch 2', 'auto'); - const terapagos = battle.p1.active[0]; - assert.species(terapagos, 'Terapagos-Terastal'); + assert.species(battle.p1.active[0], 'Terapagos-Terastal'); }); });