[VOW] Implemented Dread Fugue

This commit is contained in:
Daniel Bomar 2021-11-06 08:16:03 -05:00
parent cafbac1d0d
commit 6947716978
No known key found for this signature in database
GPG key ID: C86C8658F4023918
2 changed files with 95 additions and 0 deletions

View file

@ -0,0 +1,94 @@
package mage.cards.d;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.CleaveAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.filter.common.FilterNonlandCard;
import mage.filter.predicate.mageobject.ManaValuePredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetCard;
import mage.target.TargetPlayer;
/**
*
* @author weirddan455
*/
public final class DreadFugue extends CardImpl {
private static final FilterNonlandCard filter = new FilterNonlandCard("nonland card [with mana value 2 or less]");
static {
filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, 3));
}
public DreadFugue(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}");
// Cleave {2}{B}
Ability ability = new CleaveAbility(this, new DreadFugueEffect(StaticFilters.FILTER_CARD_NON_LAND), "{2}{B}");
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
// Target player reveals their hand. You may choose a nonland card from it [with mana value 2 or less]. That player discards that card.
this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addEffect(new DreadFugueEffect(filter));
}
private DreadFugue(final DreadFugue card) {
super(card);
}
@Override
public DreadFugue copy() {
return new DreadFugue(this);
}
}
class DreadFugueEffect extends OneShotEffect {
private final FilterCard filter;
public DreadFugueEffect(FilterCard filter) {
super(Outcome.Discard);
this.filter = filter;
staticText = "Target player reveals their hand. You may choose a nonland card from it [with mana value 2 or less]. That player discards that card";
}
private DreadFugueEffect(final DreadFugueEffect effect) {
super(effect);
this.filter = effect.filter;
}
@Override
public DreadFugueEffect copy() {
return new DreadFugueEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player targetPlayer = game.getPlayer(source.getFirstTarget());
Player controller = game.getPlayer(source.getControllerId());
if (targetPlayer == null || controller == null) {
return false;
}
Card sourceCard = game.getCard(source.getSourceId());
targetPlayer.revealCards(sourceCard != null ? sourceCard.getIdName() + " ("
+ sourceCard.getZoneChangeCounter(game) + ')' : "Discard", targetPlayer.getHand(), game);
TargetCard target = new TargetCard(0, 1, Zone.HAND, filter);
controller.choose(Outcome.Benefit, targetPlayer.getHand(), target, game);
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
targetPlayer.discard(card, false, source, game);
}
return true;
}
}

View file

@ -97,6 +97,7 @@ public final class InnistradCrimsonVow extends ExpansionSet {
cards.add(new SetCardInfo("Dominating Vampire", 154, Rarity.RARE, mage.cards.d.DominatingVampire.class));
cards.add(new SetCardInfo("Doomed Dissenter", 106, Rarity.COMMON, mage.cards.d.DoomedDissenter.class));
cards.add(new SetCardInfo("Dormant Grove", 198, Rarity.UNCOMMON, mage.cards.d.DormantGrove.class));
cards.add(new SetCardInfo("Dread Fugue", 107, Rarity.UNCOMMON, mage.cards.d.DreadFugue.class));
cards.add(new SetCardInfo("Dreadfeast Demon", 108, Rarity.RARE, mage.cards.d.DreadfeastDemon.class));
cards.add(new SetCardInfo("Dreadlight Monstrosity", 57, Rarity.COMMON, mage.cards.d.DreadlightMonstrosity.class));
cards.add(new SetCardInfo("Dreamroot Cascade", 262, Rarity.RARE, mage.cards.d.DreamrootCascade.class));