diff --git a/Mage.Sets/src/mage/sets/darksteel/StirThePride.java b/Mage.Sets/src/mage/sets/darksteel/StirThePride.java new file mode 100644 index 0000000000..866b3ac875 --- /dev/null +++ b/Mage.Sets/src/mage/sets/darksteel/StirThePride.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.darksteel; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class StirThePride extends mage.sets.modernmasters.StirThePride { + + public StirThePride(UUID ownerId) { + super(ownerId); + this.cardNumber = 16; + this.expansionSetCode = "DST"; + } + + public StirThePride(final StirThePride card) { + super(card); + } + + @Override + public StirThePride copy() { + return new StirThePride(this); + } +} diff --git a/Mage.Sets/src/mage/sets/elspethvstezzeret/BlindingBeam.java b/Mage.Sets/src/mage/sets/elspethvstezzeret/BlindingBeam.java new file mode 100644 index 0000000000..48c8445120 --- /dev/null +++ b/Mage.Sets/src/mage/sets/elspethvstezzeret/BlindingBeam.java @@ -0,0 +1,158 @@ +/* + * 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.elspethvstezzeret; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.keyword.EntwineAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.PhaseStep; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class BlindingBeam extends CardImpl { + + public BlindingBeam(UUID ownerId) { + super(ownerId, 28, "Blinding Beam", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{W}"); + this.expansionSetCode = "DDF"; + + this.color.setWhite(true); + + // Choose one - + this.getSpellAbility().getModes().setMinModes(1); + this.getSpellAbility().getModes().setMaxModes(1); + // Tap two target creatures; + this.getSpellAbility().addEffect(new TapTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(2,2)); + // or creatures don't untap during target player's next untap step. + Mode mode = new Mode(); + mode.getEffects().add(new BlindingBeamEffect()); + this.getSpellAbility().getModes().addMode(mode); + + // Entwine {1} + this.addAbility(new EntwineAbility("{1}")); + } + + public BlindingBeam(final BlindingBeam card) { + super(card); + } + + @Override + public BlindingBeam copy() { + return new BlindingBeam(this); + } +} + +class BlindingBeamEffect extends OneShotEffect { + + public BlindingBeamEffect() { + super(Outcome.Tap); + staticText = "creatures don't untap during target player's next untap step"; + } + + public BlindingBeamEffect(final BlindingBeamEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null) { + for (Permanent creature: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) { + game.addEffect(new BlindingBeamEffect2(creature.getId()), source); + } + return true; + } + return false; + } + + @Override + public BlindingBeamEffect copy() { + return new BlindingBeamEffect(this); + } + +} + +class BlindingBeamEffect2 extends ReplacementEffectImpl { + + protected UUID creatureId; + + public BlindingBeamEffect2(UUID creatureId) { + super(Duration.OneUse, Outcome.Detriment); + this.creatureId = creatureId; + } + + public BlindingBeamEffect2(final BlindingBeamEffect2 effect) { + super(effect); + creatureId = effect.creatureId; + } + + @Override + public BlindingBeamEffect2 copy() { + return new BlindingBeamEffect2(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + used = true; + return true; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (game.getTurn().getStepType() == PhaseStep.UNTAP && + event.getType() == EventType.UNTAP && + event.getTargetId().equals(creatureId)) { + return true; + } + return false; + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/fifthdawn/RudeAwakening.java b/Mage.Sets/src/mage/sets/fifthdawn/RudeAwakening.java new file mode 100644 index 0000000000..816be8afe5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthdawn/RudeAwakening.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.fifthdawn; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class RudeAwakening extends mage.sets.modernmasters.RudeAwakening { + + public RudeAwakening(UUID ownerId) { + super(ownerId); + this.cardNumber = 92; + this.expansionSetCode = "5DN"; + } + + public RudeAwakening(final RudeAwakening card) { + super(card); + } + + @Override + public RudeAwakening copy() { + return new RudeAwakening(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodin/BlindingBeam.java b/Mage.Sets/src/mage/sets/mirrodin/BlindingBeam.java new file mode 100644 index 0000000000..b762ddbc0c --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodin/BlindingBeam.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.mirrodin; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class BlindingBeam extends mage.sets.elspethvstezzeret.BlindingBeam { + + public BlindingBeam(UUID ownerId) { + super(ownerId); + this.cardNumber = 7; + this.expansionSetCode = "MRD"; + } + + public BlindingBeam(final BlindingBeam card) { + super(card); + } + + @Override + public BlindingBeam copy() { + return new BlindingBeam(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodin/ToothAndNail.java b/Mage.Sets/src/mage/sets/mirrodin/ToothAndNail.java new file mode 100644 index 0000000000..a50188250a --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodin/ToothAndNail.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.mirrodin; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class ToothAndNail extends mage.sets.modernmasters.ToothAndNail { + + public ToothAndNail(UUID ownerId) { + super(ownerId); + this.cardNumber = 134; + this.expansionSetCode = "MRD"; + } + + public ToothAndNail(final ToothAndNail card) { + super(card); + } + + @Override + public ToothAndNail copy() { + return new ToothAndNail(this); + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/BlindingBeam.java b/Mage.Sets/src/mage/sets/modernmasters/BlindingBeam.java new file mode 100644 index 0000000000..f6b2666b46 --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/BlindingBeam.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.modernmasters; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class BlindingBeam extends mage.sets.elspethvstezzeret.BlindingBeam { + + public BlindingBeam(UUID ownerId) { + super(ownerId); + this.cardNumber = 7; + this.expansionSetCode = "MMA"; + } + + public BlindingBeam(final BlindingBeam card) { + super(card); + } + + @Override + public BlindingBeam copy() { + return new BlindingBeam(this); + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/RudeAwakening.java b/Mage.Sets/src/mage/sets/modernmasters/RudeAwakening.java new file mode 100644 index 0000000000..bda59eebe3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/RudeAwakening.java @@ -0,0 +1,88 @@ +/* + * 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.modernmasters; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Mode; +import mage.abilities.effects.common.UntapAllLandsControllerEffect; +import mage.abilities.effects.common.continious.BecomesCreatureAllEffect; +import mage.abilities.keyword.EntwineAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledLandPermanent; +import mage.game.permanent.token.Token; + + +/** + * + * @author LevelX2 + */ +public class RudeAwakening extends CardImpl { + + public RudeAwakening(UUID ownerId) { + super(ownerId, 160, "Rude Awakening", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{G}"); + this.expansionSetCode = "MMA"; + + this.color.setGreen(true); + + // Choose one - + this.getSpellAbility().getModes().setMinModes(1); + this.getSpellAbility().getModes().setMaxModes(1); + // Untap all lands you control; + this.getSpellAbility().addEffect(new UntapAllLandsControllerEffect()); + // or until end of turn, lands you control become 2/2 creatures that are still lands. + Mode mode = new Mode(); + mode.getEffects().add(new BecomesCreatureAllEffect(new RudeAwakeningToken(), "lands", new FilterControlledLandPermanent("lands you control"), Duration.EndOfTurn)); + this.getSpellAbility().getModes().addMode(mode); + + // Entwine {2}{G} + this.addAbility(new EntwineAbility("{2}{G}")); + } + + public RudeAwakening(final RudeAwakening card) { + super(card); + } + + @Override + public RudeAwakening copy() { + return new RudeAwakening(this); + } +} + +class RudeAwakeningToken extends Token { + public RudeAwakeningToken() { + super("", "2/2 creature"); + cardType.add(CardType.CREATURE); + power = new MageInt(2); + toughness = new MageInt(2); + } + +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/StirThePride.java b/Mage.Sets/src/mage/sets/modernmasters/StirThePride.java new file mode 100644 index 0000000000..ce6196b28a --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/StirThePride.java @@ -0,0 +1,155 @@ +/* + * 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.modernmasters; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continious.BoostControlledEffect; +import mage.abilities.effects.common.continious.GainAbilityControlledEffect; +import mage.abilities.keyword.EntwineAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class StirThePride extends CardImpl { + + public StirThePride(UUID ownerId) { + super(ownerId, 30, "Stir the Pride", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{4}{W}"); + this.expansionSetCode = "MMA"; + + this.color.setWhite(true); + + // Choose one - + this.getSpellAbility().getModes().setMinModes(1); + this.getSpellAbility().getModes().setMaxModes(1); + // Creatures you control get +2/+2 until end of turn; + this.getSpellAbility().addEffect(new BoostControlledEffect(2,2, Duration.EndOfTurn)); + // or until end of turn, creatures you control gain "Whenever this creature deals damage, you gain that much life." + Mode mode = new Mode(); + Effect effect = new GainAbilityControlledEffect(new StirThePrideTriggeredAbility(), Duration.EndOfTurn); + effect.setText("until end of turn, creatures you control gain \"Whenever this creature deals damage, you gain that much life.\""); + mode.getEffects().add(effect); + this.getSpellAbility().getModes().addMode(mode); + + // Entwine {1}{W} + this.addAbility(new EntwineAbility("{1}{W}")); + + } + + public StirThePride(final StirThePride card) { + super(card); + } + + @Override + public StirThePride copy() { + return new StirThePride(this); + } +} + +class StirThePrideTriggeredAbility extends TriggeredAbilityImpl { + + public StirThePrideTriggeredAbility() { + super(Zone.BATTLEFIELD, new StirThePrideGainLifeEffect(), false); + } + + public StirThePrideTriggeredAbility(final StirThePrideTriggeredAbility ability) { + super(ability); + } + + @Override + public StirThePrideTriggeredAbility copy() { + return new StirThePrideTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType().equals(EventType.DAMAGED_CREATURE) + || event.getType().equals(GameEvent.EventType.DAMAGED_PLAYER) + || event.getType().equals(GameEvent.EventType.DAMAGED_PLANESWALKER)) { + if (event.getSourceId().equals(this.getSourceId())) { + for (Effect effect : this.getEffects()) { + effect.setValue("damage", event.getAmount()); + } + return true; + } + + } + return false; + } + + @Override + public String getRule() { + return "Whenever {this} deals damage, " + super.getRule(); + } + +} + +class StirThePrideGainLifeEffect extends OneShotEffect { + + public StirThePrideGainLifeEffect() { + super(Outcome.GainLife); + this.staticText = "you gain that much life"; + } + + public StirThePrideGainLifeEffect(final StirThePrideGainLifeEffect effect) { + super(effect); + } + + @Override + public StirThePrideGainLifeEffect copy() { + return new StirThePrideGainLifeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int amount = (Integer) getValue("damage"); + if (amount > 0) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + controller.gainLife(amount, game); + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/ToothAndNail.java b/Mage.Sets/src/mage/sets/modernmasters/ToothAndNail.java new file mode 100644 index 0000000000..62d5f76bbb --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/ToothAndNail.java @@ -0,0 +1,117 @@ +/* + * 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.modernmasters; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.abilities.keyword.EntwineAbility; +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.TargetCardInHand; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author LevelX2 + */ +public class ToothAndNail extends CardImpl { + + public ToothAndNail(UUID ownerId) { + super(ownerId, 170, "Tooth and Nail", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{G}{G}"); + this.expansionSetCode = "MMA"; + + this.color.setGreen(true); + + // Choose one - + // Search your library for up to two creature cards, reveal them, put them into your hand, then shuffle your library; + this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 2, new FilterCreatureCard()))); + // or put up to two creature cards from your hand onto the battlefield. + Mode mode = new Mode(); + mode.getEffects().add(new ToothAndNailPutCreatureOnBattlefieldEffect()); + this.getSpellAbility().getModes().addMode(mode); + + // Entwine {2} + this.addAbility(new EntwineAbility("{2}")); + } + + public ToothAndNail(final ToothAndNail card) { + super(card); + } + + @Override + public ToothAndNail copy() { + return new ToothAndNail(this); + } +} + +class ToothAndNailPutCreatureOnBattlefieldEffect extends OneShotEffect { + + public ToothAndNailPutCreatureOnBattlefieldEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "Put up to two creature cards from your hand onto the battlefield"; + } + + public ToothAndNailPutCreatureOnBattlefieldEffect(final ToothAndNailPutCreatureOnBattlefieldEffect effect) { + super(effect); + } + + @Override + public ToothAndNailPutCreatureOnBattlefieldEffect copy() { + return new ToothAndNailPutCreatureOnBattlefieldEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + + TargetCardInHand target = new TargetCardInHand(0, 2, new FilterCreatureCard("creature cards")); + if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { + for (UUID targetId: target.getTargets()) { + Card card = game.getCard(targetId); + if (card != null) { + card.putOntoBattlefield(game, Zone.HAND, source.getId(), source.getControllerId()); + } + } + return true; + } + return false; + } +}