Update src/data/ability.ts

per DayKev's suggestion

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
schmidtc1 2024-10-15 18:12:21 -04:00 committed by GitHub
parent 09e6f43f0a
commit 9ef1e10b52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2452,7 +2452,7 @@ export class PostSummonTransformAbAttr extends PostSummonAbAttr {
}
pokemon.summonData.moveset = target.getMoveset().map(m => {
const pp = m?.getMove().pp!;
const pp = m?.getMove().pp ?? 0;
// if PP value is less than 5, do nothing. If greater, we need to reduce the value to 5 using a negative ppUp value.
const ppUp = pp <= 5 ? 0 : (5 - pp) / Math.max(Math.floor(pp / 5), 1);
return new PokemonMove(m?.moveId ?? Moves.NONE, 0, ppUp);