From de285ba1ed05fe307ddcecb2e8ac4864cf9f9432 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 5 Dec 2015 01:09:22 +0100 Subject: [PATCH] * Fixed that draw effect was only applied to the first target (e.g. Wheel and Deal only one opponent draws 7 cards). --- .../effects/common/DrawCardTargetEffect.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Mage/src/main/java/mage/abilities/effects/common/DrawCardTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DrawCardTargetEffect.java index 7d7556fc7c..2fdadd898d 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DrawCardTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DrawCardTargetEffect.java @@ -27,6 +27,7 @@ */ package mage.abilities.effects.common; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.dynamicvalue.DynamicValue; @@ -84,18 +85,19 @@ public class DrawCardTargetEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - if (player != null) { - int cardsToDraw = amount.calculate(game, source, this); - if (upTo) { - cardsToDraw = player.getAmount(0, cardsToDraw, "Draw how many cards?", game); + for (UUID playerId : getTargetPointer().getTargets(game, source)) { + Player player = game.getPlayer(playerId); + if (player != null) { + int cardsToDraw = amount.calculate(game, source, this); + if (upTo) { + cardsToDraw = player.getAmount(0, cardsToDraw, "Draw how many cards?", game); + } + if (!optional || player.chooseUse(outcome, "Use draw effect?", source, game)) { + player.drawCards(cardsToDraw, game); + } } - if (!optional || player.chooseUse(outcome, "Use draw effect?", source, game)) { - player.drawCards(cardsToDraw, game); - } - return true; } - return false; + return true; } @Override