From 20e9a1e761898a94b39573f8e8b07377796c3a5f Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sun, 10 Mar 2024 00:14:09 -0500 Subject: [PATCH] Fix grassy terrain heal being applied to all terrains --- src/field/arena.ts | 14 -------------- src/field/pokemon.ts | 2 +- src/phases.ts | 3 ++- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/field/arena.ts b/src/field/arena.ts index d4c636008..35abdbd21 100644 --- a/src/field/arena.ts +++ b/src/field/arena.ts @@ -285,20 +285,6 @@ export class Arena { this.scene.queueMessage(getTerrainStartMessage(terrain)); } else this.scene.queueMessage(getTerrainClearMessage(oldTerrainType)); - /*[ - this.scene.arenaBg, - this.scene.arenaBgTransition, - this.scene.arenaPlayer.base, - this.scene.arenaPlayer.props, - this.scene.arenaPlayerTransition.base, - this.scene.arenaPlayerTransition.props, - this.scene.arenaEnemy.base, - this.scene.arenaEnemy.props, - this.scene.arenaNextEnemy.base, - this.scene.arenaNextEnemy.props - ] - .flat() - .map(a => a.pipelineData['terrainColor'] = getTerrainColor());*/ return true; } diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index a62011b7d..3277096e8 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -48,7 +48,7 @@ export enum FieldPosition { } const ABILITY_OVERRIDE = Abilities.NONE; -const MOVE_OVERRIDE = Moves.NONE;; +const MOVE_OVERRIDE = Moves.NONE; const OPP_ABILITY_OVERRIDE = Abilities.NONE; const OPP_MOVE_OVERRIDE = Moves.NONE; diff --git a/src/phases.ts b/src/phases.ts index 4d800231f..02d1473ca 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -51,6 +51,7 @@ import { battleSpecDialogue, getCharVariantFromDialogue } from "./data/dialogue" import ModifierSelectUiHandler, { SHOP_OPTIONS_ROW_LIMIT } from "./ui/modifier-select-ui-handler"; import { Setting } from "./system/settings"; import { Tutorial, handleTutorial } from "./tutorial"; +import { TerrainType } from "./data/terrain"; export class LoginPhase extends Phase { private showText: boolean; @@ -1744,7 +1745,7 @@ export class TurnEndPhase extends FieldPhase { this.scene.applyModifier(EnemyStatusEffectHealChanceModifier, false, pokemon); } - if (this.scene.arena.terrain && pokemon.isGrounded()) { + if (this.scene.arena.terrain?.terrainType === TerrainType.GRASSY && pokemon.isGrounded()) { this.scene.unshiftPhase(new PokemonHealPhase(this.scene, pokemon.getBattlerIndex(), Math.max(pokemon.getMaxHp() >> 4, 1), getPokemonMessage(pokemon, ' regained\nhealth from the Grassy Terrain!'), true)); }