mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-15 21:02:18 +02:00
Fixed Delta Stream remaining active when last mon dies to indirect damage
This commit is contained in:
parent
7288350d45
commit
e54f2ecae5
@ -3923,7 +3923,7 @@ export class PostBattleLootAbAttr extends PostBattleAbAttr {
|
||||
}
|
||||
|
||||
export class PostFaintAbAttr extends AbAttr {
|
||||
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, hitResult: HitResult, args: any[]): boolean {
|
||||
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon | undefined, move: Move | undefined, hitResult: HitResult | undefined, args: any[]): boolean {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -3974,7 +3974,7 @@ export class PostFaintClearWeatherAbAttr extends PostFaintAbAttr {
|
||||
* @param args N/A
|
||||
* @returns {boolean} Returns true if the weather clears, otherwise false.
|
||||
*/
|
||||
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, hitResult: HitResult, args: any[]): boolean {
|
||||
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon | undefined, move: Move | undefined, hitResult: HitResult | undefined, args: any[]): boolean {
|
||||
const weatherType = pokemon.scene.arena.weather?.weatherType;
|
||||
let turnOffWeather = false;
|
||||
|
||||
@ -4022,8 +4022,8 @@ export class PostFaintContactDamageAbAttr extends PostFaintAbAttr {
|
||||
this.damageRatio = damageRatio;
|
||||
}
|
||||
|
||||
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, hitResult: HitResult, args: any[]): boolean {
|
||||
if (move.checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon)) {
|
||||
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon | undefined, move: Move | undefined, hitResult: HitResult | undefined, args: any[]): boolean {
|
||||
if (move !== undefined && attacker !== undefined && move.checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon)) { //If the mon didn't die to indirect damage
|
||||
const cancelled = new Utils.BooleanHolder(false);
|
||||
pokemon.scene.getField(true).map(p => applyAbAttrs(FieldPreventExplosiveMovesAbAttr, p, cancelled, simulated));
|
||||
if (cancelled.value || attacker.hasAbilityWithAttr(BlockNonDirectDamageAbAttr)) {
|
||||
@ -4052,11 +4052,13 @@ export class PostFaintHPDamageAbAttr extends PostFaintAbAttr {
|
||||
super ();
|
||||
}
|
||||
|
||||
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, hitResult: HitResult, args: any[]): boolean {
|
||||
if (!simulated) {
|
||||
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon | undefined, move: Move | undefined, hitResult: HitResult | undefined, args: any[]): boolean {
|
||||
if (move !== undefined && attacker !== undefined) { //If the mon didn't die to indirect damage
|
||||
if (!simulated) {
|
||||
const damage = pokemon.turnData.attacksReceived[0].damage;
|
||||
attacker.damageAndUpdate((damage), HitResult.OTHER);
|
||||
attacker.turnData.damageTaken += damage;
|
||||
attacker.damageAndUpdate((damage), HitResult.OTHER);
|
||||
attacker.turnData.damageTaken += damage;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -4711,7 +4713,7 @@ export function applyPostBattleAbAttrs(attrType: Constructor<PostBattleAbAttr>,
|
||||
}
|
||||
|
||||
export function applyPostFaintAbAttrs(attrType: Constructor<PostFaintAbAttr>,
|
||||
pokemon: Pokemon, attacker: Pokemon, move: Move, hitResult: HitResult, simulated: boolean = false, ...args: any[]): Promise<void> {
|
||||
pokemon: Pokemon, attacker: Pokemon | undefined, move: Move | undefined, hitResult: HitResult | undefined, 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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user