From 3a64a8390a1bffae18b4fe7931e045c10fd4c46b Mon Sep 17 00:00:00 2001 From: Xavion3 Date: Thu, 18 Apr 2024 16:47:12 +1000 Subject: [PATCH] Implement Psych Up --- src/data/move.ts | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/data/move.ts b/src/data/move.ts index bfbf21450f6..bffd7a826ce 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -1461,6 +1461,24 @@ export class CutHpStatBoostAttr extends StatChangeAttr { } } +export class CopyStatsAttr 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++) + user.summonData.battleStats[s] = target.summonData.battleStats[s]; + if (target.getTag(BattlerTagType.CRIT_BOOST)) + user.addTag(BattlerTagType.CRIT_BOOST, 0, move.id); + else + user.removeTag(BattlerTagType.CRIT_BOOST); + + target.scene.queueMessage(getPokemonMessage(user, 'copied\n') + getPokemonMessage(target, `'s stat changes!`)); + + return true; + } +} + export class InvertStatsAttr extends MoveEffectAttr { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { if (!super.apply(user, target, move, args)) @@ -4156,7 +4174,7 @@ export function initMoves() { .attr(CounterDamageAttr, (move: Move) => move.category === MoveCategory.SPECIAL, 2) .target(MoveTarget.ATTACKER), new StatusMove(Moves.PSYCH_UP, Type.NORMAL, -1, 10, -1, 0, 2) - .unimplemented(), + .attr(CopyStatsAttr), new AttackMove(Moves.EXTREME_SPEED, Type.NORMAL, MoveCategory.PHYSICAL, 80, 100, 5, -1, 2, 2), new AttackMove(Moves.ANCIENT_POWER, Type.ROCK, MoveCategory.SPECIAL, 60, 100, 5, 10, 0, 2) .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD ], 1, true),