Merge origin/master

This commit is contained in:
LevelX2 2018-11-27 00:30:55 +01:00
commit 40149bd8e1

View file

@ -1,4 +1,3 @@
package mage.cards.j; package mage.cards.j;
import java.util.ArrayList; import java.util.ArrayList;
@ -11,7 +10,6 @@ import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility; import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.LoyaltyAbility; import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.Card; import mage.cards.Card;
@ -125,9 +123,9 @@ class JaceArchitectOfThoughtDelayedTriggeredAbility extends DelayedTriggeredAbil
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
if (game.getOpponents(getControllerId()).contains(event.getPlayerId())) { if (game.getOpponents(getControllerId()).contains(event.getPlayerId())) {
for (Effect effect : getEffects()) { getEffects().forEach((effect) -> {
effect.setTargetPointer(new FixedTarget(event.getSourceId())); effect.setTargetPointer(new FixedTarget(event.getSourceId()));
} });
return true; return true;
} }
return false; return false;
@ -186,7 +184,6 @@ class JaceArchitectOfThoughtEffect2 extends OneShotEffect {
if (opponent == null) { if (opponent == null) {
opponent = game.getPlayer(opponents.iterator().next()); opponent = game.getPlayer(opponents.iterator().next());
} }
TargetCard target = new TargetCard(0, allCards.size(), Zone.LIBRARY, new FilterCard("cards to put in the first pile")); TargetCard target = new TargetCard(0, allCards.size(), Zone.LIBRARY, new FilterCard("cards to put in the first pile"));
target.setNotTarget(true); target.setNotTarget(true);
opponent.choose(Outcome.Neutral, allCards, target, game); opponent.choose(Outcome.Neutral, allCards, target, game);
@ -212,9 +209,9 @@ class JaceArchitectOfThoughtEffect2 extends OneShotEffect {
private void postPileToLog(String pileName, Set<Card> cards, Game game) { private void postPileToLog(String pileName, Set<Card> cards, Game game) {
StringBuilder message = new StringBuilder(pileName).append(": "); StringBuilder message = new StringBuilder(pileName).append(": ");
for (Card card : cards) { cards.forEach((card) -> {
message.append(card.getName()).append(' '); message.append(card.getName()).append(' ');
} });
if (cards.isEmpty()) { if (cards.isEmpty()) {
message.append(" (empty)"); message.append(" (empty)");
} }
@ -255,9 +252,9 @@ class JaceArchitectOfThoughtEffect3 extends OneShotEffect {
while (!playerList.isEmpty()) { while (!playerList.isEmpty()) {
FilterPlayer filter = new FilterPlayer(); FilterPlayer filter = new FilterPlayer();
List<PlayerIdPredicate> playerPredicates = new ArrayList<>(); List<PlayerIdPredicate> playerPredicates = new ArrayList<>();
for (UUID playerId : playerList) { playerList.forEach((playerId) -> {
playerPredicates.add(new PlayerIdPredicate(playerId)); playerPredicates.add(new PlayerIdPredicate(playerId));
} });
filter.add(Predicates.or(playerPredicates)); filter.add(Predicates.or(playerPredicates));
TargetPlayer targetPlayer = new TargetPlayer(1, 1, true, filter); TargetPlayer targetPlayer = new TargetPlayer(1, 1, true, filter);
targetPlayer.setRequired(!checkList.containsAll(playerList)); targetPlayer.setRequired(!checkList.containsAll(playerList));
@ -275,7 +272,7 @@ class JaceArchitectOfThoughtEffect3 extends OneShotEffect {
UUID targetId = target.getFirstTarget(); UUID targetId = target.getFirstTarget();
Card card = player.getLibrary().remove(targetId, game); Card card = player.getLibrary().remove(targetId, game);
if (card != null) { if (card != null) {
controller.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true); controller.moveCardsToExile(card, source, game, true, CardUtil.getCardExileZoneId(game, source), sourcePermanent.getName());
playerList.remove(playerId); playerList.remove(playerId);
} }
} else { } else {
@ -287,26 +284,23 @@ class JaceArchitectOfThoughtEffect3 extends OneShotEffect {
} else { } else {
break; break;
} }
for (UUID playerId : playerList) { playerList.stream().map((playerId) -> game.getPlayer(playerId)).filter((player) -> (player == null
Player player = game.getPlayer(playerId); || !player.canRespond())).forEachOrdered((player) -> {
if (player == null || !player.canRespond()) { playerList.remove(player.getId());
playerList.remove(player); });
} }
} checkList.stream().map((playerId) -> game.getPlayer(playerId)).filter((player) -> (player != null)).forEachOrdered((player) -> {
}
for (UUID playerId : checkList) {
Player player = game.getPlayer(playerId);
if (player != null) {
player.shuffleLibrary(source, game); player.shuffleLibrary(source, game);
} });
}
ExileZone jaceExileZone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source)); ExileZone jaceExileZone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source));
if (jaceExileZone == null) { if (jaceExileZone == null) {
return true; return true;
} }
FilterCard filter = new FilterCard("card to cast without mana costs"); FilterCard filter = new FilterCard("card to cast without mana costs");
TargetCardInExile target = new TargetCardInExile(filter, source.getSourceId()); TargetCardInExile target = new TargetCardInExile(filter, source.getSourceId());
while (jaceExileZone.count(filter, game) > 0 && controller.choose(Outcome.PlayForFree, jaceExileZone, target, game)) { while (jaceExileZone.count(filter, game) > 0
&& controller.chooseUse(Outcome.Benefit, "Cast another spell from exile zone for free?", source, game)) {
controller.choose(Outcome.PlayForFree, jaceExileZone, target, game);
Card card = game.getCard(target.getFirstTarget()); Card card = game.getCard(target.getFirstTarget());
if (card != null) { if (card != null) {
if (controller.cast(card.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game))) { if (controller.cast(card.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game))) {