Resolve TODO: add 2nd turn message for Sky Drop

pull/929/head
brandonarude 2024-05-15 12:07:00 -07:00
parent 78f7965304
commit 9b24b3a723
1 changed files with 27 additions and 1 deletions

View File

@ -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<boolean> {
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)