mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-01 05:52:17 +02:00
Changed the logic for substitute damage
This commit is contained in:
parent
9b4495c162
commit
ddde935670
@ -844,6 +844,11 @@ export class MoveEffectPhase extends PokemonPhase {
|
||||
const isBlockedBySubstitute = substitute && this.move.hitsSubstitute(user, target);
|
||||
if (isBlockedBySubstitute) {
|
||||
substitute.hp -= dmg;
|
||||
if (substitute.hp >= dmg) {
|
||||
user.turnData.totalDamageDealt += dmg;
|
||||
} else {
|
||||
user.turnData.totalDamageDealt += substitute.hp;
|
||||
}
|
||||
} else if (!target.isPlayer() && dmg >= target.hp) {
|
||||
globalScene.applyModifiers(EnemyEndureChanceModifier, false, target);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user