From d6661078dafe0fc846d5373fc3ab4a48235dbba5 Mon Sep 17 00:00:00 2001 From: North Date: Wed, 24 Aug 2011 17:34:12 +0300 Subject: [PATCH] Added cards. --- .../sets/alarareborn/MistveinBorderpost.java | 5 +- .../mage/sets/magic2010/DjinnOfWishes.java | 21 +-- .../src/mage/sets/magic2010/DragonWhelp.java | 144 +++++++++++++++++ .../src/mage/sets/magic2012/MindUnbound.java | 2 +- .../mage/sets/mirrodinbesieged/Galvanoth.java | 114 ++++++++++++++ .../src/mage/sets/planechase/BeastHunt.java | 52 ++++++ .../sets/riseoftheeldrazi/HandOfEmrakul.java | 76 +++++++++ .../riseoftheeldrazi/PathrazerOfUlamog.java | 114 ++++++++++++++ .../sets/riseoftheeldrazi/RapaciousOne.java | 102 ++++++++++++ .../src/mage/sets/zendikar/BeastHunt.java | 111 +++++++++++++ .../mage/sets/zendikar/ExplorersScope.java | 149 ++++++++++++++++++ .../mage/sets/zendikar/ParalyzingGrasp.java | 70 ++++++++ .../mage/sets/zendikar/TurntimberRanger.java | 73 +++++++++ .../mage/sets/zendikar/WindborneCharge.java | 66 ++++++++ .../common/continious/BoostTargetEffect.java | 24 ++- .../continious/GainAbilityTargetEffect.java | 9 +- 16 files changed, 1108 insertions(+), 24 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/magic2010/DragonWhelp.java create mode 100644 Mage.Sets/src/mage/sets/mirrodinbesieged/Galvanoth.java create mode 100644 Mage.Sets/src/mage/sets/planechase/BeastHunt.java create mode 100644 Mage.Sets/src/mage/sets/riseoftheeldrazi/HandOfEmrakul.java create mode 100644 Mage.Sets/src/mage/sets/riseoftheeldrazi/PathrazerOfUlamog.java create mode 100644 Mage.Sets/src/mage/sets/riseoftheeldrazi/RapaciousOne.java create mode 100644 Mage.Sets/src/mage/sets/zendikar/BeastHunt.java create mode 100644 Mage.Sets/src/mage/sets/zendikar/ExplorersScope.java create mode 100644 Mage.Sets/src/mage/sets/zendikar/ParalyzingGrasp.java create mode 100644 Mage.Sets/src/mage/sets/zendikar/TurntimberRanger.java create mode 100644 Mage.Sets/src/mage/sets/zendikar/WindborneCharge.java diff --git a/Mage.Sets/src/mage/sets/alarareborn/MistveinBorderpost.java b/Mage.Sets/src/mage/sets/alarareborn/MistveinBorderpost.java index f56566e5270..e3b85ad0805 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/MistveinBorderpost.java +++ b/Mage.Sets/src/mage/sets/alarareborn/MistveinBorderpost.java @@ -30,9 +30,7 @@ package mage.sets.alarareborn; import java.util.UUID; import mage.Constants.CardType; -import mage.Constants.Duration; import mage.Constants.Rarity; -import mage.Constants.Zone; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.costs.AlternativeCostImpl; import mage.abilities.costs.CompositeCost; @@ -44,7 +42,6 @@ import mage.abilities.mana.BlueManaAbility; import mage.cards.CardImpl; import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; -import mage.sets.magic2011.BlackKnight; import mage.target.common.TargetControlledPermanent; /** @@ -52,7 +49,7 @@ import mage.target.common.TargetControlledPermanent; * @author Loki */ public class MistveinBorderpost extends CardImpl { - private static FilterControlledPermanent filter = new FilterControlledPermanent("basic land"); + private static final FilterControlledPermanent filter = new FilterControlledPermanent("basic land"); private static final String COST_DESCRIPTION = "pay {1} and return a basic land you control to its owner's hand"; private static final String ALTERNATIVE_COST_DESCRIPTION = "You may pay {1} and return a basic land you control to its owner's hand rather than pay Mistvein Borderpos's mana cost"; diff --git a/Mage.Sets/src/mage/sets/magic2010/DjinnOfWishes.java b/Mage.Sets/src/mage/sets/magic2010/DjinnOfWishes.java index f02e210c260..68e52000637 100644 --- a/Mage.Sets/src/mage/sets/magic2010/DjinnOfWishes.java +++ b/Mage.Sets/src/mage/sets/magic2010/DjinnOfWishes.java @@ -29,9 +29,10 @@ package mage.sets.magic2010; import java.util.UUID; -import mage.Constants; import mage.Constants.CardType; +import mage.Constants.Outcome; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; @@ -71,7 +72,7 @@ public class DjinnOfWishes extends CardImpl { this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.WISH.createInstance(3)), ruleText)); // {2}{U}{U}, Remove a wish counter from Djinn of Wishes: Reveal the top card of your library. You may play that card without paying its mana cost. If you don't, exile it. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DjinnOfWishesEffect1(), new ManaCostsImpl("{2}{U}{U}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DjinnOfWishesEffect(), new ManaCostsImpl("{2}{U}{U}")); ability.addCost(new RemoveCountersSourceCost(CounterType.WISH.createInstance())); this.addAbility(ability); } @@ -86,14 +87,14 @@ public class DjinnOfWishes extends CardImpl { } } -class DjinnOfWishesEffect1 extends OneShotEffect { +class DjinnOfWishesEffect extends OneShotEffect { - public DjinnOfWishesEffect1() { - super(Constants.Outcome.PlayForFree); + public DjinnOfWishesEffect() { + super(Outcome.PlayForFree); staticText = "Reveal the top card of your library. You may play that card without paying its mana cost. If you don't, exile it"; } - public DjinnOfWishesEffect1(final DjinnOfWishesEffect1 effect) { + public DjinnOfWishesEffect(final DjinnOfWishesEffect effect) { super(effect); } @@ -109,7 +110,7 @@ class DjinnOfWishesEffect1 extends OneShotEffect { player.getLibrary().removeFromTop(game); boolean used = false; - if (player.chooseUse(Constants.Outcome.PlayForFree, "Play " + card.getName() + " without paying its mana cost?", game)) { + if (player.chooseUse(Outcome.PlayForFree, "Play " + card.getName() + " without paying its mana cost?", game)) { if (card.getCardType().contains(CardType.LAND)) { // If the revealed card is a land, you can play it only if it's your turn and you haven't yet played a land this turn. if (game.getActivePlayerId().equals(player.getId()) && player.getLandsPlayed() < player.getLandsPerTurn()) { @@ -123,7 +124,7 @@ class DjinnOfWishesEffect1 extends OneShotEffect { } if (!used) { - card.moveToZone(Constants.Zone.EXILED, source.getSourceId(), game, false); + card.moveToZone(Zone.EXILED, source.getSourceId(), game, false); } return true; @@ -132,8 +133,8 @@ class DjinnOfWishesEffect1 extends OneShotEffect { } @Override - public DjinnOfWishesEffect1 copy() { - return new DjinnOfWishesEffect1(this); + public DjinnOfWishesEffect copy() { + return new DjinnOfWishesEffect(this); } } diff --git a/Mage.Sets/src/mage/sets/magic2010/DragonWhelp.java b/Mage.Sets/src/mage/sets/magic2010/DragonWhelp.java new file mode 100644 index 00000000000..8cab3521e67 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2010/DragonWhelp.java @@ -0,0 +1,144 @@ +/* + * 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.magic2010; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continious.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author North + */ +public class DragonWhelp extends CardImpl { + + public DragonWhelp(UUID ownerId) { + super(ownerId, 133, "Dragon Whelp", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "M10"; + this.subtype.add("Dragon"); + + this.color.setRed(true); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + this.addAbility(FlyingAbility.getInstance()); + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new BoostSourceEffect(1, 0, Duration.EndOfTurn), + new ManaCostsImpl("{R}")); + ability.addEffect(new DragonWhelpEffect()); + this.addAbility(ability); + } + + public DragonWhelp(final DragonWhelp card) { + super(card); + } + + @Override + public DragonWhelp copy() { + return new DragonWhelp(this); + } +} + +class DragonWhelpEffect extends OneShotEffect { + + public DragonWhelpEffect() { + super(Outcome.Damage); + this.staticText = "If this ability has been activated four or more times this turn, sacrifice {this} at the beginning of the next end step"; + } + + public DragonWhelpEffect(final DragonWhelpEffect effect) { + super(effect); + } + + @Override + public DragonWhelpEffect copy() { + return new DragonWhelpEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Integer amount = (Integer) game.getState().getValue(source.getSourceId().toString() + "DragonWhelp"); + if (amount == null) { + amount = 0; + DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new DragonWhelpDelayedEffect()); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + game.addDelayedTriggeredAbility(delayedAbility); + } + amount++; + game.getState().setValue(source.getSourceId().toString() + "DragonWhelp", amount); + + return true; + } +} + +class DragonWhelpDelayedEffect extends OneShotEffect { + + public DragonWhelpDelayedEffect() { + super(Outcome.Damage); + this.staticText = "If this ability has been activated four or more times this turn, sacrifice {this} at the beginning of the next end step"; + } + + public DragonWhelpDelayedEffect(final DragonWhelpDelayedEffect effect) { + super(effect); + } + + @Override + public DragonWhelpDelayedEffect copy() { + return new DragonWhelpDelayedEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Integer amount = (Integer) game.getState().getValue(source.getSourceId().toString() + "DragonWhelp"); + if (amount != null && amount >= 4) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + permanent.sacrifice(source.getSourceId(), game); + } + } + game.getState().setValue(source.getSourceId().toString() + "DragonWhelp", null); + + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/magic2012/MindUnbound.java b/Mage.Sets/src/mage/sets/magic2012/MindUnbound.java index c8b701cd1be..5474267d8c4 100644 --- a/Mage.Sets/src/mage/sets/magic2012/MindUnbound.java +++ b/Mage.Sets/src/mage/sets/magic2012/MindUnbound.java @@ -42,7 +42,7 @@ import mage.counters.CounterType; /** * - * @author anonymous + * @author Loki */ public class MindUnbound extends CardImpl { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Galvanoth.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Galvanoth.java new file mode 100644 index 00000000000..ebdeea0775a --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Galvanoth.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.sets.mirrodinbesieged; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.TargetController; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.counters.CounterType; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author North + */ +public class Galvanoth extends CardImpl { + + public Galvanoth(UUID ownerId) { + super(ownerId, 62, "Galvanoth", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "MBS"; + this.subtype.add("Beast"); + + this.color.setRed(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new GalvanothEffect(), TargetController.YOU, true)); + } + + public Galvanoth(final Galvanoth card) { + super(card); + } + + @Override + public Galvanoth copy() { + return new Galvanoth(this); + } +} + +class GalvanothEffect extends OneShotEffect { + + public GalvanothEffect() { + super(Outcome.PlayForFree); + staticText = "look at the top card of your library. If it's an instant or sorcery card, you may cast it without paying its mana cost"; + } + + public GalvanothEffect(final GalvanothEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null && player.getLibrary().size() > 0) { + Card card = player.getLibrary().getFromTop(game); + Cards cards = new CardsImpl(); + cards.add(card); + player.lookAtCards("Galvanoth", cards, game); + + if (card.getCardType().contains(CardType.INSTANT) || card.getCardType().contains(CardType.SORCERY)) { + String message = "Cast " + card.getName() + " without paying its mana cost?"; + if (player.chooseUse(Outcome.PlayForFree, message, game)) { + player.getLibrary().removeFromTop(game); + player.cast(card.getSpellAbility(), game, true); + } + } + + return true; + } + return false; + } + + @Override + public GalvanothEffect copy() { + return new GalvanothEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planechase/BeastHunt.java b/Mage.Sets/src/mage/sets/planechase/BeastHunt.java new file mode 100644 index 00000000000..752d781687f --- /dev/null +++ b/Mage.Sets/src/mage/sets/planechase/BeastHunt.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.planechase; + +import java.util.UUID; + +/** + * + * @author North + */ +public class BeastHunt extends mage.sets.zendikar.BeastHunt { + + public BeastHunt(UUID ownerId) { + super(ownerId); + this.cardNumber = 68; + this.expansionSetCode = "HOP"; + } + + public BeastHunt(final BeastHunt card) { + super(card); + } + + @Override + public BeastHunt copy() { + return new BeastHunt(this); + } +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/HandOfEmrakul.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/HandOfEmrakul.java new file mode 100644 index 00000000000..64958163c48 --- /dev/null +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/HandOfEmrakul.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.riseoftheeldrazi; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.costs.AlternativeCostImpl; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.keyword.AnnihilatorAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterControlledPermanent; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author North + */ +public class HandOfEmrakul extends CardImpl { + + private static final String ALTERNATIVE_COST_DESCRIPTION = "You may sacrifice four Eldrazi Spawn rather than pay Hand of Emrakul's mana cost."; + private static final FilterControlledPermanent filter = new FilterControlledPermanent("Eldrazi Spawn"); + + static { + filter.getName().add("Eldrazi Spawn"); + } + + public HandOfEmrakul(UUID ownerId) { + super(ownerId, 5, "Hand of Emrakul", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{9}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Eldrazi"); + + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // You may sacrifice four Eldrazi Spawn rather than pay Hand of Emrakul's mana cost. + this.getSpellAbility().addAlternativeCost(new AlternativeCostImpl(ALTERNATIVE_COST_DESCRIPTION, + new SacrificeTargetCost(new TargetControlledPermanent(4, 4, filter, true)))); + this.addAbility(new AnnihilatorAbility(1)); + } + + public HandOfEmrakul(final HandOfEmrakul card) { + super(card); + } + + @Override + public HandOfEmrakul copy() { + return new HandOfEmrakul(this); + } +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/PathrazerOfUlamog.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/PathrazerOfUlamog.java new file mode 100644 index 00000000000..b7809b91070 --- /dev/null +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/PathrazerOfUlamog.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.sets.riseoftheeldrazi; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Layer; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.SubLayer; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.keyword.AnnihilatorAbility; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author North + */ +public class PathrazerOfUlamog extends CardImpl { + + public PathrazerOfUlamog(UUID ownerId) { + super(ownerId, 9, "Pathrazer of Ulamog", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{11}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Eldrazi"); + + this.power = new MageInt(9); + this.toughness = new MageInt(9); + + this.addAbility(new AnnihilatorAbility(3)); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PathrazerOfUlamogEffect())); + } + + public PathrazerOfUlamog(final PathrazerOfUlamog card) { + super(card); + } + + @Override + public PathrazerOfUlamog copy() { + return new PathrazerOfUlamog(this); + } +} + +class PathrazerOfUlamogEffect extends ContinuousEffectImpl { + + public PathrazerOfUlamogEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "{this} can't be blocked except by three or more creatures"; + } + + public PathrazerOfUlamogEffect(final PathrazerOfUlamogEffect effect) { + super(effect); + } + + @Override + public PathrazerOfUlamogEffect copy() { + return new PathrazerOfUlamogEffect(this); + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent perm = game.getPermanent(source.getSourceId()); + if (perm != null) { + switch (layer) { + case RulesEffects: + perm.setMinBlockedBy(3); + break; + } + return true; + } + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.RulesEffects; + } +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/RapaciousOne.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/RapaciousOne.java new file mode 100644 index 00000000000..8d31f781543 --- /dev/null +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/RapaciousOne.java @@ -0,0 +1,102 @@ +/* + * 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.riseoftheeldrazi; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.token.EldraziSpawnToken; + +/** + * + * @author North + */ +public class RapaciousOne extends CardImpl { + + public RapaciousOne(UUID ownerId) { + super(ownerId, 162, "Rapacious One", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{R}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + + this.color.setRed(true); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + this.addAbility(TrampleAbility.getInstance()); + this.addAbility(new RapaciousOneTriggeredAbility()); + } + + public RapaciousOne(final RapaciousOne card) { + super(card); + } + + @Override + public RapaciousOne copy() { + return new RapaciousOne(this); + } +} + +class RapaciousOneTriggeredAbility extends TriggeredAbilityImpl { + + public RapaciousOneTriggeredAbility() { + super(Zone.BATTLEFIELD, null, false); + } + + public RapaciousOneTriggeredAbility(final RapaciousOneTriggeredAbility ability) { + super(ability); + } + + @Override + public RapaciousOneTriggeredAbility copy() { + return new RapaciousOneTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId)) { + this.addEffect(new CreateTokenEffect(new EldraziSpawnToken(), event.getAmount())); + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever {this} deals combat damage to a player, put that many 0/1 colorless Eldrazi Spawn creature tokens onto the battlefield. They have \"Sacrifice this creature: Add {1} to your mana pool.\""; + } +} diff --git a/Mage.Sets/src/mage/sets/zendikar/BeastHunt.java b/Mage.Sets/src/mage/sets/zendikar/BeastHunt.java new file mode 100644 index 00000000000..c5e82a2aaf2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikar/BeastHunt.java @@ -0,0 +1,111 @@ +/* + * 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.zendikar; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author North + */ +public class BeastHunt extends CardImpl { + + public BeastHunt(UUID ownerId) { + super(ownerId, 158, "Beast Hunt", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{G}"); + this.expansionSetCode = "ZEN"; + + this.color.setGreen(true); + + this.getSpellAbility().addEffect(new BeastHuntEffect()); + } + + public BeastHunt(final BeastHunt card) { + super(card); + } + + @Override + public BeastHunt copy() { + return new BeastHunt(this); + } +} + +class BeastHuntEffect extends OneShotEffect { + + public BeastHuntEffect() { + super(Outcome.Benefit); + staticText = "Reveal the top three cards of your library. Put all creature cards revealed this way into your hand and the rest into your graveyard"; + } + + public BeastHuntEffect(final BeastHuntEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + + Cards cards = new CardsImpl(); + for (int i = 0; i < 3; i++) { + Card card = player.getLibrary().removeFromTop(game); + if (card != null) { + cards.add(card); + if (card.getCardType().contains(CardType.CREATURE)) { + card.moveToZone(Zone.HAND, source.getId(), game, false); + } else { + card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false); + } + } + } + + if (!cards.isEmpty()) { + player.revealCards("Beast Hunt", cards, game); + } + + return true; + } + + @Override + public BeastHuntEffect copy() { + return new BeastHuntEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikar/ExplorersScope.java b/Mage.Sets/src/mage/sets/zendikar/ExplorersScope.java new file mode 100644 index 00000000000..d8a1264d41c --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikar/ExplorersScope.java @@ -0,0 +1,149 @@ +/* + * 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.zendikar; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.EquipAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author North + */ +public class ExplorersScope extends CardImpl { + + public ExplorersScope(UUID ownerId) { + super(ownerId, 202, "Explorer's Scope", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}"); + this.expansionSetCode = "ZEN"; + this.subtype.add("Equipment"); + + this.addAbility(new ExplorersScopeTriggeredAbiltity()); + this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(1))); + } + + public ExplorersScope(final ExplorersScope card) { + super(card); + } + + @Override + public ExplorersScope copy() { + return new ExplorersScope(this); + } +} + +class ExplorersScopeTriggeredAbiltity extends TriggeredAbilityImpl { + + public ExplorersScopeTriggeredAbiltity() { + super(Zone.BATTLEFIELD, new ExplorersScopeEffect()); + } + + public ExplorersScopeTriggeredAbiltity(final ExplorersScopeTriggeredAbiltity abiltity) { + super(abiltity); + } + + @Override + public ExplorersScopeTriggeredAbiltity copy() { + return new ExplorersScopeTriggeredAbiltity(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent equipment = game.getPermanent(this.sourceId); + if (equipment != null && equipment.getAttachedTo() != null + && event.getType() == GameEvent.EventType.ATTACKER_DECLARED + && event.getSourceId().equals(equipment.getAttachedTo())) { + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever equipped creature attacks, look at the top card of your library. If it's a land card, you may put it onto the battlefield tapped."; + } +} + +class ExplorersScopeEffect extends OneShotEffect { + + public ExplorersScopeEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "look at the top card of your library. If it's a land card, you may put it onto the battlefield tapped"; + } + + public ExplorersScopeEffect(final ExplorersScopeEffect effect) { + super(effect); + } + + @Override + public ExplorersScopeEffect copy() { + return new ExplorersScopeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + + Card card = player.getLibrary().getFromTop(game); + if (card != null) { + Cards cards = new CardsImpl(); + cards.add(card); + player.lookAtCards("Explorer's Scope", cards, game); + if (card.getCardType().contains(CardType.LAND)) { + String message = "Put " + card.getName() + " onto the battlefield tapped?"; + if (player.chooseUse(Outcome.PutLandInPlay, message, game)) { + player.getLibrary().remove(card.getId(), game); + if (card.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), source.getControllerId())) { + Permanent permanent = game.getPermanent(card.getId()); + if (permanent != null) { + permanent.setTapped(true); + } + } + } + } + } + return true; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/ParalyzingGrasp.java b/Mage.Sets/src/mage/sets/zendikar/ParalyzingGrasp.java new file mode 100644 index 00000000000..ee58be23350 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikar/ParalyzingGrasp.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.zendikar; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.SkipEnchantedUntapEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author North + */ +public class ParalyzingGrasp extends CardImpl { + + public ParalyzingGrasp(UUID ownerId) { + super(ownerId, 58, "Paralyzing Grasp", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); + this.expansionSetCode = "ZEN"; + this.subtype.add("Aura"); + + this.color.setBlue(true); + + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + EnchantAbility ability = new EnchantAbility(auraTarget.getTargetName()); + ability.addEffect(new SkipEnchantedUntapEffect()); + this.addAbility(ability); + } + + public ParalyzingGrasp(final ParalyzingGrasp card) { + super(card); + } + + @Override + public ParalyzingGrasp copy() { + return new ParalyzingGrasp(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikar/TurntimberRanger.java b/Mage.Sets/src/mage/sets/zendikar/TurntimberRanger.java new file mode 100644 index 00000000000..0e17c8f38e1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikar/TurntimberRanger.java @@ -0,0 +1,73 @@ +/* + * 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.zendikar; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.counters.CounterType; +import mage.game.permanent.token.WolfToken; + +/** + * + * @author North + */ +public class TurntimberRanger extends CardImpl { + + public TurntimberRanger(UUID ownerId) { + super(ownerId, 191, "Turntimber Ranger", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "ZEN"; + this.subtype.add("Elf"); + this.subtype.add("Scout"); + this.subtype.add("Ally"); + + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Turntimber Ranger or another Ally enters the battlefield under your control, you may put a 2/2 green Wolf creature token onto the battlefield. If you do, put a +1/+1 counter on Turntimber Ranger. + Ability ability = new AllyEntersBattlefieldTriggeredAbility(new CreateTokenEffect(new WolfToken()), true); + ability.addEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance())); + this.addAbility(ability); + } + + public TurntimberRanger(final TurntimberRanger card) { + super(card); + } + + @Override + public TurntimberRanger copy() { + return new TurntimberRanger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikar/WindborneCharge.java b/Mage.Sets/src/mage/sets/zendikar/WindborneCharge.java new file mode 100644 index 00000000000..5326b1bd521 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikar/WindborneCharge.java @@ -0,0 +1,66 @@ +/* + * 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.zendikar; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.abilities.effects.common.continious.BoostTargetEffect; +import mage.abilities.effects.common.continious.GainAbilityTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author North + */ +public class WindborneCharge extends CardImpl { + + public WindborneCharge(UUID ownerId) { + super(ownerId, 38, "Windborne Charge", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{W}{W}"); + this.expansionSetCode = "ZEN"; + + this.color.setWhite(true); + + // Two target creatures you control each get +2/+2 and gain flying until end of turn. + this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent(2)); + this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn)); + } + + public WindborneCharge(final WindborneCharge card) { + super(card); + } + + @Override + public WindborneCharge copy() { + return new WindborneCharge(this); + } +} diff --git a/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java b/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java index 88e8c73dab2..79bfcac543c 100644 --- a/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java @@ -27,6 +27,7 @@ */ package mage.abilities.effects.common.continious; +import java.util.UUID; import mage.Constants.Duration; import mage.Constants.Layer; import mage.Constants.Outcome; @@ -38,6 +39,7 @@ import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.ContinuousEffectImpl; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.target.Target; /** * @@ -71,19 +73,27 @@ public class BoostTargetEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { - Permanent target = (Permanent) game.getPermanent(source.getFirstTarget()); - if (target != null) { - target.addPower(power.calculate(game, source)); - target.addToughness(toughness.calculate(game, source)); - return true; + int affectedTargets = 0; + for (UUID permanentId : source.getTargets().get(0).getTargets()) { + Permanent target = (Permanent) game.getPermanent(permanentId); + if (target != null) { + target.addPower(power.calculate(game, source)); + target.addToughness(toughness.calculate(game, source)); + affectedTargets++; + } } - return false; + return affectedTargets > 0; } @Override public String getText(Mode mode) { StringBuilder sb = new StringBuilder(); - sb.append("Target ").append(mode.getTargets().get(0).getTargetName()).append(" gets "); + Target target = mode.getTargets().get(0); + if(target.getNumberOfTargets() > 1){ + sb.append(target.getNumberOfTargets()).append(" target ").append(target.getTargetName()).append(" get "); + } else { + sb.append("Target ").append(target.getTargetName()).append(" gets "); + } String p = power.toString(); if(!p.startsWith("-")) sb.append("+"); diff --git a/Mage/src/mage/abilities/effects/common/continious/GainAbilityTargetEffect.java b/Mage/src/mage/abilities/effects/common/continious/GainAbilityTargetEffect.java index 43777a5f2d6..cf949da2a9a 100644 --- a/Mage/src/mage/abilities/effects/common/continious/GainAbilityTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/GainAbilityTargetEffect.java @@ -39,6 +39,7 @@ import mage.game.permanent.Permanent; import java.util.UUID; import mage.abilities.Mode; +import mage.target.Target; /** * @@ -77,10 +78,14 @@ public class GainAbilityTargetEffect extends ContinuousEffectImpl { } @Override - //TODO redone text for multiple targets public String getText(Mode mode) { StringBuilder sb = new StringBuilder(); - sb.append("Target ").append(mode.getTargets().get(0).getTargetName()).append(" gains "); + Target target = mode.getTargets().get(0); + if(target.getNumberOfTargets() > 1){ + sb.append(target.getNumberOfTargets()).append(" target ").append(target.getTargetName()).append(" gain "); + } else { + sb.append("Target ").append(target.getTargetName()).append(" gains "); + } sb.append(ability.getRule()).append(" ").append(duration.toString()); return sb.toString(); }