From 9b24b3a72347de99819ad86ebb7330ba5f18f875 Mon Sep 17 00:00:00 2001 From: brandonarude Date: Wed, 15 May 2024 12:07:00 -0700 Subject: [PATCH] Resolve TODO: add 2nd turn message for Sky Drop --- src/data/move.ts | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/data/move.ts b/src/data/move.ts index 46216eb75..c30fc234a 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -1644,6 +1644,32 @@ export class SunlightChargeAttr extends ChargeAttr { } } +export class SkyDropChargeAttr extends ChargeAttr { + private firstTurn: boolean; + private secondTurnText: string; + constructor() { + super(ChargeAnim.SKY_DROP_CHARGING, 'took {TARGET}\ninto the sky!', BattlerTagType.FLYING, true); + // Add a flag because ChargeAttr skills use themselves twice instead of once over one-to-two turns + this.firstTurn = true; + this.secondTurnText = "The {TARGET} was freed from the Sky Drop!" + } + + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): Promise { + return new Promise(resolve => { + if(this.firstTurn){ + this.firstTurn=false; + } else { + user.scene.queueMessage(` ${this.secondTurnText.replace('{TARGET}', target.name)}`); + } + + super.apply(user, target, move, args).then(result => { + resolve(result); + }); + }); + }; +} + + export class ElectroShotChargeAttr extends ChargeAttr { private statIncreaseApplied: boolean; constructor() { @@ -5768,7 +5794,7 @@ export function initMoves() { new AttackMove(Moves.HEX, Type.GHOST, MoveCategory.SPECIAL, 65, 100, 10, -1, 0, 5) .attr(MovePowerMultiplierAttr, (user, target, move) => target.status ? 2 : 1), new AttackMove(Moves.SKY_DROP, Type.FLYING, MoveCategory.PHYSICAL, 60, 100, 10, -1, 0, 5) - .attr(ChargeAttr, ChargeAnim.SKY_DROP_CHARGING, 'took {TARGET}\ninto the sky!', BattlerTagType.FLYING) // TODO: Add 2nd turn message + .attr(SkyDropChargeAttr) .condition(failOnGravityCondition) .ignoresVirtual(), new SelfStatusMove(Moves.SHIFT_GEAR, Type.STEEL, -1, 10, -1, 0, 5)