From e6c1d502fc528d6f0c6e3949a7f1d2a94e5d7ad8 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 9 Sep 2020 09:54:46 -0400 Subject: [PATCH] [ZNR] Implemented Myriad Construct --- Mage.Sets/src/mage/cards/f/Flamewright.java | 11 ++- .../src/mage/cards/m/MyriadConstruct.java | 77 +++++++++++++++++++ Mage.Sets/src/mage/sets/ZendikarRising.java | 1 + .../game/permanent/token/ConstructToken.java | 16 +--- 4 files changed, 86 insertions(+), 19 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/m/MyriadConstruct.java diff --git a/Mage.Sets/src/mage/cards/f/Flamewright.java b/Mage.Sets/src/mage/cards/f/Flamewright.java index f9bd381c6f..eb64d04de8 100644 --- a/Mage.Sets/src/mage/cards/f/Flamewright.java +++ b/Mage.Sets/src/mage/cards/f/Flamewright.java @@ -1,7 +1,5 @@ - package mage.cards.f; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -18,12 +16,13 @@ import mage.constants.SubType; import mage.constants.Zone; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.AbilityPredicate; -import mage.game.permanent.token.ConstructToken; -import mage.target.common.TargetControlledPermanent; +import mage.game.permanent.token.DarettiConstructToken; import mage.target.common.TargetAnyTarget; +import mage.target.common.TargetControlledPermanent; + +import java.util.UUID; /** - * * @author fireshoes */ public final class Flamewright extends CardImpl { @@ -43,7 +42,7 @@ public final class Flamewright extends CardImpl { this.toughness = new MageInt(1); // {1}, {tap}: Create a 1/1 colorless Construct artifact creature token with defender. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new ConstructToken()), new ManaCostsImpl("{1}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new DarettiConstructToken()), new ManaCostsImpl("{1}")); ability.addCost(new TapSourceCost()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/m/MyriadConstruct.java b/Mage.Sets/src/mage/cards/m/MyriadConstruct.java new file mode 100644 index 0000000000..7b36dab0bd --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MyriadConstruct.java @@ -0,0 +1,77 @@ +package mage.cards.m; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BecomesTargetTriggeredAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.common.KickedCondition; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.KickerAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.constants.TargetController; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.Predicates; +import mage.game.permanent.token.ConstructToken; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class MyriadConstruct extends CardImpl { + + private static final FilterPermanent filter = new FilterLandPermanent(); + + static { + filter.add(TargetController.OPPONENT.getControllerPredicate()); + filter.add(Predicates.not(SuperType.BASIC.getPredicate())); + } + + private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(filter); + private static final DynamicValue xValue2 = new SourcePermanentPowerCount(false); + + public MyriadConstruct(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); + + this.subtype.add(SubType.CONSTRUCT); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Kicker {3} + this.addAbility(new KickerAbility(new ManaCostsImpl<>("{3}"))); + + // If Myriad Construct was kicked, it enters the battlefield with a +1/+1 counter on it for each nonbasic land your opponents control. + this.addAbility(new EntersBattlefieldAbility( + new AddCountersSourceEffect(CounterType.P1P1.createInstance(), xValue, false), + KickedCondition.instance, "If {this} was kicked, it enters the battlefield " + + "with a +1/+1 counter on it for each nonbasic land your opponents control.", "" + )); + + // When Myriad Construct becomes the target of a spell, sacrifice it and create a number of 1/1 colourless Construct artifact creature tokens equal to its power. + Ability ability = new BecomesTargetTriggeredAbility(new SacrificeSourceEffect().setText("sacrifice it")); + ability.addEffect(new CreateTokenEffect(new ConstructToken(), xValue2) + .setText("and create a number of 1/1 colourless Construct artifact creature tokens equal to its power")); + this.addAbility(ability); + } + + private MyriadConstruct(final MyriadConstruct card) { + super(card); + } + + @Override + public MyriadConstruct copy() { + return new MyriadConstruct(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ZendikarRising.java b/Mage.Sets/src/mage/sets/ZendikarRising.java index 73fdbac92f..3afc4aabef 100644 --- a/Mage.Sets/src/mage/sets/ZendikarRising.java +++ b/Mage.Sets/src/mage/sets/ZendikarRising.java @@ -235,6 +235,7 @@ public final class ZendikarRising extends ExpansionSet { cards.add(new SetCardInfo("Murasa Rootgrazer", 229, Rarity.UNCOMMON, mage.cards.m.MurasaRootgrazer.class)); cards.add(new SetCardInfo("Murasa Sproutling", 196, Rarity.UNCOMMON, mage.cards.m.MurasaSproutling.class)); cards.add(new SetCardInfo("Murkwater Pathway", 260, Rarity.RARE, mage.cards.m.MurkwaterPathway.class)); + cards.add(new SetCardInfo("Myriad Construct", 246, Rarity.RARE, mage.cards.m.MyriadConstruct.class)); cards.add(new SetCardInfo("Nahiri's Binding", 29, Rarity.COMMON, mage.cards.n.NahirisBinding.class)); cards.add(new SetCardInfo("Nahiri's Lithoforming", 151, Rarity.RARE, mage.cards.n.NahirisLithoforming.class)); cards.add(new SetCardInfo("Nahiri, Heir of the Ancients", 230, Rarity.MYTHIC, mage.cards.n.NahiriHeirOfTheAncients.class)); diff --git a/Mage/src/main/java/mage/game/permanent/token/ConstructToken.java b/Mage/src/main/java/mage/game/permanent/token/ConstructToken.java index a927019756..9cc999161a 100644 --- a/Mage/src/main/java/mage/game/permanent/token/ConstructToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/ConstructToken.java @@ -1,31 +1,21 @@ - - package mage.game.permanent.token; + +import mage.MageInt; import mage.constants.CardType; import mage.constants.SubType; -import mage.MageInt; -import mage.abilities.keyword.DefenderAbility; /** - * * @author spjspj */ public final class ConstructToken extends TokenImpl { public ConstructToken() { - this("CNS"); - } - - public ConstructToken(String setCode) { - super("Construct", "1/1 colorless Construct artifact creature token with defender"); - this.setOriginalExpansionSetCode(setCode); + super("Construct", "1/1 colorless Construct artifact creature token"); cardType.add(CardType.ARTIFACT); cardType.add(CardType.CREATURE); subtype.add(SubType.CONSTRUCT); power = new MageInt(1); toughness = new MageInt(1); - - addAbility(DefenderAbility.getInstance()); } public ConstructToken(final ConstructToken token) {