[MOM] Implement Ayara, Widow of the Realm / Ayara, Furnace Queen

This commit is contained in:
theelk801 2023-04-17 09:24:50 -04:00
parent 6ce6168ecc
commit a0505ab228
3 changed files with 177 additions and 0 deletions

View file

@ -0,0 +1,106 @@
package mage.cards.a;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class AyaraFurnaceQueen extends CardImpl {
private static final FilterCard filter = new FilterCard("artifact or creature card from your graveyard");
static {
filter.add(Predicates.or(
CardType.ARTIFACT.getPredicate(),
CardType.CREATURE.getPredicate()
));
}
public AyaraFurnaceQueen(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.PHYREXIAN);
this.subtype.add(SubType.ELF);
this.subtype.add(SubType.NOBLE);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
this.color.setBlack(true);
this.color.setRed(true);
this.nightCard = true;
// At the beginning of combat on your turn, return up to one target artifact or creature card from your graveyard to the battlefield. It gains haste. Exile it at the beginning of the next end step.
Ability ability = new BeginningOfCombatTriggeredAbility(
new AyaraFurnaceQueenEffect(), TargetController.YOU, false
);
ability.addTarget(new TargetCardInYourGraveyard(0, 1, filter));
this.addAbility(ability);
}
private AyaraFurnaceQueen(final AyaraFurnaceQueen card) {
super(card);
}
@Override
public AyaraFurnaceQueen copy() {
return new AyaraFurnaceQueen(this);
}
}
class AyaraFurnaceQueenEffect extends OneShotEffect {
AyaraFurnaceQueenEffect() {
super(Outcome.Benefit);
staticText = "return up to one target artifact or creature card from your graveyard " +
"to the battlefield. It gains haste. Exile it at the beginning of the next end step";
}
private AyaraFurnaceQueenEffect(final AyaraFurnaceQueenEffect effect) {
super(effect);
}
@Override
public AyaraFurnaceQueenEffect copy() {
return new AyaraFurnaceQueenEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Card card = game.getCard(getTargetPointer().getFirst(game, source));
if (player == null || card == null) {
return false;
}
player.moveCards(card, Zone.BATTLEFIELD, source, game);
if (game.getPermanent(card.getId()) == null) {
return false;
}
game.addEffect(new GainAbilityTargetEffect(
HasteAbility.getInstance(), Duration.Custom
).setTargetPointer(new FixedTarget(card.getId(), game)), source);
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(
new ExileTargetEffect().setText("exile it")
.setTargetPointer(new FixedTarget(card.getId(), game)),
TargetController.ANY
), source);
return true;}
}

View file

@ -0,0 +1,69 @@
package mage.cards.a;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.SacrificeCostConvertedMana;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.filter.FilterOpponent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterPermanentOrPlayer;
import mage.target.common.TargetPermanentOrPlayer;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class AyaraWidowOfTheRealm extends CardImpl {
private static final DynamicValue xValue = new SacrificeCostConvertedMana("permanent");
private static final FilterPermanentOrPlayer filter = new FilterPermanentOrPlayer(
"opponent or battle", StaticFilters.FILTER_PERMANENT_BATTLE, new FilterOpponent()
);
public AyaraWidowOfTheRealm(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{B}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.ELF);
this.subtype.add(SubType.NOBLE);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
this.secondSideCardClazz = mage.cards.a.AyaraFurnaceQueen.class;
// {T}, Sacrifice another creature or artifact: Ayara, Widow of the Realm deals X damage to target opponent or battle and you gain X life, where X is the sacrificed permanent's mana value.
Ability ability = new SimpleActivatedAbility(new DamageTargetEffect(xValue)
.setText("deals X damage to target opponent or battle"), new TapSourceCost());
ability.addCost(new SacrificeTargetCost(StaticFilters.FILTER_CONTROLLED_ANOTHER_ARTIFACT_OR_CREATURE_SHORT_TEXT));
ability.addEffect(new GainLifeEffect(xValue).concatBy("and"));
ability.addTarget(new TargetPermanentOrPlayer(filter));
this.addAbility(ability);
// {5}{R/P}: Transform Ayara. Activate only as a sorcery.
this.addAbility(new TransformAbility());
this.addAbility(new ActivateAsSorceryActivatedAbility(new TransformSourceEffect(), new ManaCostsImpl<>("{5}{R/P}")));
}
private AyaraWidowOfTheRealm(final AyaraWidowOfTheRealm card) {
super(card);
}
@Override
public AyaraWidowOfTheRealm copy() {
return new AyaraWidowOfTheRealm(this);
}
}

View file

@ -44,6 +44,8 @@ public final class MarchOfTheMachine extends ExpansionSet {
cards.add(new SetCardInfo("Attentive Skywarden", 7, Rarity.COMMON, mage.cards.a.AttentiveSkywarden.class));
cards.add(new SetCardInfo("Awaken the Maelstrom", 230, Rarity.RARE, mage.cards.a.AwakenTheMaelstrom.class));
cards.add(new SetCardInfo("Awakened Skyclave", 194, Rarity.UNCOMMON, mage.cards.a.AwakenedSkyclave.class));
cards.add(new SetCardInfo("Ayara, Furnace Queen", 90, Rarity.RARE, mage.cards.a.AyaraFurnaceQueen.class));
cards.add(new SetCardInfo("Ayara, Widow of the Realm", 90, Rarity.RARE, mage.cards.a.AyaraWidowOfTheRealm.class));
cards.add(new SetCardInfo("Baral and Kari Zev", 218, Rarity.RARE, mage.cards.b.BaralAndKariZev.class));
cards.add(new SetCardInfo("Beamtown Beatstick", 131, Rarity.COMMON, mage.cards.b.BeamtownBeatstick.class));
cards.add(new SetCardInfo("Belenon War Anthem", 20, Rarity.UNCOMMON, mage.cards.b.BelenonWarAnthem.class));