mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 04:42:07 -08:00
Overflow check
This commit is contained in:
parent
18661c2c4d
commit
02cb7145f2
1 changed files with 1 additions and 1 deletions
|
|
@ -91,7 +91,7 @@ class PhthisisEffect extends OneShotEffect {
|
||||||
if (creature != null) {
|
if (creature != null) {
|
||||||
Player controller = game.getPlayer(creature.getControllerId());
|
Player controller = game.getPlayer(creature.getControllerId());
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
int lifeLoss = creature.getPower().getValue() + creature.getToughness().getValue();
|
int lifeLoss = game.addWithOverflowCheck(creature.getPower().getValue(), creature.getToughness().getValue());
|
||||||
creature.destroy(source.getSourceId(), game, false);
|
creature.destroy(source.getSourceId(), game, false);
|
||||||
// the life loss happens also if the creature is indestructible or regenerated (legal targets)
|
// the life loss happens also if the creature is indestructible or regenerated (legal targets)
|
||||||
controller.loseLife(lifeLoss, game, false);
|
controller.loseLife(lifeLoss, game, false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue