diff --git a/Mage.Sets/src/mage/sets/commander2013/DromarsCharm.java b/Mage.Sets/src/mage/sets/commander2013/DromarsCharm.java new file mode 100644 index 00000000000..9769419fde6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2013/DromarsCharm.java @@ -0,0 +1,76 @@ +/* + * 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.commander2013; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.continious.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.TargetSpell; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class DromarsCharm extends CardImpl { + + public DromarsCharm(UUID ownerId) { + super(ownerId, 187, "Dromar's Charm", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}{U}{B}"); + this.expansionSetCode = "C13"; + + this.color.setBlue(true); + this.color.setBlack(true); + this.color.setWhite(true); + + // Choose one - You gain 5 life; or counter target spell; or target creature gets -2/-2 until end of turn. + this.getSpellAbility().addEffect(new GainLifeEffect(5)); + Mode mode = new Mode(); + mode.getEffects().add(new CounterTargetEffect()); + mode.getTargets().add(new TargetSpell()); + this.getSpellAbility().addMode(mode); + mode = new Mode(); + mode.getEffects().add(new BoostTargetEffect(-2, -2, Duration.EndOfTurn)); + mode.getTargets().add(new TargetCreaturePermanent(true)); + this.getSpellAbility().addMode(mode); + } + + public DromarsCharm(final DromarsCharm card) { + super(card); + } + + @Override + public DromarsCharm copy() { + return new DromarsCharm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2013/Famine.java b/Mage.Sets/src/mage/sets/commander2013/Famine.java new file mode 100644 index 00000000000..6fed9ab3331 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2013/Famine.java @@ -0,0 +1,60 @@ +/* + * 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.commander2013; + +import java.util.UUID; +import mage.abilities.effects.common.DamageEverythingEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class Famine extends CardImpl { + + public Famine(UUID ownerId) { + super(ownerId, 77, "Famine", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{B}{B}"); + this.expansionSetCode = "C13"; + + this.color.setBlack(true); + + // Famine deals 3 damage to each creature and each player. + this.getSpellAbility().addEffect(new DamageEverythingEffect(3)); + } + + public Famine(final Famine card) { + super(card); + } + + @Override + public Famine copy() { + return new Famine(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2013/Greed.java b/Mage.Sets/src/mage/sets/commander2013/Greed.java new file mode 100644 index 00000000000..5731439cace --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2013/Greed.java @@ -0,0 +1,67 @@ +/* + * 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.commander2013; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawCardControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class Greed extends CardImpl { + + public Greed(UUID ownerId) { + super(ownerId, 79, "Greed", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}"); + this.expansionSetCode = "C13"; + + this.color.setBlack(true); + + // {B}, Pay 2 life: Draw a card. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardControllerEffect(1), new ManaCostsImpl("{B}")); + ability.addCost(new PayLifeCost(2)); + this.addAbility(ability); + } + + public Greed(final Greed card) { + super(card); + } + + @Override + public Greed copy() { + return new Greed(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2013/PhyrexianDelver.java b/Mage.Sets/src/mage/sets/commander2013/PhyrexianDelver.java new file mode 100644 index 00000000000..582ec9b483f --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2013/PhyrexianDelver.java @@ -0,0 +1,52 @@ +/* + * 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.commander2013; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class PhyrexianDelver extends mage.sets.invasion.PhyrexianDelver { + + public PhyrexianDelver(UUID ownerId) { + super(ownerId); + this.cardNumber = 86; + this.expansionSetCode = "C13"; + } + + public PhyrexianDelver(final PhyrexianDelver card) { + super(card); + } + + @Override + public PhyrexianDelver copy() { + return new PhyrexianDelver(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2013/SydriGalvanicGenius.java b/Mage.Sets/src/mage/sets/commander2013/SydriGalvanicGenius.java new file mode 100644 index 00000000000..468fbbf3612 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2013/SydriGalvanicGenius.java @@ -0,0 +1,159 @@ +/* + * 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.commander2013; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continious.GainAbilityTargetEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import static mage.constants.Layer.PTChangingEffects_7; +import static mage.constants.Layer.TypeChangingEffects_4; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterArtifactPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; + +/** + * + * @author LevelX2 + */ +public class SydriGalvanicGenius extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("artifact creature"); + private static final FilterArtifactPermanent filterNonCreature = new FilterArtifactPermanent("noncreature artifact"); + static { + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + filter.add(new CardTypePredicate(CardType.CREATURE)); + filterNonCreature.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); + } + + public SydriGalvanicGenius(UUID ownerId) { + super(ownerId, 220, "Sydri, Galvanic Genius", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{W}{U}{B}"); + this.expansionSetCode = "C13"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Artificer"); + + this.color.setBlue(true); + this.color.setBlack(true); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {U}: Target noncreature artifact becomes an artifact creature with power and toughness each equal to its converted mana cost until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SydriGalvanicGeniusEffect(), new ManaCostsImpl("{U")); + ability.addTarget(new TargetPermanent(filterNonCreature, true)); + this.addAbility(ability); + + // {W}{B}: Target artifact creature gains deathtouch and lifelink until end of turn. + Effect effect = new GainAbilityTargetEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn, "Target artifact creature gains deathtouch"); + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{W}{B}")); + ability.addEffect(new GainAbilityTargetEffect(LifelinkAbility.getInstance(), Duration.EndOfTurn, "and lifelink until end of turn")); + ability.addTarget(new TargetPermanent(filter, true)); + this.addAbility(ability); + } + + public SydriGalvanicGenius(final SydriGalvanicGenius card) { + super(card); + } + + @Override + public SydriGalvanicGenius copy() { + return new SydriGalvanicGenius(this); + } +} + +class SydriGalvanicGeniusEffect extends ContinuousEffectImpl { + + public SydriGalvanicGeniusEffect() { + super(Duration.EndOfTurn, Outcome.BecomeCreature); + staticText = "Target noncreature artifact becomes an artifact creature with power and toughness each equal to its converted mana cost until end of turn"; + } + + public SydriGalvanicGeniusEffect(final SydriGalvanicGeniusEffect effect) { + super(effect); + } + + @Override + public SydriGalvanicGeniusEffect copy() { + return new SydriGalvanicGeniusEffect(this); + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent artifact = game.getPermanent(this.getTargetPointer().getFirst(game, source)); + if (artifact == null) { + return false; + } + switch (layer) { + case TypeChangingEffects_4: + if (sublayer == SubLayer.NA) { + if (!artifact.getCardType().contains(CardType.CREATURE)) { + artifact.getCardType().add(CardType.CREATURE); + } + } + break; + + case PTChangingEffects_7: + if (sublayer == SubLayer.SetPT_7b) { + int cmc = artifact.getManaCost().convertedManaCost(); + artifact.getPower().setValue(cmc); + artifact.getToughness().setValue(cmc); + } + } + return true; + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.PTChangingEffects_7 || layer == Layer.TypeChangingEffects_4; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2013/TidalForce.java b/Mage.Sets/src/mage/sets/commander2013/TidalForce.java new file mode 100644 index 00000000000..3d448a4105e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2013/TidalForce.java @@ -0,0 +1,70 @@ +/* + * 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.commander2013; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.common.MayTapOrUntapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.target.TargetPermanent; + +/** + * + * @author LevelX2 + */ +public class TidalForce extends CardImpl { + + public TidalForce(UUID ownerId) { + super(ownerId, 62, "Tidal Force", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{U}{U}{U}"); + this.expansionSetCode = "C13"; + this.subtype.add("Elemental"); + + this.color.setBlue(true); + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // At the beginning of each upkeep, you may tap or untap target permanent. + Ability ability = new BeginningOfUpkeepTriggeredAbility(new MayTapOrUntapTargetEffect(), TargetController.ANY, false); + ability.addTarget(new TargetPermanent(true)); + this.addAbility(ability); + } + + public TidalForce(final TidalForce card) { + super(card); + } + + @Override + public TidalForce copy() { + return new TidalForce(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2013/ToxicDeluge.java b/Mage.Sets/src/mage/sets/commander2013/ToxicDeluge.java new file mode 100644 index 00000000000..22b8d2c3ac0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2013/ToxicDeluge.java @@ -0,0 +1,69 @@ +/* + * 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.commander2013; + +import java.util.UUID; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.costs.common.PayVariableLifeCost; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.GetXValue; +import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; +import mage.abilities.effects.common.continious.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class ToxicDeluge extends CardImpl { + + public ToxicDeluge(UUID ownerId) { + super(ownerId, 96, "Toxic Deluge", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{B}"); + this.expansionSetCode = "C13"; + + this.color.setBlack(true); + + // As an additional cost to cast Toxic Deluge, pay X life. + this.getSpellAbility().addCost(new PayVariableLifeCost()); + // All creatures get -X/-X until end of turn. + DynamicValue xValue = new SignInversionDynamicValue(new GetXValue()); + this.getSpellAbility().addEffect(new BoostAllEffect(xValue, xValue, Duration.EndOfTurn)); + } + + public ToxicDeluge(final ToxicDeluge card) { + super(card); + } + + @Override + public ToxicDeluge copy() { + return new ToxicDeluge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/darkascension/DrogskolReaver.java b/Mage.Sets/src/mage/sets/darkascension/DrogskolReaver.java index e8b095795d8..272a731c071 100644 --- a/Mage.Sets/src/mage/sets/darkascension/DrogskolReaver.java +++ b/Mage.Sets/src/mage/sets/darkascension/DrogskolReaver.java @@ -28,16 +28,15 @@ package mage.sets.darkascension; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DrawCardControllerEffect; -import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.DoubleStrikeAbility; +import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.LifelinkAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; @@ -92,10 +91,7 @@ class DrogskolReaverAbility extends TriggeredAbilityImpl @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.GAINED_LIFE && event.getPlayerId().equals(controllerId)) { - return true; - } - return false; + return event.getType() == GameEvent.EventType.GAINED_LIFE && event.getPlayerId().equals(controllerId); } @Override diff --git a/Mage.Sets/src/mage/sets/fourthedition/Greed.java b/Mage.Sets/src/mage/sets/fourthedition/Greed.java new file mode 100644 index 00000000000..6ca7cfef4d3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Greed.java @@ -0,0 +1,52 @@ +/* + * 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.fourthedition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Greed extends mage.sets.commander2013.Greed { + + public Greed(UUID ownerId) { + super(ownerId); + this.cardNumber = 24; + this.expansionSetCode = "4ED"; + } + + public Greed(final Greed card) { + super(card); + } + + @Override + public Greed copy() { + return new Greed(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/PhyrexianDelver.java b/Mage.Sets/src/mage/sets/invasion/PhyrexianDelver.java new file mode 100644 index 00000000000..facf885f0e9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/PhyrexianDelver.java @@ -0,0 +1,104 @@ +/* + * 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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreatureCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LevelX2 + */ +public class PhyrexianDelver extends CardImpl { + + public PhyrexianDelver(UUID ownerId) { + super(ownerId, 115, "Phyrexian Delver", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + this.expansionSetCode = "INV"; + this.subtype.add("Zombie"); + + this.color.setBlack(true); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // When Phyrexian Delver enters the battlefield, return target creature card from your graveyard to the battlefield. You lose life equal to that card's converted mana cost. + Ability ability = new EntersBattlefieldTriggeredAbility(new PhyrexianDelverEffect(), false); + ability.addTarget(new TargetCardInYourGraveyard(1, new FilterCreatureCard())); + this.addAbility(ability); + } + + public PhyrexianDelver(final PhyrexianDelver card) { + super(card); + } + + @Override + public PhyrexianDelver copy() { + return new PhyrexianDelver(this); + } +} + +class PhyrexianDelverEffect extends OneShotEffect { + + public PhyrexianDelverEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "return target creature card from your graveyard to the battlefield. You lose life equal to that card's converted mana cost"; + } + + public PhyrexianDelverEffect(final PhyrexianDelverEffect effect) { + super(effect); + } + + @Override + public PhyrexianDelverEffect copy() { + return new PhyrexianDelverEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Card creatureCard = game.getCard(this.getTargetPointer().getFirst(game, source)); + Player controller = game.getPlayer(source.getControllerId()); + if (creatureCard != null && controller != null) { + boolean result = creatureCard.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId()); + controller.loseLife(creatureCard.getManaCost().convertedManaCost(), game); + return result; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/legends/Greed.java b/Mage.Sets/src/mage/sets/legends/Greed.java new file mode 100644 index 00000000000..79b7012fd38 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/Greed.java @@ -0,0 +1,52 @@ +/* + * 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.legends; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Greed extends mage.sets.commander2013.Greed { + + public Greed(UUID ownerId) { + super(ownerId); + this.cardNumber = 15; + this.expansionSetCode = "LEG"; + } + + public Greed(final Greed card) { + super(card); + } + + @Override + public Greed copy() { + return new Greed(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planeshift/DromarsCharm.java b/Mage.Sets/src/mage/sets/planeshift/DromarsCharm.java new file mode 100644 index 00000000000..1f2618a5e52 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/DromarsCharm.java @@ -0,0 +1,52 @@ +/* + * 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.planeshift; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class DromarsCharm extends mage.sets.commander2013.DromarsCharm { + + public DromarsCharm(UUID ownerId) { + super(ownerId); + this.cardNumber = 105; + this.expansionSetCode = "PLS"; + } + + public DromarsCharm(final DromarsCharm card) { + super(card); + } + + @Override + public DromarsCharm copy() { + return new DromarsCharm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/seventhedition/Greed.java b/Mage.Sets/src/mage/sets/seventhedition/Greed.java new file mode 100644 index 00000000000..48c8eef0b71 --- /dev/null +++ b/Mage.Sets/src/mage/sets/seventhedition/Greed.java @@ -0,0 +1,52 @@ +/* + * 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.seventhedition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Greed extends mage.sets.commander2013.Greed { + + public Greed(UUID ownerId) { + super(ownerId); + this.cardNumber = 140; + this.expansionSetCode = "7ED"; + } + + public Greed(final Greed card) { + super(card); + } + + @Override + public Greed copy() { + return new Greed(this); + } +} diff --git a/Mage.Sets/src/mage/sets/sixthedition/Greed.java b/Mage.Sets/src/mage/sets/sixthedition/Greed.java new file mode 100644 index 00000000000..043e1b41570 --- /dev/null +++ b/Mage.Sets/src/mage/sets/sixthedition/Greed.java @@ -0,0 +1,52 @@ +/* + * 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.sixthedition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Greed extends mage.sets.commander2013.Greed { + + public Greed(UUID ownerId) { + super(ownerId); + this.cardNumber = 135; + this.expansionSetCode = "6ED"; + } + + public Greed(final Greed card) { + super(card); + } + + @Override + public Greed copy() { + return new Greed(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tenth/MarchOfTheMachines.java b/Mage.Sets/src/mage/sets/tenth/MarchOfTheMachines.java index a4679d0bc21..2f438bf8611 100644 --- a/Mage.Sets/src/mage/sets/tenth/MarchOfTheMachines.java +++ b/Mage.Sets/src/mage/sets/tenth/MarchOfTheMachines.java @@ -124,7 +124,7 @@ class MarchOfTheMachinesEffect extends ContinuousEffectImpl { + + public GainLifeControllerTriggeredAbility(Effect effect, boolean optional) { + super(Zone.BATTLEFIELD, effect, optional); + } + + public GainLifeControllerTriggeredAbility(final GainLifeControllerTriggeredAbility ability) { + super(ability); + } + + @Override + public GainLifeControllerTriggeredAbility copy() { + return new GainLifeControllerTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.GAINED_LIFE && event.getPlayerId().equals(this.getControllerId()); + } + + @Override + public String getRule() { + return new StringBuilder("Whenever you gain life, ").append(super.getRule()).toString() ; + } + +} diff --git a/Mage/src/mage/abilities/costs/common/PayVariableLifeCost.java b/Mage/src/mage/abilities/costs/common/PayVariableLifeCost.java new file mode 100644 index 00000000000..0a50406b58d --- /dev/null +++ b/Mage/src/mage/abilities/costs/common/PayVariableLifeCost.java @@ -0,0 +1,114 @@ +/* + * 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.abilities.costs.common; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.CostImpl; +import mage.abilities.costs.VariableCost; +import mage.counters.CounterType; +import mage.filter.FilterMana; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ + +public class PayVariableLifeCost extends CostImpl implements VariableCost { + + protected int amountPaid = 0; + + public PayVariableLifeCost() { + this.text = "pay X life"; + } + + public PayVariableLifeCost(final PayVariableLifeCost cost) { + super(cost); + this.amountPaid = cost.amountPaid; + } + + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + Player controller = game.getPlayer(controllerId); + return controller != null && controller.getLife() > 0; + } + + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + Player controller = game.getPlayer(controllerId); + this.amountPaid = controller.getAmount(0, controller.getLife(), "Choose X", game); + if (this.amountPaid> 0) { + controller.loseLife(amountPaid, game); + } + this.paid = true; + return paid; + } + + @Override + public void clearPaid() { + paid = false; + amountPaid = 0; + } + + @Override + public int getAmount() { + return amountPaid; + } + + @Override + public void setAmount(int amount) { + amountPaid = amount; + } + + /** + * Not Supported + * @param filter + */ + @Override + public void setFilter(FilterMana filter) { + } + + /** + * Not supported + * @return + */ + @Override + public FilterMana getFilter() { + return new FilterMana(); + } + + @Override + public PayVariableLifeCost copy() { + return new PayVariableLifeCost(this); + } + +} diff --git a/Mage/src/mage/abilities/effects/common/DoIfCostPaid.java b/Mage/src/mage/abilities/effects/common/DoIfCostPaid.java index db018190465..ed6160c07fd 100644 --- a/Mage/src/mage/abilities/effects/common/DoIfCostPaid.java +++ b/Mage/src/mage/abilities/effects/common/DoIfCostPaid.java @@ -11,8 +11,8 @@ import mage.players.Player; import mage.util.CardUtil; public class DoIfCostPaid extends OneShotEffect { - private OneShotEffect executingEffect; - private Cost cost; + private final OneShotEffect executingEffect; + private final Cost cost; public DoIfCostPaid(OneShotEffect effect, Cost cost) { super(Outcome.Benefit); diff --git a/Mage/src/mage/abilities/keyword/ReboundAbility.java b/Mage/src/mage/abilities/keyword/ReboundAbility.java index b6b6010ede6..9b4317877a5 100644 --- a/Mage/src/mage/abilities/keyword/ReboundAbility.java +++ b/Mage/src/mage/abilities/keyword/ReboundAbility.java @@ -108,10 +108,11 @@ public class ReboundAbility extends TriggeredAbilityImpl { if (spell != null && spell.getSourceId().equals(this.getSourceId())) { Effect reboundEffect = new ReboundEffect(); boolean found = false; - for (Effect effect : spell.getSpellAbility().getEffects()) - if (effect instanceof ReboundEffect) { - found = true; - break; + for (Effect effect : spell.getSpellAbility().getEffects()) { + if (effect instanceof ReboundEffect) { + found = true; + break; + } } if (!found) { spell.getSpellAbility().addEffect(reboundEffect); @@ -265,10 +266,11 @@ class ReboundEffectCastFromExileDelayedTrigger extends DelayedTriggeredAbility { private static String castFromExileText = "Rebound - You may cast {this} from exile without paying its mana cost"; - private UUID cardId; + private final UUID cardId; ReboundCastSpellFromExileEffect(UUID cardId) { super(Outcome.Benefit); @@ -297,7 +299,9 @@ class ReboundCastSpellFromExileEffect extends OneShotEffect