Fixed multitarget handling of Decimate and Boom//Bust.

This commit is contained in:
LevelX2 2015-09-08 08:09:48 +02:00
parent 0dcd11cf4b
commit b4d7009af8
3 changed files with 13 additions and 14 deletions

View file

@ -46,6 +46,7 @@ import mage.util.CardUtil;
public class DestroyTargetEffect extends OneShotEffect {
protected boolean noRegen;
protected boolean multitargetHandling;
public DestroyTargetEffect() {
this(false);
@ -57,13 +58,19 @@ public class DestroyTargetEffect extends OneShotEffect {
}
public DestroyTargetEffect(boolean noRegen) {
this(noRegen, false);
}
public DestroyTargetEffect(boolean noRegen, boolean multitargetHandling) {
super(Outcome.DestroyPermanent);
this.noRegen = noRegen;
this.multitargetHandling = multitargetHandling;
}
public DestroyTargetEffect(final DestroyTargetEffect effect) {
super(effect);
this.noRegen = effect.noRegen;
this.multitargetHandling = effect.multitargetHandling;
}
@Override
@ -74,7 +81,7 @@ public class DestroyTargetEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
int affectedTargets = 0;
if (source.getTargets().size() > 1 && targetPointer instanceof FirstTargetPointer) { // Decimate
if (multitargetHandling && source.getTargets().size() > 1 && targetPointer instanceof FirstTargetPointer) { // Decimate
for (Target target : source.getTargets()) {
for (UUID permanentId : target.getTargets()) {
Permanent permanent = game.getPermanent(permanentId);