From 900113a03fea34086d88643e9862f6b6396a7810 Mon Sep 17 00:00:00 2001 From: Jesse Lerner Date: Mon, 20 May 2024 23:03:07 -0400 Subject: [PATCH] Added comments to PostTerrainTypeChangeAttr --- src/data/ability.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 36192e2ddd8..66e9e3daf2d 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -2148,16 +2148,16 @@ export class PostTerrainChangeTypeAttr extends PostTerrainChangeAbAttr { applyPostTerrainChange(pokemon: Pokemon, passive: boolean, terrain: TerrainType, args: any[]): boolean { - if (this.terrainToTypeMap[terrain] == Type.UNKNOWN) { - if (pokemon.summonData.types == null) return false; - pokemon.summonData.types = null; - pokemon.updateInfo(); + if (this.terrainToTypeMap[terrain] == Type.UNKNOWN) { //If no type is given, transform back to original type + if (pokemon.summonData.types == null) return false; //If already original type, ability did not activate + pokemon.summonData.types = null; //Clear any changed type + pokemon.updateInfo(); //Update info to apply change pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` transformed\nback into its original type!`)); return true; } - pokemon.summonData.types = [this.terrainToTypeMap[terrain]] - pokemon.updateInfo(); + pokemon.summonData.types = [this.terrainToTypeMap[terrain]] //Changes type to the specified type based on the record + pokemon.updateInfo(); //Apply changes pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` transformed\ninto the ${Utils.toReadableString(Type[pokemon.getTypes()[0]])} type!`)); return true; }