Implemented Didn't Say Please

This commit is contained in:
Evan Kranzler 2019-09-20 19:28:04 -04:00
parent baf9dbabc5
commit 0d4bea3c4d
3 changed files with 74 additions and 1 deletions

View file

@ -0,0 +1,69 @@
package mage.cards.d;
import mage.abilities.Ability;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CounterTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetSpell;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class DidntSayPlease extends CardImpl {
public DidntSayPlease(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}{U}");
// Counter target spell. Its controller puts the top three cards of their library into their graveyard.
this.getSpellAbility().addEffect(new DidntSayPleaseEffect());
this.getSpellAbility().addTarget(new TargetSpell());
}
private DidntSayPlease(final DidntSayPlease card) {
super(card);
}
@Override
public DidntSayPlease copy() {
return new DidntSayPlease(this);
}
}
class DidntSayPleaseEffect extends OneShotEffect {
private static final Effect effect = new CounterTargetEffect();
DidntSayPleaseEffect() {
super(Outcome.Benefit);
staticText = "Counter target spell. Its controller puts " +
"the top three cards of their library into their graveyard.";
}
private DidntSayPleaseEffect(final DidntSayPleaseEffect effect) {
super(effect);
}
@Override
public DidntSayPleaseEffect copy() {
return new DidntSayPleaseEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(game.getControllerId(source.getFirstTarget()));
if (player == null) {
return false;
}
player.moveCards(player.getLibrary().getTopCards(game, 3), Zone.GRAVEYARD, source, game);
return effect.apply(game, source);
}
}

View file

@ -1,6 +1,7 @@
package mage.cards.t; package mage.cards.t;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.effects.common.CounterTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
@ -39,6 +40,8 @@ public final class ThoughtCollapse extends CardImpl {
class ThoughtCollapseEffect extends OneShotEffect { class ThoughtCollapseEffect extends OneShotEffect {
private static final Effect effect = new CounterTargetEffect();
ThoughtCollapseEffect() { ThoughtCollapseEffect() {
super(Outcome.Benefit); super(Outcome.Benefit);
staticText = "Counter target spell. Its controller puts " + staticText = "Counter target spell. Its controller puts " +
@ -61,6 +64,6 @@ class ThoughtCollapseEffect extends OneShotEffect {
return false; return false;
} }
player.moveCards(player.getLibrary().getTopCards(game, 3), Zone.GRAVEYARD, source, game); player.moveCards(player.getLibrary().getTopCards(game, 3), Zone.GRAVEYARD, source, game);
return new CounterTargetEffect().apply(game, source); return effect.apply(game, source);
} }
} }

View file

@ -73,6 +73,7 @@ public final class ThroneOfEldraine extends ExpansionSet {
cards.add(new SetCardInfo("Curious Pair", 150, Rarity.COMMON, mage.cards.c.CuriousPair.class)); cards.add(new SetCardInfo("Curious Pair", 150, Rarity.COMMON, mage.cards.c.CuriousPair.class));
cards.add(new SetCardInfo("Dance of the Manse", 186, Rarity.RARE, mage.cards.d.DanceOfTheManse.class)); cards.add(new SetCardInfo("Dance of the Manse", 186, Rarity.RARE, mage.cards.d.DanceOfTheManse.class));
cards.add(new SetCardInfo("Deafening Silence", 10, Rarity.UNCOMMON, mage.cards.d.DeafeningSilence.class)); cards.add(new SetCardInfo("Deafening Silence", 10, Rarity.UNCOMMON, mage.cards.d.DeafeningSilence.class));
cards.add(new SetCardInfo("Didn't Say Please", 42, Rarity.COMMON, mage.cards.d.DidntSayPlease.class));
cards.add(new SetCardInfo("Doom Foretold", 187, Rarity.RARE, mage.cards.d.DoomForetold.class)); cards.add(new SetCardInfo("Doom Foretold", 187, Rarity.RARE, mage.cards.d.DoomForetold.class));
cards.add(new SetCardInfo("Drown in the Loch", 188, Rarity.UNCOMMON, mage.cards.d.DrownInTheLoch.class)); cards.add(new SetCardInfo("Drown in the Loch", 188, Rarity.UNCOMMON, mage.cards.d.DrownInTheLoch.class));
cards.add(new SetCardInfo("Edgewall Innkeeper", 151, Rarity.UNCOMMON, mage.cards.e.EdgewallInnkeeper.class)); cards.add(new SetCardInfo("Edgewall Innkeeper", 151, Rarity.UNCOMMON, mage.cards.e.EdgewallInnkeeper.class));