mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 17:12:44 +02:00
Fixed error in damage logic
This commit is contained in:
parent
22dfbfcc2e
commit
b607994f09
@ -840,12 +840,12 @@ export class MoveEffectPhase extends PokemonPhase {
|
|||||||
const substitute = target.getTag(SubstituteTag);
|
const substitute = target.getTag(SubstituteTag);
|
||||||
const isBlockedBySubstitute = substitute && this.move.hitsSubstitute(user, target);
|
const isBlockedBySubstitute = substitute && this.move.hitsSubstitute(user, target);
|
||||||
if (isBlockedBySubstitute) {
|
if (isBlockedBySubstitute) {
|
||||||
substitute.hp -= dmg;
|
|
||||||
if (substitute.hp >= dmg) {
|
if (substitute.hp >= dmg) {
|
||||||
user.turnData.totalDamageDealt += dmg;
|
user.turnData.totalDamageDealt += dmg;
|
||||||
} else {
|
} else {
|
||||||
user.turnData.totalDamageDealt += substitute.hp;
|
user.turnData.totalDamageDealt += substitute.hp;
|
||||||
}
|
}
|
||||||
|
substitute.hp -= dmg;
|
||||||
} else if (!target.isPlayer() && dmg >= target.hp) {
|
} else if (!target.isPlayer() && dmg >= target.hp) {
|
||||||
globalScene.applyModifiers(EnemyEndureChanceModifier, false, target);
|
globalScene.applyModifiers(EnemyEndureChanceModifier, false, target);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user