mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-15 21:02:18 +02:00
Combined if statements
This commit is contained in:
parent
8accf0aee8
commit
06eab54c1c
@ -4053,12 +4053,10 @@ export class PostFaintHPDamageAbAttr extends PostFaintAbAttr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon | undefined, move: Move | undefined, hitResult: HitResult | undefined, args: any[]): boolean {
|
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 (move !== undefined && attacker !== undefined && !simulated) { //If the mon didn't die to indirect damage
|
||||||
if (!simulated) {
|
const damage = pokemon.turnData.attacksReceived[0].damage;
|
||||||
const damage = pokemon.turnData.attacksReceived[0].damage;
|
attacker.damageAndUpdate((damage), HitResult.OTHER);
|
||||||
attacker.damageAndUpdate((damage), HitResult.OTHER);
|
attacker.turnData.damageTaken += damage;
|
||||||
attacker.turnData.damageTaken += damage;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user