From 93f6e93fa5fe4f6da326b5b111d82473ab061940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bastos=20Dias?= Date: Sun, 12 Jan 2025 00:36:41 +0000 Subject: [PATCH 1/5] Ogerpon and Terapagos can't transform --- sim/pokemon.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } From f45a7eb2ab1fa6801f3665e47fdcfd5728da67aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bastos=20Dias?= Date: Sun, 12 Jan 2025 00:48:59 +0000 Subject: [PATCH 2/5] Update tests --- test/sim/abilities/terashell.js | 25 ------------------------- test/sim/misc/terapagos.js | 12 +++--------- 2 files changed, 3 insertions(+), 34 deletions(-) diff --git a/test/sim/abilities/terashell.js b/test/sim/abilities/terashell.js index 6625ffee518c..f5ffc3a571a2 100644 --- a/test/sim/abilities/terashell.js +++ b/test/sim/abilities/terashell.js @@ -63,31 +63,6 @@ describe('Tera Shell', function () { assert.bounded(damage, [28, 33], `Tera Shell should not reduce damage, because Tera Shell should be suppressed`); }); - 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']}, - ], [ - {species: 'Terapagos', ability: 'terashift', moves: ['flowertrick']}, - ]]); - - battle.makeChoices(); - const espeon = battle.p1.active[0]; - damage = espeon.maxhp - espeon.hp; - assert.bounded(damage, [33, 39], `Tera Shell should have activated because current species is Terapagos`); - }); - it(`should not weaken the damage from Struggle`, function () { battle = common.createBattle([[ {species: 'Terapagos', ability: 'terashift', moves: ['luckychant']}, diff --git a/test/sim/misc/terapagos.js b/test/sim/misc/terapagos.js index a1276f21a290..a80395401a92 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 Transforme`, 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.throws(() => battle.makeChoices()); }); }); From 1be91d60d446326b7145533ffdd7610e2b6cd33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bastos=20Dias?= Date: Sun, 12 Jan 2025 00:49:54 +0000 Subject: [PATCH 3/5] Spelling error --- test/sim/misc/terapagos.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sim/misc/terapagos.js b/test/sim/misc/terapagos.js index a80395401a92..fc06c0d35122 100644 --- a/test/sim/misc/terapagos.js +++ b/test/sim/misc/terapagos.js @@ -24,7 +24,7 @@ describe(`Terapagos`, function () { assert.false(!!ditto.terastallized); }); - it(`[Hackmons] can't use Transforme`, function () { + it(`[Hackmons] can't use Transform`, function () { battle = common.createBattle([[ {species: 'terapagos', ability: 'terashift', moves: ['transform']}, ], [ From 2975bb6b9f4b9803aad8904361877dc863ba6dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bastos=20Dias?= Date: Sun, 12 Jan 2025 01:00:00 +0000 Subject: [PATCH 4/5] Fix test --- test/sim/misc/terapagos.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/sim/misc/terapagos.js b/test/sim/misc/terapagos.js index fc06c0d35122..2ba840da7b96 100644 --- a/test/sim/misc/terapagos.js +++ b/test/sim/misc/terapagos.js @@ -30,7 +30,7 @@ describe(`Terapagos`, function () { ], [ {species: 'silicobra', moves: ['sleeptalk']}, ]]); - - assert.throws(() => battle.makeChoices()); + battle.makeChoices(); + assert.species(battle.p1.active[0], 'Terapagos-Terastal'); }); }); From bf3cf538d83e20c4c607f3bf613c9bf85402d6ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bastos=20Dias?= Date: Sun, 12 Jan 2025 07:28:30 +0000 Subject: [PATCH 5/5] Re-add deleted test --- test/sim/abilities/terashell.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/sim/abilities/terashell.js b/test/sim/abilities/terashell.js index f5ffc3a571a2..585077dc133c 100644 --- a/test/sim/abilities/terashell.js +++ b/test/sim/abilities/terashell.js @@ -63,6 +63,19 @@ describe('Tera Shell', function () { assert.bounded(damage, [28, 33], `Tera Shell should not reduce damage, because Tera Shell should be suppressed`); }); + it(`should not work if the user's species is not currently Terapagos-Terastal`, function () { + battle = common.createBattle([[ + {species: 'Espeon', moves: ['transform']}, + ], [ + {species: 'Terapagos', ability: 'terashift', moves: ['flowertrick']}, + ]]); + + battle.makeChoices(); + const espeon = battle.p1.active[0]; + const damage = espeon.maxhp - espeon.hp; + assert.bounded(damage, [33, 39], `Tera Shell should have activated because current species is Terapagos`); + }); + it(`should not weaken the damage from Struggle`, function () { battle = common.createBattle([[ {species: 'Terapagos', ability: 'terashift', moves: ['luckychant']},