* Mogis, God of Slaughter - fixed that it doesn't make damage if nothing to sacrifice;

This commit is contained in:
Oleg Agafonov 2020-01-18 11:11:59 +04:00
parent b2ab3a2ba4
commit 2429095f4d

View file

@ -82,11 +82,14 @@ class MogisGodOfSlaughterEffect extends OneShotEffect {
}
TargetPermanent target = new TargetControlledCreaturePermanent(1);
target.setNotTarget(true);
if (!player.chooseUse(Outcome.Detriment, "Sacrifice a creature to prevent 2 damage?", source, game)
|| !player.choose(Outcome.Sacrifice, target, source.getSourceId(), game)) {
return player.damage(2, source.getSourceId(), game) > 0;
if (target.canChoose(player.getId(), game)
&& player.chooseUse(Outcome.Detriment, "Sacrifice a creature to prevent 2 damage?", source, game)
&& player.choose(Outcome.Sacrifice, target, source.getSourceId(), game)) {
Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent != null && permanent.sacrifice(source.getSourceId(), game)) {
return true;
}
}
Permanent permanent = game.getPermanent(target.getFirstTarget());
return permanent != null && permanent.sacrifice(source.getSourceId(), game);
return player.damage(2, source.getSourceId(), game) > 0;
}
}