From 43fa5ed06d25ac5a185dfc4d57064eb88555b2c9 Mon Sep 17 00:00:00 2001 From: Max Lebedev Date: Fri, 16 Sep 2016 21:31:59 -0400 Subject: [PATCH 1/2] Changes similar cards to have mana instead of activated abilities. This addresses the bug reported on post 201914 in the forum --- Mage.Sets/src/mage/sets/masterseditioniii/CoalGolem.java | 4 ++-- .../mage/sets/shadowsoverinnistrad/VesselOfVolatility.java | 3 ++- Mage.Sets/src/mage/sets/theros/SatyrHedonist.java | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/CoalGolem.java b/Mage.Sets/src/mage/sets/masterseditioniii/CoalGolem.java index f6b7b75345..5868af8b58 100644 --- a/Mage.Sets/src/mage/sets/masterseditioniii/CoalGolem.java +++ b/Mage.Sets/src/mage/sets/masterseditioniii/CoalGolem.java @@ -31,10 +31,10 @@ import java.util.UUID; import mage.MageInt; import mage.Mana; import mage.abilities.Ability; -import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.BasicManaEffect; +import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; @@ -54,7 +54,7 @@ public class CoalGolem extends CardImpl { this.toughness = new MageInt(3); // {3}, Sacrifice Coal Golem: Add {R}{R}{R} to your mana pool. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BasicManaEffect(Mana.RedMana(3)),new GenericManaCost(3)); + Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, Mana.RedMana(3),new GenericManaCost(3)); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/VesselOfVolatility.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/VesselOfVolatility.java index 4fc7e2c341..4da780b4c7 100644 --- a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/VesselOfVolatility.java +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/VesselOfVolatility.java @@ -34,6 +34,7 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.BasicManaEffect; +import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; @@ -50,7 +51,7 @@ public class VesselOfVolatility extends CardImpl { this.expansionSetCode = "SOI"; // {1}{R}, Sacrifice Vessel of Volatility: Add {R}{R}{R}{R} to your mana pool. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BasicManaEffect(Mana.RedMana(4)), new ManaCostsImpl("{1}{R}")); + Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, Mana.RedMana(4), new ManaCostsImpl("{1}{R}")); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/theros/SatyrHedonist.java b/Mage.Sets/src/mage/sets/theros/SatyrHedonist.java index 26f1861317..0485b25993 100644 --- a/Mage.Sets/src/mage/sets/theros/SatyrHedonist.java +++ b/Mage.Sets/src/mage/sets/theros/SatyrHedonist.java @@ -35,6 +35,7 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.BasicManaEffect; +import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; @@ -55,8 +56,8 @@ public class SatyrHedonist extends CardImpl { this.toughness = new MageInt(1); // {R}, Sacrifice Satyr Hedonist: Add {R}{R}{R} to your mana pool. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BasicManaEffect(Mana.RedMana(3)),new ManaCostsImpl("{R}")); - ability.addCost(new SacrificeSourceCost()); + SimpleManaAbility ability = new SimpleManaAbility(Zone.BATTLEFIELD, Mana.RedMana(3), new ManaCostsImpl("{R}")); + ability .addCost(new SacrificeSourceCost()); this.addAbility(ability); } From a5fb372d3c210f8220534be823f94f6805797111 Mon Sep 17 00:00:00 2001 From: Max Lebedev Date: Sat, 17 Sep 2016 01:40:01 -0400 Subject: [PATCH 2/2] Selvala Explorer Returned now has a mana ability (I hope) --- .../SelvalaExplorerReturned.java | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Mage.Sets/src/mage/sets/vintagemasters/SelvalaExplorerReturned.java b/Mage.Sets/src/mage/sets/vintagemasters/SelvalaExplorerReturned.java index 6e8d572e5d..83bdb86acd 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/SelvalaExplorerReturned.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/SelvalaExplorerReturned.java @@ -31,16 +31,15 @@ import java.util.UUID; import mage.MageInt; import mage.Mana; import mage.abilities.Ability; -import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.dynamicvalue.common.ParleyCount; import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DrawCardAllEffect; +import mage.abilities.effects.common.ManaEffect; +import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; import mage.constants.AbilityWord; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; @@ -62,7 +61,8 @@ public class SelvalaExplorerReturned extends CardImpl { this.toughness = new MageInt(4); // Parley - {T}: Each player reveals the top card of his or her library. For each nonland card revealed this way, add {G} to your mana pool and you gain 1 life. Then each player draws a card. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SelvalaExplorerReturnedEffect(), new TapSourceCost()); + Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new SelvalaExplorerReturnedEffect(), new TapSourceCost()); + ability.setAbilityWord(AbilityWord.PARLEY); Effect effect = new DrawCardAllEffect(1); effect.setText("Then each player draws a card"); @@ -80,13 +80,13 @@ public class SelvalaExplorerReturned extends CardImpl { } } -class SelvalaExplorerReturnedEffect extends OneShotEffect { +class SelvalaExplorerReturnedEffect extends ManaEffect { public SelvalaExplorerReturnedEffect() { - super(Outcome.Benefit); this.staticText = "Each player reveals the top card of his or her library. For each nonland card revealed this way, add {G} to your mana pool and you gain 1 life"; } + public SelvalaExplorerReturnedEffect(final SelvalaExplorerReturnedEffect effect) { super(effect); } @@ -100,13 +100,19 @@ class SelvalaExplorerReturnedEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - int parley = ParleyCount.getInstance().calculate(game, source, this); - if (parley > 0) { - controller.getManaPool().addMana(new Mana(0, parley, 0, 0, 0, 0, 0, 0), game, source); - controller.gainLife(parley, game); + Mana parley = getMana(game, source); + if (parley.getAny() > 0) { + controller.getManaPool().addMana(parley, game, source); + controller.gainLife(parley.getAny(), game); } return true; } return false; } + + + @Override + public Mana getMana(Game game, Ability source) { + return Mana.GreenMana(ParleyCount.getInstance().calculate(game, source, this)); + } }