mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-04-21 17:19:15 +01:00
Convert apply attribute functions to promises
This commit is contained in:
parent
dd89db29fd
commit
6391e05508
@ -1739,14 +1739,16 @@ export class MoveEffectPhase extends PokemonPhase {
|
|||||||
}
|
}
|
||||||
Utils.executeIf(!isProtected && !chargeEffect, () => applyFilteredMoveAttrs((attr: MoveAttr) => attr instanceof MoveEffectAttr && (attr as MoveEffectAttr).trigger === MoveEffectTrigger.HIT,
|
Utils.executeIf(!isProtected && !chargeEffect, () => applyFilteredMoveAttrs((attr: MoveAttr) => attr instanceof MoveEffectAttr && (attr as MoveEffectAttr).trigger === MoveEffectTrigger.HIT,
|
||||||
user, target, this.move.getMove()).then(() => {
|
user, target, this.move.getMove()).then(() => {
|
||||||
if (!target.isFainted()) {
|
return Utils.executeIf(!target.isFainted(), () => applyPostDefendAbAttrs(PostDefendAbAttr, target, user, this.move, hitResult).then(() => {
|
||||||
applyPostDefendAbAttrs(PostDefendAbAttr, target, user, this.move, hitResult);
|
|
||||||
if (!user.isPlayer() && this.move instanceof AttackMove)
|
if (!user.isPlayer() && this.move instanceof AttackMove)
|
||||||
user.scene.applyModifiers(EnemyAttackStatusEffectChanceModifier, false, target);
|
user.scene.applyModifiers(EnemyAttackStatusEffectChanceModifier, false, target);
|
||||||
}
|
})).then(() => {
|
||||||
applyPostAttackAbAttrs(PostAttackAbAttr, user, target, this.move, hitResult);
|
applyPostAttackAbAttrs(PostAttackAbAttr, user, target, this.move, hitResult).then(() => {
|
||||||
if (this.move instanceof AttackMove)
|
if (this.move instanceof AttackMove)
|
||||||
this.scene.applyModifiers(ContactHeldItemTransferChanceModifier, this.player, user, target.getFieldIndex());
|
this.scene.applyModifiers(ContactHeldItemTransferChanceModifier, this.player, user, target.getFieldIndex());
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
});
|
||||||
})
|
})
|
||||||
).then(() => resolve());
|
).then(() => resolve());
|
||||||
});
|
});
|
||||||
@ -1894,6 +1896,8 @@ export class ShowAbilityPhase extends PokemonPhase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
|
super.start();
|
||||||
|
|
||||||
this.scene.abilityBar.showAbility(this.getPokemon());
|
this.scene.abilityBar.showAbility(this.getPokemon());
|
||||||
|
|
||||||
this.end();
|
this.end();
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user