From ddd0c769f2e08c38364eb80168ce7f57e9e717e9 Mon Sep 17 00:00:00 2001 From: frutescens Date: Sun, 17 Nov 2024 16:24:30 -0800 Subject: [PATCH] Revert "Created new Modifier class MoveEffectModifier" This reverts commit 0e57ed03ff7c0e6fb59c7b3c2ea74b6fe6327f59. --- src/modifier/modifier.ts | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index bd85ef0c608..c776335a939 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -756,32 +756,6 @@ export abstract class PokemonHeldItemModifier extends PersistentModifier { abstract getMaxHeldItemCount(pokemon?: Pokemon): number; } -export class MoveEffectModifier extends PokemonHeldItemModifier { - constructor(type: ModifierType, pokemonId: number, stackCount?: number) { - super(type, pokemonId, stackCount); - } - - matchType(modifier: Modifier): boolean { - return this.matchType(modifier); - } - - shouldApply(pokemon?: Pokemon, ..._args: unknown[]): boolean { - return pokemon?.hasAbility(Abilities.SHEER_FORCE, true) ?? false; - } - - apply(pokemon: Pokemon): boolean { - return this.apply(pokemon); - } - - getMaxHeldItemCount(pokemon?: Pokemon): number { - return this.getMaxHeldItemCount(pokemon); - } - - clone() { - return this.clone(); - } -} - export abstract class LapsingPokemonHeldItemModifier extends PokemonHeldItemModifier { protected battlesLeft: number; public isTransferable: boolean = false; @@ -1776,7 +1750,7 @@ export class TurnStatusEffectModifier extends PokemonHeldItemModifier { } } -export class HitHealModifier extends MoveEffectModifier { +export class HitHealModifier extends PokemonHeldItemModifier { constructor(type: ModifierType, pokemonId: number, stackCount?: number) { super(type, pokemonId, stackCount); } @@ -1795,7 +1769,7 @@ export class HitHealModifier extends MoveEffectModifier { * @returns `true` if the {@linkcode Pokemon} was healed */ override apply(pokemon: Pokemon): boolean { - if (pokemon.turnData.totalDamageDealt && !pokemon.isFullHp()) { + if (pokemon.turnData.totalDamageDealt && !pokemon.isFullHp() && !pokemon.hasAbility(Abilities.SHEER_FORCE, true)) { const scene = pokemon.scene; scene.unshiftPhase(new PokemonHealPhase(scene, pokemon.getBattlerIndex(), toDmgValue(pokemon.turnData.totalDamageDealt / 8) * this.stackCount, i18next.t("modifier:hitHealApply", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), typeName: this.type.name }), true));