From 20c4788362cb69d005c0f54733c87bdf6a0ab0dc Mon Sep 17 00:00:00 2001 From: innerthunder Date: Thu, 2 May 2024 18:29:55 -0700 Subject: [PATCH] Implement Heal Bell, Aromatherapy, Sparkly Swirl New attribute heals status effects (except faint) of all pokemon of the user's party --- src/data/move.ts | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index 870a45b9725..904f962bab4 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -924,11 +924,36 @@ export class ResetStatusAttr extends MoveEffectAttr { } } -/* TODO: Heal Bell / Aromatherapy / Sparkly Swirl Attr -export class ResetPartyStatusAttr extends MoveEffectAttr { +export class ResetPartyStatusAttr extends MoveEffectAttr { + constructor(selfTarget: boolean, onHitTrigger: boolean) { + super(selfTarget, onHitTrigger ? MoveEffectTrigger.HIT : MoveEffectTrigger.POST_APPLY); + } + + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { + const party = user.isPlayer() ? user.scene.getParty() : user.scene.getEnemyParty(); + + switch(move.id) { + case Moves.HEAL_BELL: + user.scene.queueMessage("A bell chimed!"); + break; + case Moves.AROMATHERAPY: + user.scene.queueMessage("A soothing aroma wafted through the area!"); + break; + case Moves.SPARKLY_SWIRL: + default: + break; + } + + for (let p of party) { + if (!!p.status && p.status?.effect !== StatusEffect.FAINT) { + user.scene.queueMessage(getPokemonMessage(p, getStatusEffectHealText(p.status?.effect))); + p.resetStatus(); + p.updateInfo(); + } + } + } } -*/ export class MultiHitAttr extends MoveAttr { private multiHitType: MultiHitType; @@ -4415,9 +4440,8 @@ export function initMoves() { .condition((user, target, move) => user.status?.effect === StatusEffect.SLEEP) .ignoresVirtual(), new StatusMove(Moves.HEAL_BELL, Type.NORMAL, -1, 5, -1, 0, 2) - .attr(ResetStatusAttr, false) + .attr(ResetPartyStatusAttr, true, false) .soundBased() - .target(MoveTarget.USER_AND_ALLIES) .partial(), new AttackMove(Moves.RETURN, Type.NORMAL, MoveCategory.PHYSICAL, -1, 100, 20, -1, 0, 2) .attr(FriendshipPowerAttr), @@ -4688,9 +4712,7 @@ export function initMoves() { .attr(MovePowerMultiplierAttr, (user, target, move) => [WeatherType.SUNNY, WeatherType.RAIN, WeatherType.SANDSTORM, WeatherType.HAIL, WeatherType.SNOW, WeatherType.FOG, WeatherType.HEAVY_RAIN, WeatherType.HARSH_SUN].includes(user.scene.arena.weather?.weatherType) && !user.scene.arena.weather?.isEffectSuppressed(user.scene) ? 2 : 1) .ballBombMove(), new StatusMove(Moves.AROMATHERAPY, Type.GRASS, -1, 5, -1, 0, 3) - .attr(ResetStatusAttr, false) - .target(MoveTarget.USER_AND_ALLIES) - .partial(), + .attr(ResetPartyStatusAttr, true, false), new StatusMove(Moves.FAKE_TEARS, Type.DARK, 100, 20, -1, 0, 3) .attr(StatChangeAttr, BattleStat.SPDEF, -2), new AttackMove(Moves.AIR_CUTTER, Type.FLYING, MoveCategory.SPECIAL, 60, 95, 25, -1, 0, 3) @@ -5818,9 +5840,7 @@ export function initMoves() { new AttackMove(Moves.FREEZY_FROST, Type.ICE, MoveCategory.SPECIAL, 100, 90, 10, -1, 0, 7) .attr(ResetStatsAttr), new AttackMove(Moves.SPARKLY_SWIRL, Type.FAIRY, MoveCategory.SPECIAL, 120, 85, 5, -1, 0, 7) - .attr(ResetStatusAttr, false) - .target(MoveTarget.USER_AND_ALLIES) - .partial(), + .attr(ResetPartyStatusAttr, false, true), new AttackMove(Moves.VEEVEE_VOLLEY, Type.NORMAL, MoveCategory.PHYSICAL, -1, -1, 20, -1, 0, 7) .attr(FriendshipPowerAttr), new AttackMove(Moves.DOUBLE_IRON_BASH, Type.STEEL, MoveCategory.PHYSICAL, 60, 100, 5, 30, 0, 7)