From f540aeb804debbfd009c159a9a65165a68e2f6b7 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Tue, 2 Apr 2024 14:20:30 -0400 Subject: [PATCH] Check specific form change items for compatibility before allowing them to be held --- src/modifier/modifier-type.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index fa76145fc..127fb6e74 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -509,7 +509,8 @@ export class FormChangeItemModifierType extends PokemonModifierType implements G constructor(formChangeItem: FormChangeItem) { super(Utils.toReadableString(FormChangeItem[formChangeItem]), `Causes certain Pokémon to change form`, (_type, args) => new Modifiers.PokemonFormChangeItemModifier(this, (args[0] as PlayerPokemon).id, formChangeItem, true), (pokemon: PlayerPokemon) => { - if (pokemonFormChanges.hasOwnProperty(pokemon.species.speciesId) && !!pokemonFormChanges[pokemon.species.speciesId].find(fc => fc.trigger.hasTriggerType(SpeciesFormChangeItemTrigger))) + if (pokemonFormChanges.hasOwnProperty(pokemon.species.speciesId) && !!pokemonFormChanges[pokemon.species.speciesId].find(fc => fc.trigger.hasTriggerType(SpeciesFormChangeItemTrigger) + && (fc.trigger as SpeciesFormChangeItemTrigger).item === this.formChangeItem)) return null; return PartyUiHandler.NoEffectMessage;