mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
* See the Unwritten - Fxed that the selection of creatures was not optional.
This commit is contained in:
parent
0a23fe1e8a
commit
d35b168cd5
1 changed files with 13 additions and 13 deletions
|
@ -30,7 +30,6 @@ package mage.sets.khansoftarkir;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.Mode;
|
|
||||||
import mage.abilities.condition.InvertCondition;
|
import mage.abilities.condition.InvertCondition;
|
||||||
import mage.abilities.condition.common.FerociousCondition;
|
import mage.abilities.condition.common.FerociousCondition;
|
||||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||||
|
@ -47,7 +46,6 @@ import mage.filter.common.FilterCreatureCard;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetCard;
|
import mage.target.TargetCard;
|
||||||
import mage.util.CardUtil;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -114,32 +112,34 @@ class SeeTheUnwrittenEffect extends OneShotEffect {
|
||||||
if (player != null && sourceObject != null) {
|
if (player != null && sourceObject != null) {
|
||||||
Cards cards = new CardsImpl(Zone.LIBRARY);
|
Cards cards = new CardsImpl(Zone.LIBRARY);
|
||||||
|
|
||||||
boolean properCardFound = false;
|
int creatureCardsFound = 0;
|
||||||
int count = Math.min(player.getLibrary().size(), 8);
|
int count = Math.min(player.getLibrary().size(), 8);
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
Card card = player.getLibrary().removeFromTop(game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
cards.add(card);
|
cards.add(card);
|
||||||
if (filter.match(card, source.getSourceId(), source.getControllerId(), game)) {
|
if (filter.match(card, source.getSourceId(), source.getControllerId(), game)) {
|
||||||
properCardFound = true;
|
creatureCardsFound++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cards.isEmpty()) {
|
if (!cards.isEmpty()) {
|
||||||
player.revealCards(sourceObject.getLogName(), cards, game);
|
player.revealCards(sourceObject.getLogName(), cards, game);
|
||||||
TargetCard target = new TargetCard(numberOfCardsToPutIntoPlay, numberOfCardsToPutIntoPlay, Zone.LIBRARY, filter);
|
if (creatureCardsFound > 0 && player.chooseUse(outcome, "Put creature(s) into play?", game)) {
|
||||||
if (properCardFound && player.choose(Outcome.PutCreatureInPlay, cards, target, game)) {
|
int cardsToChoose = Math.min(numberOfCardsToPutIntoPlay, creatureCardsFound);
|
||||||
for(UUID creatureId: target.getTargets()) {
|
TargetCard target = new TargetCard(cardsToChoose, cardsToChoose, Zone.LIBRARY, filter);
|
||||||
Card card = game.getCard(creatureId);
|
if (player.choose(Outcome.PutCreatureInPlay, cards, target, game)) {
|
||||||
if (card != null) {
|
for(UUID creatureId: target.getTargets()) {
|
||||||
cards.remove(card);
|
Card card = game.getCard(creatureId);
|
||||||
player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId());
|
if (card != null) {
|
||||||
|
cards.remove(card);
|
||||||
|
player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (UUID cardId : cards) {
|
for (UUID cardId : cards) {
|
||||||
Card card = game.getCard(cardId);
|
Card card = game.getCard(cardId);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
|
|
Loading…
Reference in a new issue