[Bug] Prevent Mystical Rock after Max Stack (#5606)

* [Bug] Prevent `Mystical Rock` after Max Stack

* Update modifier-type.ts

* fixed ordering, testing locally

---------

Co-authored-by: damocleas <damocleas25@gmail.com>
This commit is contained in:
Amani H. 2025-04-01 17:18:49 -04:00 committed by GitHub
parent 5217703d2b
commit 4a4e766135
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2823,12 +2823,21 @@ const modifierPool: ModifierPool = {
modifierTypes.MYSTICAL_ROCK,
(party: Pokemon[]) => {
return party.some(p => {
let isHoldingMax = false;
for (const i of p.getHeldItems()) {
if (i.type.id === "MYSTICAL_ROCK") {
isHoldingMax = i.getStackCount() === i.getMaxStackCount();
break;
}
}
if (!isHoldingMax) {
const moveset = p.getMoveset(true).map(m => m.moveId);
const hasAbility = [
Abilities.DRIZZLE,
Abilities.ORICHALCUM_PULSE,
Abilities.DROUGHT,
Abilities.ORICHALCUM_PULSE,
Abilities.DRIZZLE,
Abilities.SAND_STREAM,
Abilities.SAND_SPIT,
Abilities.SNOW_WARNING,
@ -2854,6 +2863,8 @@ const modifierPool: ModifierPool = {
].some(m => moveset.includes(m));
return hasAbility || hasMoves;
}
return false;
})
? 10
: 0;