mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
Overflow check
This commit is contained in:
parent
78bf442674
commit
123190bfa3
1 changed files with 2 additions and 2 deletions
|
@ -115,13 +115,13 @@ class DictateOfTheTwinGodsEffect extends ReplacementEffectImpl {
|
||||||
if (damageEvent.getType() == EventType.DAMAGE_PLAYER) {
|
if (damageEvent.getType() == EventType.DAMAGE_PLAYER) {
|
||||||
Player targetPlayer = game.getPlayer(event.getTargetId());
|
Player targetPlayer = game.getPlayer(event.getTargetId());
|
||||||
if (targetPlayer != null) {
|
if (targetPlayer != null) {
|
||||||
targetPlayer.damage(damageEvent.getAmount() * 2, damageEvent.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable(), event.getAppliedEffects());
|
targetPlayer.damage(game.addWithOverflowCheck(damageEvent.getAmount(), damageEvent.getAmount()), damageEvent.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable(), event.getAppliedEffects());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Permanent targetPermanent = game.getPermanent(event.getTargetId());
|
Permanent targetPermanent = game.getPermanent(event.getTargetId());
|
||||||
if (targetPermanent != null) {
|
if (targetPermanent != null) {
|
||||||
targetPermanent.damage(damageEvent.getAmount() * 2, damageEvent.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable(), event.getAppliedEffects());
|
targetPermanent.damage(game.addWithOverflowCheck(damageEvent.getAmount(), damageEvent.getAmount()), damageEvent.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable(), event.getAppliedEffects());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue