[BRO] Implemented Mishra, Claimed by Gix / Phyrexian Dragon Engine / Mishra, Lost to Phyrexia

This commit is contained in:
Evan Kranzler 2022-10-05 18:29:00 -04:00
parent 5a4d755dba
commit 55e9314135
8 changed files with 294 additions and 8 deletions

View file

@ -0,0 +1,66 @@
package mage.cards.m;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksWithCreaturesTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.MeldCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.AttackingCreatureCount;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LoseLifeOpponentsEffect;
import mage.abilities.effects.common.MeldEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class MishraClaimedByGix extends CardImpl {
private static final DynamicValue xValue = new AttackingCreatureCount();
private static final Condition condition = new MeldCondition(
"Phyrexian Dragon Engine", CardType.CREATURE, true
);
public MishraClaimedByGix(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{R}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.PHYREXIAN);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.ARTIFICER);
this.power = new MageInt(3);
this.toughness = new MageInt(5);
this.meldsWithClazz = mage.cards.p.PhyrexianDragonEngine.class;
// Whenever you attack, each opponent loses X life and you gain X life, where X is the number of attacking creatures. If Mishra, Claimed by Gix and a creature named Phyrexian Dragon Engine are attacking, and you both own and control them, exile them, then meld them into Mishra, Lost to Phyrexia. It enters the battlefield tapped and attacking.
Ability ability = new AttacksWithCreaturesTriggeredAbility(
new LoseLifeOpponentsEffect(xValue).setText("each opponent loses X life"), 1
);
ability.addEffect(new GainLifeEffect(xValue)
.setText("and you gain X life, where X is the number of attacking creatures."));
ability.addEffect(new ConditionalOneShotEffect(
new MeldEffect("Phyrexian Dragon Engine", "Mishra, Lost to Phyrexia", true),
condition, "If {this} and a creature named Phyrexian Dragon Engine are attacking, " +
"and you both own and control them, exile them, then meld them into Mishra, Lost to Phyrexia. " +
"It enters the battlefield tapped and attacking"
));
this.addAbility(ability);
}
private MishraClaimedByGix(final MishraClaimedByGix card) {
super(card);
}
@Override
public MishraClaimedByGix copy() {
return new MishraClaimedByGix(this);
}
}

View file

@ -0,0 +1,98 @@
package mage.cards.m;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.EntersBattlefieldOrAttacksSourceTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.abilities.keyword.MenaceAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardSetInfo;
import mage.cards.MeldCard;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.predicate.Predicates;
import mage.game.permanent.token.PowerstoneToken;
import mage.target.TargetPermanent;
import mage.target.common.TargetAnyTarget;
import mage.target.common.TargetOpponent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class MishraLostToPhyrexia extends MeldCard {
private static final FilterPermanent filter = new FilterPermanent("artifact or planeswalker");
static {
filter.add(Predicates.or(
CardType.ARTIFACT.getPredicate(),
CardType.PLANESWALKER.getPredicate()
));
}
public MishraLostToPhyrexia(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.PHYREXIAN);
this.subtype.add(SubType.ARTIFICER);
this.power = new MageInt(9);
this.toughness = new MageInt(9);
this.color.setBlack(true);
this.color.setRed(true);
// Whenever Mishra, Lost to Phyrexia enters the battlefield or attacks, choose three --
// * Target opponent discards two cards.
Ability ability = new EntersBattlefieldOrAttacksSourceTriggeredAbility(new DiscardTargetEffect(2));
ability.addTarget(new TargetOpponent());
ability.getModes().setMinModes(3);
ability.getModes().setMaxModes(3);
// * Mishra deals 3 damage to any target.
ability.addMode(new Mode(new DamageTargetEffect(3)).addTarget(new TargetAnyTarget()));
// * Destroy target artifact or planeswalker.
ability.addMode(new Mode(new DestroyTargetEffect()).addTarget(new TargetPermanent(filter)));
// * Creatures you control gain menace and trample until end of turn.
ability.addMode(new Mode(new GainAbilityControlledEffect(
new MenaceAbility(false), Duration.EndOfTurn,
StaticFilters.FILTER_PERMANENT_CREATURE
).setText("creatures you control gain menace")).addEffect(new GainAbilityControlledEffect(
TrampleAbility.getInstance(), Duration.EndOfTurn,
StaticFilters.FILTER_PERMANENT_CREATURE
).setText("and trample until end of turn")));
// * Creatures you don't control get -1/-1 until end of turn.
ability.addMode(new Mode(new BoostAllEffect(
-1, -1, Duration.EndOfTurn,
StaticFilters.FILTER_CREATURES_YOU_DONT_CONTROL, false
)));
// * Create two tapped Powerstone tokens.
ability.addMode(new Mode(new CreateTokenEffect(new PowerstoneToken(), 2, true, false)));
this.addAbility(ability);
}
private MishraLostToPhyrexia(final MishraLostToPhyrexia card) {
super(card);
}
@Override
public MishraLostToPhyrexia copy() {
return new MishraLostToPhyrexia(this);
}
}

