From f0247662b692e33eb8b8b72acbaa0f44743ff32c Mon Sep 17 00:00:00 2001 From: Thomas Winwood Date: Sun, 14 Apr 2019 12:56:14 +0100 Subject: [PATCH 1/2] Implement Soulshriek --- Mage.Sets/src/mage/cards/s/Soulshriek.java | 83 ++++++++++++++++++++++ Mage.Sets/src/mage/sets/Mirage.java | 1 + 2 files changed, 84 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/Soulshriek.java diff --git a/Mage.Sets/src/mage/cards/s/Soulshriek.java b/Mage.Sets/src/mage/cards/s/Soulshriek.java new file mode 100644 index 0000000000..93dc244d8a --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/Soulshriek.java @@ -0,0 +1,83 @@ +package mage.cards.s; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; +import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.SacrificeTargetEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.targetpointer.FixedTarget; + +/* + * + * @author Ketsuban + */ +public class Soulshriek extends CardImpl { + + protected static final FilterCard filterCard = new FilterCard("creature cards"); + + static { + filterCard.add(new CardTypePredicate(CardType.CREATURE)); + } + + public Soulshriek(UUID ownerId, CardSetInfo setInfo) { + super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{B}"); + + // Target creature you control gets +X/+0 until end of turn, where X is the number of creature cards in your graveyard. Sacrifice that creature at the beginning of the next end step. + this.getSpellAbility().addEffect(new SoulshriekEffect()); + this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); + } + + @Override + public Card copy() { + return null; + } +} + +class SoulshriekEffect extends OneShotEffect { + + public SoulshriekEffect() { + super(Outcome.DestroyPermanent); + this.staticText = "Target creature you control gets +X/+0 until end of turn, where X is the number of creature cards in your graveyard. Sacrifice that creature at the beginning of the next end step"; + } + + public SoulshriekEffect(final SoulshriekEffect effect) { + super(effect); + } + + @Override + public SoulshriekEffect copy() { + return new SoulshriekEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + ContinuousEffect boost = new BoostTargetEffect(new CardsInControllerGraveyardCount(Soulshriek.filterCard), new StaticValue(0), Duration.EndOfTurn); + boost.setTargetPointer(new FixedTarget(permanent, game)); + game.addEffect(boost, source); + Effect sacrifice = new SacrificeTargetEffect("Sacrifice that creature at the beginning of the next end step", source.getControllerId()); + sacrifice.setTargetPointer(new FixedTarget(permanent, game)); + game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrifice), source); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/Mirage.java b/Mage.Sets/src/mage/sets/Mirage.java index cb2906dcdf..7bb1e0a415 100644 --- a/Mage.Sets/src/mage/sets/Mirage.java +++ b/Mage.Sets/src/mage/sets/Mirage.java @@ -279,6 +279,7 @@ public final class Mirage extends ExpansionSet { cards.add(new SetCardInfo("Soar", 93, Rarity.COMMON, mage.cards.s.Soar.class)); cards.add(new SetCardInfo("Soul Echo", 40, Rarity.RARE, mage.cards.s.SoulEcho.class)); cards.add(new SetCardInfo("Soul Rend", 144, Rarity.UNCOMMON, mage.cards.s.SoulRend.class)); + cards.add(new SetCardInfo("Soulshriek", 145, Rarity.COMMON, mage.cards.s.Soulshriek.class)); cards.add(new SetCardInfo("Spectral Guardian", 41, Rarity.RARE, mage.cards.s.SpectralGuardian.class)); cards.add(new SetCardInfo("Spirit of the Night", 146, Rarity.RARE, mage.cards.s.SpiritOfTheNight.class)); cards.add(new SetCardInfo("Spitting Earth", 193, Rarity.COMMON, mage.cards.s.SpittingEarth.class)); From 771be5e1d9a9f567ceff6b9a92121095678a97c6 Mon Sep 17 00:00:00 2001 From: Thomas Winwood Date: Sun, 14 Apr 2019 12:56:46 +0100 Subject: [PATCH 2/2] Implement Urborg Panther --- Mage.Sets/src/mage/cards/u/UrborgPanther.java | 81 +++++++++++++++++++ Mage.Sets/src/mage/sets/Mirage.java | 1 + 2 files changed, 82 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/u/UrborgPanther.java diff --git a/Mage.Sets/src/mage/cards/u/UrborgPanther.java b/Mage.Sets/src/mage/cards/u/UrborgPanther.java new file mode 100644 index 0000000000..657d34d585 --- /dev/null +++ b/Mage.Sets/src/mage/cards/u/UrborgPanther.java @@ -0,0 +1,81 @@ +package mage.cards.u; + +import java.util.UUID; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.SubType; +import mage.filter.FilterCard; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterCreatureCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.filter.predicate.permanent.BlockingAttackerIdPredicate; +import mage.target.common.TargetCardInLibrary; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Ketsuban + */ +public class UrborgPanther extends CardImpl { + + private static final FilterControlledCreaturePermanent filter1 = new FilterControlledCreaturePermanent("creature named Feral Shadow"); + private static final FilterControlledCreaturePermanent filter2 = new FilterControlledCreaturePermanent("creature named Breathstealer"); + + private static final FilterCard filterCard = new FilterCreatureCard("card named Spirit of the Night"); + + static { + filter1.add(new NamePredicate("Feral Shadow")); + filter2.add(new NamePredicate("Breathstealer")); + filterCard.add(new NamePredicate("Spirit of the Night")); + } + + public UrborgPanther(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[] { CardType.CREATURE }, "{2}{B}"); + this.subtype.add(SubType.NIGHTSTALKER); + this.subtype.add(SubType.CAT); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // B, Sacrifice Urborg Panther: Destroy target creature blocking Urborg Panther. + Ability ability1 = new SimpleActivatedAbility(new DestroyTargetEffect(), + new ColoredManaCost(ColoredManaSymbol.B)); + ability1.addCost(new SacrificeSourceCost()); + FilterCreaturePermanent filter = new FilterCreaturePermanent("creature blocking {this}"); + filter.add(new BlockingAttackerIdPredicate(this.getId())); + ability1.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability1); + + // Sacrifice a creature named Feral Shadow, a creature named Breathstealer, and + // Urborg Panther: Search your library for a card named Spirit of the Night and + // put that card onto the battlefield. Then shuffle your library. + Ability ability2 = new SimpleActivatedAbility( + new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(1, 1, new FilterCard(filterCard))), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter1, true))); + ability2.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter2, true))); + ability2.addCost(new SacrificeSourceCost()); + this.addAbility(ability2); + } + + public UrborgPanther(final UrborgPanther card) { + super(card); + } + + @Override + public UrborgPanther copy() { + return new UrborgPanther(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/Mirage.java b/Mage.Sets/src/mage/sets/Mirage.java index 7bb1e0a415..6e87d40a7c 100644 --- a/Mage.Sets/src/mage/sets/Mirage.java +++ b/Mage.Sets/src/mage/sets/Mirage.java @@ -315,6 +315,7 @@ public final class Mirage extends ExpansionSet { cards.add(new SetCardInfo("Unseen Walker", 249, Rarity.UNCOMMON, mage.cards.u.UnseenWalker.class)); cards.add(new SetCardInfo("Unyaro Bee Sting", 250, Rarity.UNCOMMON, mage.cards.u.UnyaroBeeSting.class)); cards.add(new SetCardInfo("Unyaro Griffin", 44, Rarity.UNCOMMON, mage.cards.u.UnyaroGriffin.class)); + cards.add(new SetCardInfo("Urborg Panther", 150, Rarity.COMMON, mage.cards.u.UrborgPanther.class)); cards.add(new SetCardInfo("Vaporous Djinn", 101, Rarity.UNCOMMON, mage.cards.v.VaporousDjinn.class)); cards.add(new SetCardInfo("Ventifact Bottle", 323, Rarity.RARE, mage.cards.v.VentifactBottle.class)); cards.add(new SetCardInfo("Viashino Warrior", 200, Rarity.COMMON, mage.cards.v.ViashinoWarrior.class));