diff --git a/Mage.Sets/src/mage/cards/v/VoloGuideToMonsters.java b/Mage.Sets/src/mage/cards/v/VoloGuideToMonsters.java new file mode 100644 index 0000000000..c86ac91d54 --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/VoloGuideToMonsters.java @@ -0,0 +1,80 @@ +package mage.cards.v; + +import mage.MageInt; +import mage.MageObject; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.CopyTargetSpellEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.FilterSpell; +import mage.filter.StaticFilters; +import mage.filter.common.FilterCreatureSpell; +import mage.filter.predicate.ObjectSourcePlayer; +import mage.filter.predicate.ObjectSourcePlayerPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.util.CardUtil; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class VoloGuideToMonsters extends CardImpl { + + private static final FilterSpell filter = new FilterCreatureSpell( + "a creature spell that doesn't share a creature type " + + "with a creature you control or a creature card in your graveyard" + ); + + public VoloGuideToMonsters(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{U}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Whenever you cast a creature spell that doesn't share a creature type with a creature you control or a creature card in your graveyard, copy that spell. + this.addAbility(new SpellCastControllerTriggeredAbility( + new CopyTargetSpellEffect(true) + .setText("copy that spell"), + filter, false, true + )); + } + + private VoloGuideToMonsters(final VoloGuideToMonsters card) { + super(card); + } + + @Override + public VoloGuideToMonsters copy() { + return new VoloGuideToMonsters(this); + } +} + +enum VoloGuideToMonstersPredicate implements ObjectSourcePlayerPredicate> { + instance; + + @Override + public boolean apply(ObjectSourcePlayer input, Game game) { + Player player = game.getPlayer(input.getPlayerId()); + if (player != null + && player + .getGraveyard() + .getCards(StaticFilters.FILTER_CARD_CREATURE, game) + .stream() + .anyMatch(card -> CardUtil.haveSameNames(card, input.getObject()))) { + return false; + } + return game + .getBattlefield() + .getActivePermanents(StaticFilters.FILTER_CONTROLLED_CREATURE, input.getPlayerId(), game) + .stream() + .noneMatch(permanent -> CardUtil.haveSameNames(permanent, input.getObject())); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java index 92a26ff819..02ea0787d0 100644 --- a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java +++ b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java @@ -218,6 +218,7 @@ public final class AdventuresInTheForgottenRealms extends ExpansionSet { cards.add(new SetCardInfo("Vampire Spawn", 123, Rarity.COMMON, mage.cards.v.VampireSpawn.class)); cards.add(new SetCardInfo("Varis, Silverymoon Ranger", 209, Rarity.RARE, mage.cards.v.VarisSilverymoonRanger.class)); cards.add(new SetCardInfo("Veteran Dungeoneer", 40, Rarity.COMMON, mage.cards.v.VeteranDungeoneer.class)); + cards.add(new SetCardInfo("Volo, Guide to Monsters", 238, Rarity.RARE, mage.cards.v.VoloGuideToMonsters.class)); cards.add(new SetCardInfo("Vorpal Sword", 124, Rarity.RARE, mage.cards.v.VorpalSword.class)); cards.add(new SetCardInfo("Wandering Troubadour", 210, Rarity.UNCOMMON, mage.cards.w.WanderingTroubadour.class)); cards.add(new SetCardInfo("Werewolf Pack Leader", 211, Rarity.RARE, mage.cards.w.WerewolfPackLeader.class));