View file

@ -0,0 +1,63 @@
package mage.cards.p;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldFromGraveyardTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.DiscardHandCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.InfoEffect;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.abilities.keyword.UnearthAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.constants.Zone;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class PhyrexianDragonEngine extends CardImpl {
public PhyrexianDragonEngine(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}");
this.subtype.add(SubType.PHYREXIAN);
this.subtype.add(SubType.DRAGON);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
this.meldsWithClazz = mage.cards.m.MishraClaimedByGix.class;
// Double strike
this.addAbility(DoubleStrikeAbility.getInstance());
// When Phyrexian Dragon Engine enters the battlefield from your graveyard, you may discard your hand. If you do, draw three cards.
this.addAbility(new EntersBattlefieldFromGraveyardTriggeredAbility(
new DoIfCostPaid(
new DrawCardSourceControllerEffect(3), new DiscardHandCost()
), TargetController.YOU
));
// Unearth {3}{R}{R}
this.addAbility(new UnearthAbility(new ManaCostsImpl<>("{3}{R}{R}")));
// (Melds with Mishra, Claimed by Gix.)
this.addAbility(new SimpleStaticAbility(
Zone.ALL, new InfoEffect("<i>(Melds with Mishra, Claimed by Gix.)</i>")
));
}
private PhyrexianDragonEngine(final PhyrexianDragonEngine card) {
super(card);
}
@Override
public PhyrexianDragonEngine copy() {
return new PhyrexianDragonEngine(this);
}
}

View file

