From 6b46cd533aa14a5af833b15ea7683f639e53828d Mon Sep 17 00:00:00 2001 From: Xavion3 Date: Thu, 18 Apr 2024 16:28:22 +1000 Subject: [PATCH] Implement stat resetting moves Haze should probably have a custom message so it doesn't list the targets name --- src/data/move.ts | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index 29cd2fdc5..2dad52f77 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -1506,6 +1506,20 @@ export class InvertStatsAttr extends MoveEffectAttr { } } +export class ResetStatsAttr extends MoveEffectAttr { + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { + if (!super.apply(user, target, move, args)) + return false; + + for (let s = 0; s < target.summonData.battleStats.length; s++) + target.summonData.battleStats[s] = 0; + + target.scene.queueMessage(getPokemonMessage(target, `'s stat changes\nwere eliminated!`)); + + return true; + } +} + export class HpSplitAttr extends MoveEffectAttr { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): Promise { return new Promise(resolve => { @@ -3818,7 +3832,7 @@ export function initMoves() { .target(MoveTarget.USER_SIDE), new StatusMove(Moves.HAZE, Type.ICE, -1, 30, -1, 0, 1) .target(MoveTarget.BOTH_SIDES) - .unimplemented(), + .attr(ResetStatsAttr), new StatusMove(Moves.REFLECT, Type.PSYCHIC, -1, 20, -1, 0, 1) .attr(AddArenaTagAttr, ArenaTagType.REFLECT, 5, true) .target(MoveTarget.USER_SIDE), @@ -4868,7 +4882,7 @@ export function initMoves() { new AttackMove(Moves.CHIP_AWAY, Type.NORMAL, MoveCategory.PHYSICAL, 70, 100, 20, -1, 0, 5) .attr(IgnoreOpponentStatChangesAttr), new AttackMove(Moves.CLEAR_SMOG, Type.POISON, MoveCategory.SPECIAL, 50, -1, 15, -1, 0, 5) - .partial(), + .attr(ResetStatsAttr), new AttackMove(Moves.STORED_POWER, Type.PSYCHIC, MoveCategory.SPECIAL, 20, 100, 10, -1, 0, 5) .attr(StatChangeCountPowerAttr), new StatusMove(Moves.QUICK_GUARD, Type.FIGHTING, -1, 15, -1, 3, 5) @@ -5487,7 +5501,7 @@ export function initMoves() { new AttackMove(Moves.SAPPY_SEED, Type.GRASS, MoveCategory.PHYSICAL, 100, 90, 10, 100, 0, 7) .attr(AddBattlerTagAttr, BattlerTagType.SEEDED), new AttackMove(Moves.FREEZY_FROST, Type.ICE, MoveCategory.SPECIAL, 100, 90, 10, -1, 0, 7) - .partial(), + .attr(ResetStatsAttr), new AttackMove(Moves.SPARKLY_SWIRL, Type.FAIRY, MoveCategory.SPECIAL, 120, 85, 5, -1, 0, 7) .partial(), new AttackMove(Moves.VEEVEE_VOLLEY, Type.NORMAL, MoveCategory.PHYSICAL, -1, -1, 20, -1, 0, 7)