[Bug] Friendship-based moves have Base Power -1 when Pokemon is wild (#2291)

Affects RETURN, FRUSTRATION, PIKA_POW, and VEEVEE_VOLLEY.
This commit is contained in:
chaosgrimmon 2024-06-16 18:40:47 -04:00 committed by GitHub
parent cc1b37c097
commit 90f6ae7e6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3034,10 +3034,8 @@ export class FriendshipPowerAttr extends VariablePowerAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
const power = args[0] as Utils.NumberHolder;
if (user instanceof PlayerPokemon) {
const friendshipPower = Math.floor(Math.min(user.friendship, 255) / 2.5);
power.value = Math.max(!this.invert ? friendshipPower : 102 - friendshipPower, 1);
}
const friendshipPower = Math.floor(Math.min(user instanceof PlayerPokemon ? user.friendship : user.species.baseFriendship, 255) / 2.5);
power.value = Math.max(!this.invert ? friendshipPower : 102 - friendshipPower, 1);
return true;
}