diff --git a/play.pokemonshowdown.com/src/battle-animations.ts b/play.pokemonshowdown.com/src/battle-animations.ts index d07e134fe4..bfd625f48a 100644 --- a/play.pokemonshowdown.com/src/battle-animations.ts +++ b/play.pokemonshowdown.com/src/battle-animations.ts @@ -1489,8 +1489,8 @@ export class BattleScene implements BattleSceneStub { updateStatbarIfExists(pokemon: Pokemon, updatePrevhp?: boolean, updateHp?: boolean) { return pokemon.sprite.updateStatbarIfExists(pokemon, updatePrevhp, updateHp); } - animTransform(pokemon: Pokemon, isCustomAnim?: boolean, isPermanent?: boolean) { - return pokemon.sprite.animTransform(pokemon, isCustomAnim, isPermanent); + animTransform(pokemon: Pokemon, isCustomAnim?: boolean, isPermanent?: boolean, noAnim?: boolean) { + return pokemon.sprite.animTransform(pokemon, isCustomAnim, isPermanent, noAnim); } clearEffects(pokemon: Pokemon) { return pokemon.sprite.clearEffects(); @@ -2473,7 +2473,7 @@ export class PokemonSprite extends Sprite { }); } } - animTransform(pokemon: Pokemon, isCustomAnim?: boolean, isPermanent?: boolean) { + animTransform(pokemon: Pokemon, isCustomAnim?: boolean, isPermanent?: boolean, noAnim?: boolean) { if (!this.scene.animating && !isPermanent) return; let sp = Dex.getSpriteData(pokemon, this.isFrontSprite, { gen: this.scene.gen, @@ -2498,6 +2498,16 @@ export class PokemonSprite extends Sprite { this.cryurl = sp.cryurl; if (!this.scene.animating) return; + + if (noAnim) { + if (isPermanent) { + this.resetStatbar(pokemon); + } else { + this.updateStatbar(pokemon); + } + return; + } + let speciesid = toID(pokemon.getSpeciesForme()); let doCry = false; const scene = this.scene; diff --git a/play.pokemonshowdown.com/src/battle-scene-stub.ts b/play.pokemonshowdown.com/src/battle-scene-stub.ts index 44b2ab4189..4b4f8da40a 100644 --- a/play.pokemonshowdown.com/src/battle-scene-stub.ts +++ b/play.pokemonshowdown.com/src/battle-scene-stub.ts @@ -67,7 +67,7 @@ export class BattleSceneStub { resetStatbar(pokemon: Pokemon, startHidden?: boolean) { } updateStatbar(pokemon: Pokemon, updatePrevhp?: boolean, updateHp?: boolean) { } updateStatbarIfExists(pokemon: Pokemon, updatePrevhp?: boolean, updateHp?: boolean) { } - animTransform(pokemon: Pokemon, isCustomAnim?: boolean, isPermanent?: boolean) { } + animTransform(pokemon: Pokemon, isCustomAnim?: boolean, isPermanent?: boolean, noAnim?: boolean) { } clearEffects(pokemon: Pokemon) { } removeTransform(pokemon: Pokemon) { } animFaint(pokemon: Pokemon) { } diff --git a/play.pokemonshowdown.com/src/battle.ts b/play.pokemonshowdown.com/src/battle.ts index 04ca1b915a..5e553c7fe8 100644 --- a/play.pokemonshowdown.com/src/battle.ts +++ b/play.pokemonshowdown.com/src/battle.ts @@ -2434,12 +2434,15 @@ export class Battle { newSpeciesForme = args[2].substr(0, commaIndex); } let species = this.dex.species.get(newSpeciesForme); + let teraHangry = false; if (nextArgs) { if (nextArgs[0] === '-mega') { species = this.dex.species.get(this.dex.items.get(nextArgs[3]).megaStone); } else if (nextArgs[0] === '-primal' && nextArgs.length > 2) { if (nextArgs[2] === 'Red Orb') species = this.dex.species.get('Groudon-Primal'); if (nextArgs[2] === 'Blue Orb') species = this.dex.species.get('Kyogre-Primal'); + } else if (nextArgs[0] === '-terastallize' && species.id === 'morpekohangry') { + teraHangry = true; } } @@ -2450,7 +2453,7 @@ export class Battle { poke.searchid = args[1].substr(0, 2) + args[1].substr(3) + '|' + args[2]; let isCustomAnim = species.id !== 'palafinhero'; - this.scene.animTransform(poke, isCustomAnim, true); + this.scene.animTransform(poke, isCustomAnim, true, teraHangry); this.log(args, kwArgs); break; }