Cross Evolution: Fix signature items

This commit is contained in:
Kris Johnson
2022-03-06 07:10:33 -07:00
parent 6f0427ff53
commit 1699cd3903

View File

@@ -774,6 +774,12 @@ export const Formats: FormatList = [
`${species.name} cannot cross evolve into ${crossSpecies.name} because they are not consecutive evolution stages.`,
];
}
const item = this.dex.items.get(set.item);
if (item.itemUser?.length) {
if (!item.itemUser.includes(crossSpecies.name) || crossSpecies.name !== species.name) {
return [`${species.name} cannot use ${item.name} because it is cross evolved into ${crossSpecies.name}.`];
}
}
const ability = this.dex.abilities.get(set.ability);
if (!this.ruleTable.isRestricted(`ability:${ability.id}`) || Object.values(species.abilities).includes(ability.name)) {
set.species = crossSpecies.name;