[AFR] Implemented Volo, Guide to Monsters

This commit is contained in:
Evan Kranzler 2021-07-08 07:40:49 -04:00
parent 85562ec9ab
commit 591099c080
2 changed files with 81 additions and 0 deletions

View file

@ -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<ObjectSourcePlayer<MageObject>> {
instance;
@Override
public boolean apply(ObjectSourcePlayer<MageObject> 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()));
}
}

View file

@ -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));