pull/373/merge
PaulBeslin 2024-05-15 12:31:41 -05:00 committed by GitHub
commit ec5340ad2a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 23 additions and 2 deletions

View File

@ -2344,9 +2344,13 @@ export class HitCountPowerAttr extends VariablePowerAttr {
}
}
const countPositiveStats = (pokemon: Pokemon): number => {
return pokemon.summonData.battleStats.reduce((total, stat) => stat > 0 && stat ? total + stat : total, 0);
}
export class StatChangeCountPowerAttr extends VariablePowerAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
const positiveStats: number = user.summonData.battleStats.reduce((total, stat) => stat > 0 && stat ? total + stat : total, 0);
const positiveStats: number = countPositiveStats(user);
(args[0] as Utils.NumberHolder).value += positiveStats * 20;
@ -2354,6 +2358,22 @@ export class StatChangeCountPowerAttr extends VariablePowerAttr {
}
}
export class PunishmentPowerAttr extends VariablePowerAttr {
PUNISHMENT_MIN_BASE_POWER = 60;
PUNISHMENT_MAX_BASE_POWER = 200;
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
const positiveStats: number = countPositiveStats(target);
(args[0] as Utils.NumberHolder).value = Math.min(
this.PUNISHMENT_MAX_BASE_POWER,
this.PUNISHMENT_MIN_BASE_POWER + positiveStats * 20
);
return true;
}
}
export class PresentPowerAttr extends VariablePowerAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
@ -5439,7 +5459,8 @@ export function initMoves() {
new StatusMove(Moves.GUARD_SWAP, Type.PSYCHIC, -1, 10, -1, 0, 4)
.unimplemented(),
new AttackMove(Moves.PUNISHMENT, Type.DARK, MoveCategory.PHYSICAL, -1, 100, 5, -1, 0, 4)
.unimplemented(),
.attr(PunishmentPowerAttr)
.makesContact(),
new AttackMove(Moves.LAST_RESORT, Type.NORMAL, MoveCategory.PHYSICAL, 140, 100, 5, -1, 0, 4)
.attr(LastResortAttr),
new StatusMove(Moves.WORRY_SEED, Type.GRASS, 100, 10, -1, 0, 4)