This commit is contained in:
tool4EvEr
2022-05-26 21:15:53 +02:00
parent 628993f86d
commit aee9a3a41d

View File

@@ -118,24 +118,22 @@ public class ControlGainEffect extends SpellAbilityEffect {
final Game game = newController.getGame(); final Game game = newController.getGame();
CardCollectionView tgtCards = null; CardCollectionView tgtCards = null;
if (sa.hasParam("ControlledByTarget")) { if (sa.hasParam("Choices")) {
tgtCards = CardLists.filterControlledBy(tgtCards, getTargetPlayers(sa));
} else if (sa.hasParam("Choices")) {
Player chooser = sa.hasParam("Chooser") ? AbilityUtils.getDefinedPlayers(source, Player chooser = sa.hasParam("Chooser") ? AbilityUtils.getDefinedPlayers(source,
sa.getParam("Chooser"), sa).get(0) : activator; sa.getParam("Chooser"), sa).get(0) : activator;
CardCollectionView choices = CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield), CardCollectionView choices = CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield),
sa.getParam("Choices"), activator, source, sa); sa.getParam("Choices"), activator, source, sa);
if (!choices.isEmpty()) { if (!choices.isEmpty()) {
String title = sa.hasParam("ChoiceTitle") ? sa.getParam("ChoiceTitle") : String title = sa.hasParam("ChoiceTitle") ? sa.getParam("ChoiceTitle") :
Localizer.getInstance().getMessage("lblChooseaCard") +" "; Localizer.getInstance().getMessage("lblChooseaCard") +" ";
tgtCards = activator.getController().chooseCardsForEffect(choices, sa, title, 1, 1, false, null); tgtCards = chooser.getController().chooseCardsForEffect(choices, sa, title, 1, 1, false, null);
} }
} else { } else {
tgtCards = getDefinedCards(sa); tgtCards = getDefinedCards(sa);
} }
if (tgtCards == null) { if (tgtCards !=null & sa.hasParam("ControlledByTarget")) {
return; tgtCards = CardLists.filterControlledBy(tgtCards, getTargetPlayers(sa));
} }
// in case source was LKI or still resolving // in case source was LKI or still resolving