Skip to content

Commit

Permalink
[Bug] Fix Eviolite Weight Condition (#3681)
Browse files Browse the repository at this point in the history
* [Bug] Fix Eviolite Weight Condition

* Break Up Conditions for Legibility

---------

Co-authored-by: NightKev <[email protected]>
  • Loading branch information
xsn34kzx and DayKev authored Nov 30, 2024
1 parent b70bf0f commit cd6cee8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/modifier/modifier-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1730,8 +1730,14 @@ const modifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.EVIOLITE, (party: Pokemon[]) => {
const { gameMode, gameData } = party[0].scene;
if (gameMode.isDaily || (!gameMode.isFreshStartChallenge() && gameData.isUnlocked(Unlockables.EVIOLITE))) {
return party.some(p => ((p.getSpeciesForm(true).speciesId in pokemonEvolutions) || (p.isFusion() && (p.getFusionSpeciesForm(true).speciesId in pokemonEvolutions)))
&& !p.getHeldItems().some(i => i instanceof EvolutionStatBoosterModifier) && !p.isMax()) ? 10 : 0;
return party.some(p => {
// Check if Pokemon's species (or fusion species, if applicable) can evolve or if they're G-Max'd
if (!p.isMax() && ((p.getSpeciesForm(true).speciesId in pokemonEvolutions) || (p.isFusion() && (p.getFusionSpeciesForm(true).speciesId in pokemonEvolutions)))) {
// Check if Pokemon is already holding an Eviolite
return !p.getHeldItems().some(i => i.type.id === "EVIOLITE");
}
return false;
}) ? 10 : 0;
}
return 0;
}),
Expand Down

0 comments on commit cd6cee8

Please sign in to comment.