From ce4073d810e66f838b04685ee02e21cf415eb548 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 7 Sep 2020 21:20:57 -0400 Subject: [PATCH] Implemented Skyclave Relic --- Mage.Sets/src/mage/cards/s/SkyclaveRelic.java | 50 +++++++++++++++++++ Mage.Sets/src/mage/sets/ZendikarRising.java | 1 + .../effects/CreateTokenCopySourceEffect.java | 21 +++++--- 3 files changed, 66 insertions(+), 6 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/s/SkyclaveRelic.java diff --git a/Mage.Sets/src/mage/cards/s/SkyclaveRelic.java b/Mage.Sets/src/mage/cards/s/SkyclaveRelic.java new file mode 100644 index 0000000000..c87946ad2b --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SkyclaveRelic.java @@ -0,0 +1,50 @@ +package mage.cards.s; + +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.KickedCondition; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.effects.CreateTokenCopySourceEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.abilities.keyword.KickerAbility; +import mage.abilities.mana.AnyColorManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SkyclaveRelic extends CardImpl { + + public SkyclaveRelic(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); + + // Kicker {3} + this.addAbility(new KickerAbility(new ManaCostsImpl<>("{3}"))); + + // Indestructible + this.addAbility(IndestructibleAbility.getInstance()); + + // When Skyclave Relic enters the battlefield, if it was kicked, create two tapped tokens that are copies of Skyclave Relic. + this.addAbility(new ConditionalInterveningIfTriggeredAbility( + new EntersBattlefieldTriggeredAbility(new CreateTokenCopySourceEffect(2,true)), + KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, " + + "create two tapped tokens that are copies of {this}." + )); + + // {T}: Add one mana of any color. + this.addAbility(new AnyColorManaAbility()); + } + + private SkyclaveRelic(final SkyclaveRelic card) { + super(card); + } + + @Override + public SkyclaveRelic copy() { + return new SkyclaveRelic(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ZendikarRising.java b/Mage.Sets/src/mage/sets/ZendikarRising.java index 1d19a5de90..cff23b09b5 100644 --- a/Mage.Sets/src/mage/sets/ZendikarRising.java +++ b/Mage.Sets/src/mage/sets/ZendikarRising.java @@ -250,6 +250,7 @@ public final class ZendikarRising extends ExpansionSet { cards.add(new SetCardInfo("Skyclave Cleric", 40, Rarity.UNCOMMON, mage.cards.s.SkyclaveCleric.class)); cards.add(new SetCardInfo("Skyclave Geopede", 163, Rarity.UNCOMMON, mage.cards.s.SkyclaveGeopede.class)); cards.add(new SetCardInfo("Skyclave Pick-Axe", 204, Rarity.UNCOMMON, mage.cards.s.SkyclavePickAxe.class)); + cards.add(new SetCardInfo("Skyclave Relic", 252, Rarity.RARE, mage.cards.s.SkyclaveRelic.class)); cards.add(new SetCardInfo("Sneaking Guide", 164, Rarity.COMMON, mage.cards.s.SneakingGuide.class)); cards.add(new SetCardInfo("Song-Mad Ruins", 165, Rarity.UNCOMMON, mage.cards.s.SongMadRuins.class)); cards.add(new SetCardInfo("Song-Mad Treachery", 165, Rarity.UNCOMMON, mage.cards.s.SongMadTreachery.class)); diff --git a/Mage/src/main/java/mage/abilities/effects/CreateTokenCopySourceEffect.java b/Mage/src/main/java/mage/abilities/effects/CreateTokenCopySourceEffect.java index d0220524e7..3ea6862211 100644 --- a/Mage/src/main/java/mage/abilities/effects/CreateTokenCopySourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/CreateTokenCopySourceEffect.java @@ -13,31 +13,40 @@ import mage.target.targetpointer.FixedTarget; public class CreateTokenCopySourceEffect extends OneShotEffect { private final int number; + private final boolean tapped; public CreateTokenCopySourceEffect() { this(1); } public CreateTokenCopySourceEffect(int copies) { + this(copies, false); + } + + public CreateTokenCopySourceEffect(int copies, boolean tapped) { super(Outcome.PutCreatureInPlay); this.number = copies; - staticText = "create a token that's a copy of {this}"; + this.tapped = tapped; + staticText = "create a " + (tapped ? "tapped " : "") + "token that's a copy of {this}"; } public CreateTokenCopySourceEffect(final CreateTokenCopySourceEffect effect) { super(effect); this.number = effect.number; + this.tapped = effect.tapped; } @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); - if (permanent != null) { - CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(source.getControllerId(), null, false, number); - effect.setTargetPointer(new FixedTarget(source.getSourceId())); - return effect.apply(game, source); + if (permanent == null) { + return false; } - return false; + CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect( + source.getControllerId(), null, false, number, tapped, false + ); + effect.setTargetPointer(new FixedTarget(source.getSourceId())); + return effect.apply(game, source); } @Override