Skip to content

Commit 0c23d8f

Browse files
committed
delete Promise in ApplyPreSummonAbAttr()
1 parent b5de9de commit 0c23d8f

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/data/ability.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4148,7 +4148,7 @@ export function applyPostSummonAbAttrs(attrType: Constructor<PostSummonAbAttr>,
41484148
}
41494149

41504150
export function applyPreSummonAbAttrs(attrType: Constructor<PreSummonAbAttr>,
4151-
pokemon: Pokemon, ...args: any[]): Promise<void> {
4151+
pokemon: Pokemon, ...args: any[]) {
41524152
return applyAbAttrsInternal<PreSummonAbAttr>(attrType, pokemon, (attr, passive) => attr.applyPreSummon(pokemon, passive, args), args);
41534153
}
41544154

src/phases.ts

+8-9
Original file line numberDiff line numberDiff line change
@@ -899,15 +899,14 @@ export class EncounterPhase extends BattlePhase {
899899
if (e < (battle.double ? 2 : 1)) {
900900
if (battle.battleType === BattleType.WILD) {
901901

902-
applyPreSummonAbAttrs(PreSummonAbAttr, enemyPokemon, []).then(() => {
903-
this.scene.field.add(enemyPokemon);
904-
battle.seenEnemyPartyMemberIds.add(enemyPokemon.id);
905-
const playerPokemon = this.scene.getPlayerPokemon();
906-
if (playerPokemon?.visible) {
907-
this.scene.field.moveBelow(enemyPokemon as Pokemon, playerPokemon);
908-
}
909-
enemyPokemon.tint(0, 0.5);
910-
});
902+
applyPreSummonAbAttrs(PreSummonAbAttr, enemyPokemon, []);
903+
this.scene.field.add(enemyPokemon);
904+
battle.seenEnemyPartyMemberIds.add(enemyPokemon.id);
905+
const playerPokemon = this.scene.getPlayerPokemon();
906+
if (playerPokemon?.visible) {
907+
this.scene.field.moveBelow(enemyPokemon as Pokemon, playerPokemon);
908+
}
909+
enemyPokemon.tint(0, 0.5);
911910
} else if (battle.battleType === BattleType.TRAINER) {
912911
enemyPokemon.setVisible(false);
913912
this.scene.currentBattle.trainer.tint(0, 0.5);

0 commit comments

Comments
 (0)