From a8d6fa6c23e1e61a7e6611b5f04999934e0f8450 Mon Sep 17 00:00:00 2001 From: myersn024 Date: Fri, 20 Feb 2015 13:41:46 -0600 Subject: [PATCH 1/2] Implemented ScorchedRuins.java --- .../mage/sets/weatherlight/ScorchedRuins.java | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/weatherlight/ScorchedRuins.java diff --git a/Mage.Sets/src/mage/sets/weatherlight/ScorchedRuins.java b/Mage.Sets/src/mage/sets/weatherlight/ScorchedRuins.java new file mode 100644 index 0000000000..f774685997 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/ScorchedRuins.java @@ -0,0 +1,74 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.Mana; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.BasicManaEffect; +import mage.abilities.effects.common.EnterBattlefieldPayCostOrPutGraveyardEffect; +import mage.abilities.mana.BasicManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author nick.myers + */ +public class ScorchedRuins extends CardImpl { + + private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("two untapped lands"); + static { + filter.add(Predicates.not(new TappedPredicate())); + } + + public ScorchedRuins(UUID ownerId) { + super(ownerId, 166, "Scorched Ruins", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "WTH"; + + // If Scorched Ruins would enter the battlefield, sacrifice two untapped lands instead. + // If you do, put Scorched Ruins onto the battlefield. If you don't, put it into its + // owner's graveyard. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new EnterBattlefieldPayCostOrPutGraveyardEffect(new SacrificeTargetCost(new TargetControlledPermanent(2,2,filter,false))))); + // {tap}: Add {4} to your mana pool + this.addAbility(new ScorchedRuinsManaAbility()); + } + + public ScorchedRuins(final ScorchedRuins card) { + super(card); + } + + @Override + public ScorchedRuins copy() { + return new ScorchedRuins(this); + } + +} + +class ScorchedRuinsManaAbility extends BasicManaAbility { + + public ScorchedRuinsManaAbility() { + super(new BasicManaEffect(new Mana(0,0,0,0,0,4,0))); + this.netMana.add(new Mana(0,0,0,0,0,4,0)); + } + + public ScorchedRuinsManaAbility(final ScorchedRuinsManaAbility ability) { + super(ability); + } + + @Override + public ScorchedRuinsManaAbility copy() { + return new ScorchedRuinsManaAbility(this); + } + +} From 33a1ab35a5e41985606c3bcff51ca3c7c604d133 Mon Sep 17 00:00:00 2001 From: nickmyers Date: Fri, 20 Feb 2015 16:34:37 -0600 Subject: [PATCH 2/2] Changed ScorchedRuins to use SimpleManaAbility instead of extending BasicManaAbility --- .../mage/sets/weatherlight/ScorchedRuins.java | 25 +++---------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/Mage.Sets/src/mage/sets/weatherlight/ScorchedRuins.java b/Mage.Sets/src/mage/sets/weatherlight/ScorchedRuins.java index f774685997..068395176d 100644 --- a/Mage.Sets/src/mage/sets/weatherlight/ScorchedRuins.java +++ b/Mage.Sets/src/mage/sets/weatherlight/ScorchedRuins.java @@ -9,9 +9,9 @@ import java.util.UUID; import mage.Mana; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.SacrificeTargetCost; -import mage.abilities.effects.common.BasicManaEffect; +import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.EnterBattlefieldPayCostOrPutGraveyardEffect; -import mage.abilities.mana.BasicManaAbility; +import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; @@ -41,7 +41,8 @@ public class ScorchedRuins extends CardImpl { // owner's graveyard. this.addAbility(new SimpleStaticAbility(Zone.ALL, new EnterBattlefieldPayCostOrPutGraveyardEffect(new SacrificeTargetCost(new TargetControlledPermanent(2,2,filter,false))))); // {tap}: Add {4} to your mana pool - this.addAbility(new ScorchedRuinsManaAbility()); + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana(4), new TapSourceCost())); + } public ScorchedRuins(final ScorchedRuins card) { @@ -54,21 +55,3 @@ public class ScorchedRuins extends CardImpl { } } - -class ScorchedRuinsManaAbility extends BasicManaAbility { - - public ScorchedRuinsManaAbility() { - super(new BasicManaEffect(new Mana(0,0,0,0,0,4,0))); - this.netMana.add(new Mana(0,0,0,0,0,4,0)); - } - - public ScorchedRuinsManaAbility(final ScorchedRuinsManaAbility ability) { - super(ability); - } - - @Override - public ScorchedRuinsManaAbility copy() { - return new ScorchedRuinsManaAbility(this); - } - -}