AddManaOfAnyColorEffect - removed amount (can only add one)

Refactored cards to use AddManaOfAnyColorEffect
Added ManaCylix card.
This commit is contained in:
North 2011-06-29 22:11:06 +03:00
parent fac0b0046d
commit d195e6a749
10 changed files with 123 additions and 97 deletions

View file

@ -0,0 +1,65 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.conflux;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
import mage.cards.CardImpl;
import mage.choices.ChoiceColor;
/**
*
* @author North
*/
public class ManaCylix extends CardImpl<ManaCylix> {
public ManaCylix(UUID ownerId) {
super(ownerId, 138, "Mana Cylix", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}");
this.expansionSetCode = "CON";
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), new GenericManaCost(1));
ability.addChoice(new ChoiceColor());
ability.addCost(new TapSourceCost());
this.addAbility(ability);
}
public ManaCylix(final ManaCylix card) {
super(card);
}
@Override
public ManaCylix copy() {
return new ManaCylix(this);
}
}

View file

@ -30,33 +30,33 @@ package mage.sets.conflux;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.EntersBattlefieldTappedAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
import mage.abilities.mana.*;
import mage.cards.CardImpl;
import mage.choices.ChoiceColor;
/**
*
* @author Loki
* @author Loki, North
*/
public class RuptureSpire extends CardImpl<RuptureSpire> {
public RuptureSpire (UUID ownerId) {
super(ownerId, 144, "Rupture Spire", Rarity.COMMON, new CardType[]{CardType.LAND}, null);
this.expansionSetCode = "CON";
this.addAbility(new EntersBattlefieldTappedAbility());
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{1}")), false));
this.addAbility(new BlackManaAbility());
this.addAbility(new BlueManaAbility());
this.addAbility(new GreenManaAbility());
this.addAbility(new RedManaAbility());
this.addAbility(new WhiteManaAbility());
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), new TapSourceCost());
ability.addChoice(new ChoiceColor());
this.addAbility(ability);
}
public RuptureSpire (final RuptureSpire card) {

View file

@ -30,17 +30,17 @@ package mage.sets.mirrodinbesieged;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
import mage.abilities.effects.common.TapSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.mana.BlackManaAbility;
import mage.abilities.mana.BlueManaAbility;
import mage.abilities.mana.GreenManaAbility;
import mage.abilities.mana.RedManaAbility;
import mage.abilities.mana.WhiteManaAbility;
import mage.cards.CardImpl;
import mage.choices.ChoiceColor;
import mage.counters.CounterType;
/**
@ -52,26 +52,15 @@ public class SphereOfTheSuns extends CardImpl<SphereOfTheSuns> {
public SphereOfTheSuns(UUID ownerId) {
super(ownerId, 134, "Sphere of the Suns", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}");
this.expansionSetCode = "MBS";
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(3)),
"Sphere of the Suns enters the battlefield tapped and with three charge counters on it.");
ability.addEffect(new TapSourceEffect());
this.addAbility(ability);
RemoveCountersSourceCost removeCounterCost = new RemoveCountersSourceCost(CounterType.CHARGE.getName(), 1);
ability = new BlackManaAbility();
ability.addCost(removeCounterCost);
this.addAbility(ability);
ability = new BlueManaAbility();
ability.addCost(removeCounterCost);
this.addAbility(ability);
ability = new RedManaAbility();
ability.addCost(removeCounterCost);
this.addAbility(ability);
ability = new GreenManaAbility();
ability.addCost(removeCounterCost);
this.addAbility(ability);
ability = new WhiteManaAbility();
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), new TapSourceCost());
ability.addChoice(new ChoiceColor());
ability.addCost(removeCounterCost);
this.addAbility(ability);
}

View file

@ -30,13 +30,13 @@ package mage.sets.newphyrexia;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.mana.BlackManaAbility;
import mage.abilities.mana.BlueManaAbility;
import mage.abilities.mana.GreenManaAbility;
import mage.abilities.mana.RedManaAbility;
import mage.abilities.mana.WhiteManaAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
import mage.cards.CardImpl;
import mage.choices.ChoiceColor;
/**
*
@ -52,11 +52,9 @@ public class AlloyMyr extends CardImpl<AlloyMyr> {
this.power = new MageInt(2);
this.toughness = new MageInt(2);
this.addAbility(new BlackManaAbility());
this.addAbility(new BlueManaAbility());
this.addAbility(new GreenManaAbility());
this.addAbility(new RedManaAbility());
this.addAbility(new WhiteManaAbility());
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), new TapSourceCost());
ability.addChoice(new ChoiceColor());
this.addAbility(ability);
}
public AlloyMyr(final AlloyMyr card) {

View file

@ -30,16 +30,15 @@ package mage.sets.riseoftheeldrazi;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.Constants.Zone;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.abilities.mana.BlackManaAbility;
import mage.abilities.mana.BlueManaAbility;
import mage.abilities.mana.GreenManaAbility;
import mage.abilities.mana.RedManaAbility;
import mage.abilities.mana.WhiteManaAbility;
import mage.cards.CardImpl;
import mage.choices.ChoiceColor;
/**
*
@ -52,22 +51,10 @@ public class PropheticPrism extends CardImpl<PropheticPrism> {
this.expansionSetCode = "ROE";
this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardControllerEffect(1)));
Ability ability = new BlackManaAbility();
ability.addCost(new GenericManaCost(1));
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), new GenericManaCost(1));
ability.addChoice(new ChoiceColor());
ability.addCost(new TapSourceCost());
this.addAbility(ability);
ability = new RedManaAbility();
ability.addCost(new GenericManaCost(1));
this.addAbility(ability);
ability = new BlueManaAbility();
ability.addCost(new GenericManaCost(1));
this.addAbility(ability);
ability = new GreenManaAbility();
ability.addCost(new GenericManaCost(1));
this.addAbility(ability);
ability = new WhiteManaAbility();
ability.addCost(new GenericManaCost(1));
this.addAbility(ability);
}
public PropheticPrism(final PropheticPrism card) {

View file

@ -30,12 +30,15 @@ package mage.sets.scarsofmirrodin;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.costs.common.MetalcraftCost;
import mage.abilities.mana.*;
import mage.cards.CardImpl;
import java.util.UUID;
import mage.Constants.Zone;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
import mage.choices.ChoiceColor;
/**
*
@ -47,21 +50,11 @@ public class MoxOpal extends CardImpl<MoxOpal> {
super(ownerId, 179, "Mox Opal", Rarity.MYTHIC, new CardType[]{CardType.ARTIFACT}, "{0}");
this.supertype.add("Legendary");
this.expansionSetCode = "SOM";
Ability ability1 = new WhiteManaAbility();
ability1.addCost(new MetalcraftCost());
this.addAbility(ability1);
Ability ability2 = new RedManaAbility();
ability2.addCost(new MetalcraftCost());
this.addAbility(ability2);
Ability ability3 = new BlueManaAbility();
ability3.addCost(new MetalcraftCost());
this.addAbility(ability3);
Ability ability4 = new BlackManaAbility();
ability4.addCost(new MetalcraftCost());
this.addAbility(ability4);
Ability ability5 = new GreenManaAbility();
ability5.addCost(new MetalcraftCost());
this.addAbility(ability5);
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), new TapSourceCost());
ability.addChoice(new ChoiceColor());
ability.addCost(new MetalcraftCost());
this.addAbility(ability);
}
public MoxOpal(final MoxOpal card) {

View file

@ -31,14 +31,14 @@ package mage.sets.tenth;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.mana.BlackManaAbility;
import mage.abilities.mana.BlueManaAbility;
import mage.abilities.mana.GreenManaAbility;
import mage.abilities.mana.RedManaAbility;
import mage.abilities.mana.WhiteManaAbility;
import mage.cards.CardImpl;
import mage.choices.ChoiceColor;
/**
*
@ -50,15 +50,15 @@ public class BirdsOfParadise extends CardImpl<BirdsOfParadise> {
super(ownerId, 252, "Birds of Paradise", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{G}");
this.expansionSetCode = "10E";
this.subtype.add("Bird");
this.color.setGreen(true);
this.power = new MageInt(0);
this.toughness = new MageInt(1);
this.addAbility(FlyingAbility.getInstance());
this.addAbility(new BlackManaAbility());
this.addAbility(new BlueManaAbility());
this.addAbility(new GreenManaAbility());
this.addAbility(new RedManaAbility());
this.addAbility(new WhiteManaAbility());
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), new TapSourceCost());
ability.addChoice(new ChoiceColor());
this.addAbility(ability);
}
public BirdsOfParadise(final BirdsOfParadise card) {

View file

@ -47,11 +47,12 @@ public class LotusCobra extends CardImpl<LotusCobra> {
super(ownerId, 168, "Lotus Cobra", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{1}{G}");
this.expansionSetCode = "ZEN";
this.subtype.add("Snake");
this.color.setGreen(true);
this.power = new MageInt(2);
this.toughness = new MageInt(1);
LandfallAbility ability = new LandfallAbility(new AddManaOfAnyColorEffect(1), false);
LandfallAbility ability = new LandfallAbility(new AddManaOfAnyColorEffect(), false);
ability.addChoice(new ChoiceColor());
this.addAbility(ability);
}

View file

@ -40,7 +40,7 @@ import mage.game.Game;
*/
public class MetalcraftCost extends CostImpl<MetalcraftCost> {
private static FilterPermanent filter = new FilterPermanent("artifact");
private static final FilterPermanent filter = new FilterPermanent("artifact");
static {
filter.getCardType().add(CardType.ARTIFACT);

View file

@ -42,16 +42,12 @@ import mage.players.Player;
*/
public class AddManaOfAnyColorEffect extends OneShotEffect<AddManaOfAnyColorEffect> {
int amount;
public AddManaOfAnyColorEffect(int amount) {
public AddManaOfAnyColorEffect() {
super(Outcome.PutManaInPool);
this.amount = amount;
}
public AddManaOfAnyColorEffect(final AddManaOfAnyColorEffect effect) {
super(effect);
this.amount = effect.amount;
}
@Override
@ -88,10 +84,7 @@ public class AddManaOfAnyColorEffect extends OneShotEffect<AddManaOfAnyColorEffe
@Override
public String getText(Ability source) {
if (amount > 1)
return "add " + Integer.toString(amount) + " mana of any color to your mana pool";
else
return "add one mana of any color to your mana pool";
return "add one mana of any color to your mana pool";
}