* Fixed that draw effect was only applied to the first target (e.g. Wheel and Deal only one opponent draws 7 cards).

This commit is contained in:
LevelX2 2015-12-05 01:09:22 +01:00
parent f7b8ab626d
commit de285ba1ed

View file

@ -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,7 +85,8 @@ public class DrawCardTargetEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(targetPointer.getFirst(game, source));
for (UUID playerId : getTargetPointer().getTargets(game, source)) {
Player player = game.getPlayer(playerId);
if (player != null) {
int cardsToDraw = amount.calculate(game, source, this);
if (upTo) {
@ -93,9 +95,9 @@ public class DrawCardTargetEffect extends OneShotEffect {
if (!optional || player.chooseUse(outcome, "Use draw effect?", source, game)) {
player.drawCards(cardsToDraw, game);
}
return true;
}
return false;
}
return true;
}
@Override