Implemented Deathbellow War Cry

This commit is contained in:
Evan Kranzler 2019-12-17 20:31:17 -05:00
parent d3114aaf89
commit 05f1cd8db9
2 changed files with 75 additions and 0 deletions

View file

@ -0,0 +1,74 @@
package mage.cards.d;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class DeathbellowWarCry extends CardImpl {
public DeathbellowWarCry(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{R}{R}{R}");
// Search your library for up to four Minotaur creature cards with different names, put them onto the battlefield, then shuffle your library.
this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new DeathbellowWarCryTarget()));
}
private DeathbellowWarCry(final DeathbellowWarCry card) {
super(card);
}
@Override
public DeathbellowWarCry copy() {
return new DeathbellowWarCry(this);
}
}
class DeathbellowWarCryTarget extends TargetCardInLibrary {
private static final FilterCard filter
= new FilterCreatureCard("Minotaur creature cards with different names");
static {
filter.add(new SubtypePredicate(SubType.MINOTAUR));
}
DeathbellowWarCryTarget() {
super(0, 4, filter);
}
private DeathbellowWarCryTarget(final DeathbellowWarCryTarget target) {
super(target);
}
@Override
public DeathbellowWarCryTarget copy() {
return new DeathbellowWarCryTarget(this);
}
@Override
public boolean canTarget(UUID id, Cards cards, Game game) {
Card card = cards.get(id, game);
return card != null
&& filter.match(card, game)
&& this
.getTargets()
.stream()
.map(game::getCard)
.map(Card::getName)
.noneMatch(card.getName()::equals);
}
}

View file

@ -30,6 +30,7 @@ public final class TherosBeyondDeath extends ExpansionSet {
cards.add(new SetCardInfo("Ashiok, Sculptor of Fears", 274, Rarity.MYTHIC, mage.cards.a.AshiokSculptorOfFears.class));
cards.add(new SetCardInfo("Commanding Presence", 7, Rarity.UNCOMMON, mage.cards.c.CommandingPresence.class));
cards.add(new SetCardInfo("Daxos, Blessed by the Sun", 9, Rarity.UNCOMMON, mage.cards.d.DaxosBlessedByTheSun.class));
cards.add(new SetCardInfo("Deathbellow War Cry", 294, Rarity.RARE, mage.cards.d.DeathbellowWarCry.class));
cards.add(new SetCardInfo("Eidolon of Philosophy", 48, Rarity.COMMON, mage.cards.e.EidolonOfPhilosophy.class));
cards.add(new SetCardInfo("Elspeth, Sun's Nemesis", 14, Rarity.MYTHIC, mage.cards.e.ElspethSunsNemesis.class));
cards.add(new SetCardInfo("Elspeth, Undaunted Hero", 270, Rarity.MYTHIC, mage.cards.e.ElspethUndauntedHero.class));