diff --git a/Mage.Sets/src/mage/cards/b/BloodOath.java b/Mage.Sets/src/mage/cards/b/BloodOath.java index d9c07dda95..0edc503b6b 100644 --- a/Mage.Sets/src/mage/cards/b/BloodOath.java +++ b/Mage.Sets/src/mage/cards/b/BloodOath.java @@ -80,7 +80,7 @@ class BloodOathEffect extends OneShotEffect { if (player != null && opponent != null && sourceObject != null) { Choice choiceImpl = new ChoiceImpl(); choiceImpl.setChoices(choice); - if (!player.choose(Outcome.Neutral, choiceImpl, game)) { + if (player.choose(Outcome.Neutral, choiceImpl, game)) { CardType type = null; String choosenType = choiceImpl.getChoice(); diff --git a/Mage.Sets/src/mage/cards/f/FertileImagination.java b/Mage.Sets/src/mage/cards/f/FertileImagination.java new file mode 100644 index 0000000000..f25b42bef3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FertileImagination.java @@ -0,0 +1,125 @@ +package mage.cards.f; + +import java.util.LinkedHashSet; +import java.util.Set; +import java.util.UUID; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.token.SaprolingToken; +import mage.players.Player; +import mage.target.common.TargetOpponent; + +/** + * + * @author noahg + */ +public final class FertileImagination extends CardImpl { + + public FertileImagination(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}{G}"); + + + // Choose a card type. Target opponent reveals their hand. Create two 1/1 green Saproling creature tokens for each card of the chosen type revealed this way. + this.getSpellAbility().addEffect(new FertileImaginationEffect()); + this.getSpellAbility().addTarget(new TargetOpponent()); + } + + public FertileImagination(final FertileImagination card) { + super(card); + } + + @Override + public FertileImagination copy() { + return new FertileImagination(this); + } +} + +class FertileImaginationEffect extends OneShotEffect { + + private static final Set choice = new LinkedHashSet<>(); + + static { + choice.add(CardType.ARTIFACT.toString()); + choice.add(CardType.CREATURE.toString()); + choice.add(CardType.ENCHANTMENT.toString()); + choice.add(CardType.INSTANT.toString()); + choice.add(CardType.LAND.toString()); + choice.add(CardType.PLANESWALKER.toString()); + choice.add(CardType.SORCERY.toString()); + choice.add(CardType.TRIBAL.toString()); + } + + public FertileImaginationEffect() { + super(Outcome.Benefit); + staticText = "Choose a card type. Target opponent reveals their hand. Create two 1/1 green Saproling creature tokens for each card of the chosen type revealed this way"; + } + + public FertileImaginationEffect(final FertileImaginationEffect effect) { + super(effect); + } + + @Override + public FertileImaginationEffect copy() { + return new FertileImaginationEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + MageObject sourceObject = game.getObject(source.getSourceId()); + Player player = game.getPlayer(source.getControllerId()); + Player opponent = game.getPlayer(source.getFirstTarget()); + if (player != null && opponent != null && sourceObject != null) { + Choice choiceImpl = new ChoiceImpl(); + choiceImpl.setChoices(choice); + if (player.choose(Outcome.Neutral, choiceImpl, game)) { + CardType type = null; + String choosenType = choiceImpl.getChoice(); + + if (choosenType.equals(CardType.ARTIFACT.toString())) { + type = CardType.ARTIFACT; + } else if (choosenType.equals(CardType.LAND.toString())) { + type = CardType.LAND; + } else if (choosenType.equals(CardType.CREATURE.toString())) { + type = CardType.CREATURE; + } else if (choosenType.equals(CardType.ENCHANTMENT.toString())) { + type = CardType.ENCHANTMENT; + } else if (choosenType.equals(CardType.INSTANT.toString())) { + type = CardType.INSTANT; + } else if (choosenType.equals(CardType.SORCERY.toString())) { + type = CardType.SORCERY; + } else if (choosenType.equals(CardType.PLANESWALKER.toString())) { + type = CardType.PLANESWALKER; + } else if (choosenType.equals(CardType.TRIBAL.toString())) { + type = CardType.TRIBAL; + } + if (type != null) { + Cards hand = opponent.getHand(); + SaprolingToken saprolingToken = new SaprolingToken(); + opponent.revealCards(sourceObject.getIdName(), hand, game); + Set cards = hand.getCards(game); + int tokensToMake = 0; + for (Card card : cards) { + if (card != null && card.getCardType().contains(type)) { + tokensToMake += 2; + } + } + game.informPlayers(sourceObject.getLogName() + " creates " + (tokensToMake == 0 ? "no" : "" + tokensToMake) + " 1/1 green Saproling creature tokens."); + saprolingToken.putOntoBattlefield(tokensToMake, game, source.getId(), source.getControllerId()); + return true; + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/Dissension.java b/Mage.Sets/src/mage/sets/Dissension.java index 424df43ad9..7a258b0b16 100644 --- a/Mage.Sets/src/mage/sets/Dissension.java +++ b/Mage.Sets/src/mage/sets/Dissension.java @@ -74,6 +74,7 @@ public final class Dissension extends ExpansionSet { cards.add(new SetCardInfo("Entropic Eidolon", 45, Rarity.COMMON, mage.cards.e.EntropicEidolon.class)); cards.add(new SetCardInfo("Evolution Vat", 161, Rarity.RARE, mage.cards.e.EvolutionVat.class)); cards.add(new SetCardInfo("Experiment Kraj", 110, Rarity.RARE, mage.cards.e.ExperimentKraj.class)); + cards.add(new SetCardInfo("Fertile Imagination", 84, Rarity.UNCOMMON, mage.cards.f.FertileImagination.class)); cards.add(new SetCardInfo("Flame-Kin War Scout", 61, Rarity.UNCOMMON, mage.cards.f.FlameKinWarScout.class)); cards.add(new SetCardInfo("Flaring Flame-Kin", 62, Rarity.UNCOMMON, mage.cards.f.FlaringFlameKin.class)); cards.add(new SetCardInfo("Flash Foliage", 85, Rarity.UNCOMMON, mage.cards.f.FlashFoliage.class));