Changed params to optional

This commit is contained in:
TaylorLeLievre 2024-08-30 15:55:11 -04:00
parent 06eab54c1c
commit d63e445b70
2 changed files with 2 additions and 2 deletions

View File

@ -4711,7 +4711,7 @@ export function applyPostBattleAbAttrs(attrType: Constructor<PostBattleAbAttr>,
} }
export function applyPostFaintAbAttrs(attrType: Constructor<PostFaintAbAttr>, export function applyPostFaintAbAttrs(attrType: Constructor<PostFaintAbAttr>,
pokemon: Pokemon, attacker: Pokemon | undefined, move: Move | undefined, hitResult: HitResult | undefined, simulated: boolean = false, ...args: any[]): Promise<void> { pokemon: Pokemon, attacker?: Pokemon, move?: Move, hitResult?: HitResult, simulated: boolean = false, ...args: any[]): Promise<void> {
return applyAbAttrsInternal<PostFaintAbAttr>(attrType, pokemon, (attr, passive) => attr.applyPostFaint(pokemon, passive, simulated, attacker, move, hitResult, args), args, false, simulated); return applyAbAttrsInternal<PostFaintAbAttr>(attrType, pokemon, (attr, passive) => attr.applyPostFaint(pokemon, passive, simulated, attacker, move, hitResult, args), args, false, simulated);
} }

View File

@ -66,7 +66,7 @@ export class FaintPhase extends PokemonPhase {
const lastAttack = pokemon.turnData.attacksReceived[0]; const lastAttack = pokemon.turnData.attacksReceived[0];
applyPostFaintAbAttrs(PostFaintAbAttr, pokemon, this.scene.getPokemonById(lastAttack.sourceId)!, new PokemonMove(lastAttack.move).getMove(), lastAttack.result); // TODO: is this bang correct? applyPostFaintAbAttrs(PostFaintAbAttr, pokemon, this.scene.getPokemonById(lastAttack.sourceId)!, new PokemonMove(lastAttack.move).getMove(), lastAttack.result); // TODO: is this bang correct?
} else { //If killed by indirect damage, apply post-faint abilities without providing a last move } else { //If killed by indirect damage, apply post-faint abilities without providing a last move
applyPostFaintAbAttrs(PostFaintAbAttr, pokemon, undefined, undefined, undefined); applyPostFaintAbAttrs(PostFaintAbAttr, pokemon);
} }
const alivePlayField = this.scene.getField(true); const alivePlayField = this.scene.getField(true);