CardUtil overflow

This commit is contained in:
Zzooouhh 2017-12-23 23:50:52 +01:00 committed by GitHub
parent 2643f552e4
commit c7db369eff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,6 +40,7 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import mage.util.CardUtil;
/**
*
@ -91,7 +92,7 @@ class PhthisisEffect extends OneShotEffect {
if (creature != null) {
Player controller = game.getPlayer(creature.getControllerId());
if (controller != null) {
int lifeLoss = game.addWithOverflowCheck(creature.getPower().getValue(), creature.getToughness().getValue());
int lifeLoss = CardUtil.addWithOverflowCheck(creature.getPower().getValue(), creature.getToughness().getValue());
creature.destroy(source.getSourceId(), game, false);
// the life loss happens also if the creature is indestructible or regenerated (legal targets)
controller.loseLife(lifeLoss, game, false);