@ -23,7 +23,10 @@ public final class TheBrothersWar extends ExpansionSet {
cards.add(new SetCardInfo("Forest", 286, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("Island", 280, Rarity.LAND, mage.cards.basiclands.Island.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("Mishra's Foundry", 265, Rarity.RARE, mage.cards.m.MishrasFoundry.class));
cards.add(new SetCardInfo("Mishra, Claimed by Gix", 216, Rarity.MYTHIC, mage.cards.m.MishraClaimedByGix.class));
cards.add(new SetCardInfo("Mishra, Lost to Phyrexia", "163b", Rarity.MYTHIC, mage.cards.m.MishraLostToPhyrexia.class));
cards.add(new SetCardInfo("Mountain", 284, Rarity.LAND, mage.cards.basiclands.Mountain.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("Phyrexian Dragon Engine", "163a", Rarity.RARE, mage.cards.p.PhyrexianDragonEngine.class));
cards.add(new SetCardInfo("Plains", 278, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("Queen Kayla bin-Kroog", 218, Rarity.RARE, mage.cards.q.QueenKaylaBinKroog.class));
cards.add(new SetCardInfo("Recruitment Officer", 23, Rarity.UNCOMMON, mage.cards.r.RecruitmentOfficer.class));

View file

@ -2,6 +2,7 @@ package mage.abilities.common;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.EntersTheBattlefieldEvent;
@ -12,13 +13,21 @@ import mage.game.events.GameEvent;
*/
public class EntersBattlefieldFromGraveyardTriggeredAbility extends TriggeredAbilityImpl {
private final TargetController targetController;
public EntersBattlefieldFromGraveyardTriggeredAbility(Effect effect) {
this(effect, TargetController.ANY);
}
public EntersBattlefieldFromGraveyardTriggeredAbility(Effect effect, TargetController targetController) {
super(Zone.BATTLEFIELD, effect, false);
setTriggerPhrase("When {this} enters the battlefield from a graveyard, ");
this.targetController = targetController;
setTriggerPhrase(generateTriggerPhrase());
}
public EntersBattlefieldFromGraveyardTriggeredAbility(final EntersBattlefieldFromGraveyardTriggeredAbility ability) {
super(ability);
this.targetController = ability.targetController;
}
@Override
@ -29,11 +38,29 @@ public class EntersBattlefieldFromGraveyardTriggeredAbility extends TriggeredAbi
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getTargetId().equals(getSourceId())
&& ((EntersTheBattlefieldEvent) event).getFromZone() == Zone.GRAVEYARD;
&& ((EntersTheBattlefieldEvent) event).getFromZone() == Zone.GRAVEYARD
&& (targetController == TargetController.ANY
|| (targetController == TargetController.YOU
&& isControlledBy(game.getOwnerId(event.getTargetId()))));
}
@Override
public EntersBattlefieldFromGraveyardTriggeredAbility copy() {
return new EntersBattlefieldFromGraveyardTriggeredAbility(this);
}
private String generateTriggerPhrase() {
StringBuilder sb = new StringBuilder("When {this} enters the battlefield from ");
switch (targetController) {
case YOU:
sb.append("your");
break;
case ANY:
sb.append("a");
default:
throw new UnsupportedOperationException("TargetController " + targetController + "not supported");
}
sb.append(" graveyard, ");
return sb.toString();
}
}

View file

@ -7,6 +7,7 @@ import mage.constants.TargetController;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.NamePredicate;
import mage.filter.predicate.permanent.AttackingPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.util.CardUtil;
@ -18,12 +19,17 @@ public class MeldCondition implements Condition {
private final String message;
private final FilterPermanent filter;
private final boolean attacking;
public MeldCondition(String meldWithName) {
this(meldWithName, CardType.CREATURE);
}
public MeldCondition(String meldWithName, CardType cardType) {
this(meldWithName, cardType, false);
}
public MeldCondition(String meldWithName, CardType cardType, boolean attacking) {
this.message = "you both own and control {this} and "
+ CardUtil.addArticle(cardType.toString().toLowerCase())
+ " named " + meldWithName;
@ -31,6 +37,10 @@ public class MeldCondition implements Condition {
this.filter.add(TargetController.YOU.getOwnerPredicate());
this.filter.add(cardType.getPredicate());
this.filter.add(new NamePredicate(meldWithName));
if (attacking) {
this.filter.add(AttackingPredicate.instance);
}
this.attacking = attacking;
}
@Override
@ -39,6 +49,7 @@ public class MeldCondition implements Condition {
return sourcePermanent != null
&& sourcePermanent.isControlledBy(source.getControllerId())
&& sourcePermanent.isOwnedBy(source.getControllerId())
&& (!attacking || sourcePermanent.isAttacking())
&& game.getBattlefield().contains(filter, source, game, 1);
}

View file

@ -15,6 +15,7 @@ import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.NamePredicate;
import mage.filter.predicate.permanent.AttackingPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
@ -29,17 +30,24 @@ public class MeldEffect extends OneShotEffect {
private final String meldWithName;
private final String meldIntoName;
private final boolean attacking;
public MeldEffect(String meldWithName, String meldIntoName) {
this(meldWithName, meldIntoName, false);
}
public MeldEffect(String meldWithName, String meldIntoName, boolean attacking) {
super(Outcome.Benefit);
this.meldWithName = meldWithName;
this.meldIntoName = meldIntoName;
this.attacking = attacking;
}
public MeldEffect(final MeldEffect effect) {
super(effect);
this.meldWithName = effect.meldWithName;
this.meldIntoName = effect.meldIntoName;
this.attacking = effect.attacking;
}
@Override
@ -54,6 +62,7 @@ public class MeldEffect extends OneShotEffect {
if (controller == null
|| sourcePermanent == null
|| !sourcePermanent.isControlledBy(controller.getId())
|| (attacking && !sourcePermanent.isAttacking())
|| !sourcePermanent.isOwnedBy(controller.getId())) {
return false;
}
@ -61,6 +70,9 @@ public class MeldEffect extends OneShotEffect {
FilterPermanent filter = new FilterControlledPermanent("permanent named " + meldWithName);
filter.add(new NamePredicate(meldWithName));
filter.add(TargetController.YOU.getOwnerPredicate());
if (attacking) {
filter.add(AttackingPredicate.instance);
}
if (!game.getBattlefield().contains(filter, source, game, 1)) {
return false;
}
@ -101,7 +113,10 @@ public class MeldEffect extends OneShotEffect {
game.addMeldCard(meldCard.getId(), meldCard);
game.getState().addCard(meldCard);
meldCard.setZone(Zone.EXILED, game);
controller.moveCards(meldCard, Zone.BATTLEFIELD, source, game);
controller.moveCards(meldCard, Zone.BATTLEFIELD, source, game, attacking, false, false, null);
if (attacking) {
game.getCombat().addAttackingCreature(meldCard.getId(), game);
}
return true;
}
}

View file

@ -46215,11 +46215,14 @@ Nogi, Draco-Zealot|Game Night 2022|4|M|{1}{R}{R}|Legendary Creature - Kobold Sha
Imaryll, Elfhame Elite|Game Night 2022|6|M|{2}{G}{G}|Legendary Creature - Elf Warrior|3|3|Whenever Imaryll, Elfhame Elite attacks, it gets +X/+X until end of turn, where X is the number of other Elves you control.$You may have Imaryll assign its combat damage as though it weren't blocked.|
Recruitment Officer|The Brothers' War|23|U|{W}|Creature - Human Soldier|2|1|{3}{W}: Look at the top four cards of your library. You may reveal a creature card with mana value 3 or less from among them and put it into your hand. Put the rest on the bottom of your library in a random order.|
Surge Engine|The Brothers' War|81|M|{2}|Artifact Creature - Construct|3|2|Defender${U}: Surge Engine loses defender and gains "This creature can't be blocked."${2}{U}: Surge Engine becomes blue and has base power and toughness 5/4. Activate only if Surge Engine doesn't have defender.${4}{U}{U}: Draw three cards. Activate only if Surge Engine is blue and only once.|
Queen Kayla bin-Kroog|The Brothers' War|218|R|{1}{R}{W}|Legendary Creature - Human Noble|2|3|{4}, {T}: Discard all the cards in your hand, then draw that many cards. You may chose an artifact or creature card with mana value 1 you discarded this way, then do the same for artifact or creature cards with mana values 2 and 3. Return those cards to the battlefield. Activate only as a sorcery.|
Urza, Lord Protector|The Brothers' War|225|M|{1}{W}{U}|Legendary Creature - Human Artificer|2|4|Artifact, instant, and sorcery spells you cast cost {1} less to cast.${7}: If you both own and control Urza, Lord Protector an artifact named The Mightstone and Weakstone, exile them, then meld them into Urza, Planeswalker. Activate only as a sorcery.|
The Mightstone and Weakstone|The Brothers' War|238a|R|{5}|Legendary Artifact - Powerstone|||When The Mightstone and Weakstone enters the battlefield, choose one --$* Draw two cards.$* Target creature gets -5/-5 until end of turn.${T}: Add {C}{C}. This mana can't be spent to cast nonartifact spells.|
Urza, Planeswalker|The Brothers' War|238b|M||Legendary Planeswalker - Urza|7|You may activate the loyalty abilities of Urza, Planeswalker twice each turn rather than only once.$+2: Artifact, instant, and sorcery spells you cast this turn cost {2} less to cast. You gain 2 life.$+1: Draw two cards, then discard a card.$0: Create two 1/1 colorless Soldier artifact creature tokens.$-3: Exile target nonland permanent.$-10: Artifacts and planeswalkers you control gain indestructible until end of turn. Destroy all nonland permanents.|
Mishra's Foundry|The Brothers' War|265|R||Land|||{T}: Add {C}.${2}: Mishra's Foundry becomes a 2/2 Assembly-Worker artifact creature until end of turn. It's still a land.${1}, {T}: Target Assembly-Worker gets +2/+2 until end of turn.|
Mishra, Lost to Phyrexia|The Brothers' War|163b|M||Legendary Artifact Creature - Phyrexian Artificer|9|9|Whenever Mishra, Lost to Phyrexia enters the battlefield or attacks, choose three --$* Target opponent discards two cards.$* Mishra deals 3 damage to any target.$* Destroy target artifact or planeswalker.$* Creatures you control gain menace and trample until end of turn.$* Creatures you don't control get -1/-1 until end of turn.$* Create two tapped Powerstone tokens.|
Phyrexian Dragon Engine|The Brothers' War|163a|R|{3}|Artifact Creature - Phyrexian Dragon|2|2|Double strike$When Phyrexian Dragon Engine enters the battlefield from your graveyard, you may discard your hand. If you do, draw three cards.$Unearth {3}{R}{R}$(Melds with Mishra, Claimed by Gix.)|
Mishra, Claimed by Gix|The Brothers' War|216|M|{2}{B}{R}|Legendary Creature - Phyrexian Human Artificer|3|5|Whenever you attack, each opponent loses X life and you gain X life, where X is the number of attacking creatures. If Mishra, Claimed by Gix and a creature named Phyrexian Dragon Engine are attacking, and you both own and control them, exile them, then meld them into Mishra, Lost to Phyrexia. It enters the battlefield tapped and attacking.|
Queen Kayla bin-Kroog|The Brothers' War|218|R|{1}{R}{W}|Legendary Creature - Human Noble|2|3|{4}, {T}: Discard all the cards in your hand, then draw that many cards. You may choose an artifact or creature card with mana value 1 you discarded this way, then do the same for artifact or creature cards with mana values 2 and 3. Return those cards to the battlefield. Activate only as a sorcery.|
Urza, Lord Protector|The Brothers' War|225|M|{1}{W}{U}|Legendary Creature - Human Artificer|2|4|Artifact, instant, and sorcery spells you cast cost {1} less to cast.${7}: If you both own and control Urza, Lord Protector and an artifact named The Mightstone and Weakstone, exile them, then meld them into Urza, Planeswalker. Activate only as a sorcery.|
The Mightstone and Weakstone|The Brothers' War|238a|R|{5}|Legendary Artifact - Powerstone|||When The Mightstone and Weakstone enters the battlefield, choose one --$* Draw two cards.$* Target creature gets -5/-5 until end of turn.${T}: Add {C}{C}. This mana can't be spent to cast nonartifact spells.$(Melds with Urza, Lord Protector.)|
Urza, Planeswalker|The Brothers' War|238b|M||Legendary Planeswalker - Urza|7|Once during each of your turns, you may activate an additional loyalty ability of Urza, Planeswalker.$+2: Artifact, instant, and sorcery spells you cast this turn cost {2} less to cast. You gain 2 life.$+1: Draw two cards, then discard a card.$0: Create two 1/1 colorless Soldier artifact creature tokens.$-3: Exile target nonland permanent.$-10: Artifacts and planeswalkers you control gain indestructible until end of turn. Destroy all nonland permanents.|
Mishra's Foundry|The Brothers' War|265|R||Land|||{T}: Add {C}.${2}: Mishra's Foundry becomes a 2/2 Assembly-Worker artifact creature until end of turn. It's still a land.${1}, {T}: Target attacking Assembly-Worker gets +2/+2 until end of turn.|
Plains|The Brothers' War|278|C||Basic Land - Plains|||({T}: Add {W}.)|
Island|The Brothers' War|280|C||Basic Land - Island|||({T}: Add {U}.)|
Swamp|The Brothers' War|282|C||Basic Land - Swamp|||({T}: Add {B}.)|