diff --git a/src/data/move.ts b/src/data/move.ts index 178f263cda6..355c4f4be22 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -1644,16 +1644,36 @@ export class SunlightChargeAttr extends ChargeAttr { } } + +/** + * + * Special handler for the Sky Drop Move + * @extends ChargeAttr + * @see {@link firstTurn} + * @see {@linkcode secondTurnText} + * @see {@linkcode apply} + * @see {@linkcode getCondition} + * + */ export class SkyDropChargeAttr extends ChargeAttr { + /** Add a flag because ChargeAttr skills use themselves twice instead of once over one-to-two turns */ private firstTurn: boolean; + /** Holder for Battle Message when the Target is released */ 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!" + this.secondTurnText = "The {TARGET} was freed from the Sky Drop!"; } + /** + * Extends the apply function to allow for different battle messages between the + * first and second turns. + * @param user The {@linkcode Pokemon} using Sky Drop + * @param target The {@linkcode Pokemon} targeted by the Sky Drop attack + * @param move the {@linkcode Move} being used (i.e. Sky Drop) + * @param args Any Additional Args + */ apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): Promise { return new Promise(resolve => { if(this.firstTurn){ @@ -1668,6 +1688,11 @@ export class SkyDropChargeAttr extends ChargeAttr { }); }; + /** + * Check Target's weight and cause Sky Drop to fail is the target is more than 200kg + * @param target The {@linkcode Pokemon} targeted by the attack + * @returns false if the target is 200kg or more + */ getCondition(): MoveConditionFunc{ return (user, target, move) => target.getWeight() < 200; }