forked from External/mage
[STX] Implemented Ardent Dustspeaker (#7717)
* [STX] Implemented Ardent Dustspeaker * Declare filter as static
This commit is contained in:
parent
bffe1b2ce6
commit
fbe6e490e9
2 changed files with 96 additions and 0 deletions
95
Mage.Sets/src/mage/cards/a/ArdentDustspeaker.java
Normal file
95
Mage.Sets/src/mage/cards/a/ArdentDustspeaker.java
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.CostImpl;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterInstantOrSorceryCard;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class ArdentDustspeaker extends CardImpl {
|
||||
|
||||
public ArdentDustspeaker(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}");
|
||||
|
||||
this.subtype.add(SubType.MINOTAUR);
|
||||
this.subtype.add(SubType.SHAMAN);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Whenever Ardent Dustspeaker attacks, you may put an instant or sorcery card from your graveyard on the bottom of your library.
|
||||
// If you do, exile the top two cards of your library. You may play those cards this turn.
|
||||
this.addAbility(new AttacksTriggeredAbility(
|
||||
new DoIfCostPaid(new ExileTopXMayPlayUntilEndOfTurnEffect(2), new ArdentDustspeakerCost()),
|
||||
false
|
||||
));
|
||||
}
|
||||
|
||||
private ArdentDustspeaker(final ArdentDustspeaker card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArdentDustspeaker copy() {
|
||||
return new ArdentDustspeaker(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ArdentDustspeakerCost extends CostImpl {
|
||||
|
||||
private static final FilterCard filter
|
||||
= new FilterInstantOrSorceryCard("instant or sorcery card from your graveyard");
|
||||
|
||||
public ArdentDustspeakerCost() {
|
||||
TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(filter);
|
||||
target.setNotTarget(true);
|
||||
this.addTarget(target);
|
||||
this.text = "put an instant or sorcery card from your graveyard on the bottom of your library";
|
||||
}
|
||||
|
||||
private ArdentDustspeakerCost(final ArdentDustspeakerCost cost) {
|
||||
super(cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArdentDustspeakerCost copy() {
|
||||
return new ArdentDustspeakerCost(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPay(Ability ability, Ability source, UUID controllerId, Game game) {
|
||||
return targets.canChoose(source.getSourceId(), controllerId, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean pay(Ability ability, Game game, Ability source, UUID controllerId, boolean noMana, Cost costToPay) {
|
||||
Player controller = game.getPlayer(controllerId);
|
||||
if (controller != null) {
|
||||
if (controller.chooseTarget(Outcome.Benefit, targets.get(0), source, game)) {
|
||||
Card card = game.getCard(targets.get(0).getFirstTarget());
|
||||
if (card != null) {
|
||||
controller.putCardsOnBottomOfLibrary(card, game, source, true);
|
||||
paid = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return paid;
|
||||
}
|
||||
}
|
||||
|
|
@ -40,6 +40,7 @@ public final class StrixhavenSchoolOfMages extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Arcane Subtraction", 36, Rarity.COMMON, mage.cards.a.ArcaneSubtraction.class));
|
||||
cards.add(new SetCardInfo("Archmage Emeritus", 37, Rarity.RARE, mage.cards.a.ArchmageEmeritus.class));
|
||||
cards.add(new SetCardInfo("Archway Commons", 263, Rarity.COMMON, mage.cards.a.ArchwayCommons.class));
|
||||
cards.add(new SetCardInfo("Ardent Dustspeaker", 92, Rarity.UNCOMMON, mage.cards.a.ArdentDustspeaker.class));
|
||||
cards.add(new SetCardInfo("Arrogant Poet", 63, Rarity.COMMON, mage.cards.a.ArrogantPoet.class));
|
||||
cards.add(new SetCardInfo("Bayou Groff", 121, Rarity.COMMON, mage.cards.b.BayouGroff.class));
|
||||
cards.add(new SetCardInfo("Beaming Defiance", 9, Rarity.COMMON, mage.cards.b.BeamingDefiance.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue