From 6c05ea1b5e50483af52383c2bc75ae0de5ade807 Mon Sep 17 00:00:00 2001 From: Kaen <66154904+Seerd@users.noreply.github.com> Date: Wed, 30 Aug 2023 14:04:03 -0400 Subject: [PATCH 1/2] End Terastallize Needed for https://github.com/smogon/pokemon-showdown/pull/9701 --- play.pokemonshowdown.com/src/battle.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/play.pokemonshowdown.com/src/battle.ts b/play.pokemonshowdown.com/src/battle.ts index 04ca1b915a..41042cf548 100644 --- a/play.pokemonshowdown.com/src/battle.ts +++ b/play.pokemonshowdown.com/src/battle.ts @@ -2529,6 +2529,18 @@ export class Battle { this.log(args, kwArgs); break; } + case '-endTerastallize': { + let poke = this.getPokemon(args[1])!; + poke.removeVolatile('terastallize' as ID); + poke.teraType = ''; + poke.terastallized = ''; + poke.details = poke.details.replace(/, tera:[a-z]+/i, ''); + poke.searchid = poke.searchid.replace(/, tera:[a-z]+/i, ''); + this.scene.animTransform(poke, true); + this.scene.resetStatbar(poke); + this.log(args, kwArgs); + break; + } case '-start': { let poke = this.getPokemon(args[1])!; let effect = Dex.getEffect(args[2]); From c6f7ca33ed25011923f639b346d3b10d054a8c6f Mon Sep 17 00:00:00 2001 From: Kris Johnson <11083252+KrisXV@users.noreply.github.com> Date: Mon, 26 Feb 2024 13:49:30 -0700 Subject: [PATCH 2/2] Update battle.ts --- play.pokemonshowdown.com/src/battle.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/play.pokemonshowdown.com/src/battle.ts b/play.pokemonshowdown.com/src/battle.ts index 41042cf548..61069881fb 100644 --- a/play.pokemonshowdown.com/src/battle.ts +++ b/play.pokemonshowdown.com/src/battle.ts @@ -2529,16 +2529,18 @@ export class Battle { this.log(args, kwArgs); break; } - case '-endTerastallize': { - let poke = this.getPokemon(args[1])!; - poke.removeVolatile('terastallize' as ID); - poke.teraType = ''; - poke.terastallized = ''; - poke.details = poke.details.replace(/, tera:[a-z]+/i, ''); - poke.searchid = poke.searchid.replace(/, tera:[a-z]+/i, ''); - this.scene.animTransform(poke, true); - this.scene.resetStatbar(poke); - this.log(args, kwArgs); + case '-custom': { + let poke = this.getPokemon(args[2])!; + if (args[1] && args[1] === 'endterastallize') { + poke.removeVolatile('terastallize' as ID); + poke.teraType = ''; + poke.terastallized = ''; + poke.details = poke.details.replace(/, tera:[a-z]+/i, ''); + poke.searchid = poke.searchid.replace(/, tera:[a-z]+/i, ''); + this.scene.animTransform(poke); + this.scene.resetStatbar(poke); + this.log(args, kwArgs); + } break; } case '-start': {