From ff802d162b24b348ca9617276ab3853de62b7963 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Thu, 29 Feb 2024 16:02:57 -0500 Subject: [PATCH] Fix duplicate form change items appearing --- 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 e077a20950c..e3a765f7bed 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -626,7 +626,8 @@ class FormChangeItemModifierTypeGenerator extends ModifierTypeGenerator { const formChanges = pokemonFormChanges[p.species.speciesId]; return formChanges.filter(fc => ((fc.formKey.indexOf(SpeciesFormKey.MEGA) === -1 && fc.formKey.indexOf(SpeciesFormKey.PRIMAL) === -1) || party[0].scene.getModifiers(Modifiers.MegaEvolutionAccessModifier).length) && ((fc.formKey.indexOf(SpeciesFormKey.GIGANTAMAX) === -1 && fc.formKey.indexOf(SpeciesFormKey.ETERNAMAX) === -1) || party[0].scene.getModifiers(Modifiers.GigantamaxAccessModifier).length)) - .map(fc => fc.findTrigger(SpeciesFormChangeItemTrigger) as SpeciesFormChangeItemTrigger).filter(t => t && t.active); + .map(fc => fc.findTrigger(SpeciesFormChangeItemTrigger) as SpeciesFormChangeItemTrigger) + .filter(t => t && t.active && !p.scene.findModifier(m => m instanceof Modifiers.PokemonFormChangeItemModifier && m.pokemonId === p.id && m.formChangeItem === t.item)); }).flat().flatMap(fc => fc.item); if (!formChangeItemPool.length)