* Cabal Conditioning - Fixed that only the first target player had to discard cards.

This commit is contained in:
LevelX2 2016-11-06 22:06:35 +01:00
parent 4ed988843b
commit bfb2924966

View file

@ -27,6 +27,7 @@
*/
package mage.abilities.effects.common.discard;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.dynamicvalue.DynamicValue;
@ -85,9 +86,11 @@ public class DiscardTargetEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(targetPointer.getFirst(game, source));
if (player != null) {
player.discard(amount.calculate(game, source, this), randomDiscard, source, game);
for (UUID targetPlayerId : targetPointer.getTargets(game, source)) {
Player player = game.getPlayer(targetPlayerId);
if (player != null) {
player.discard(amount.calculate(game, source, this), randomDiscard, source, game);
}
return true;
}
return false;
@ -99,7 +102,7 @@ public class DiscardTargetEffect extends OneShotEffect {
return staticText;
}
StringBuilder sb = new StringBuilder();
if(mode.getTargets().isEmpty()){
if (mode.getTargets().isEmpty()) {
sb.append("that player");
} else {
sb.append("target ").append(mode.getTargets().get(0).getTargetName());