diff --git a/Mage.Sets/src/mage/sets/darksteel/LeoninShikari.java b/Mage.Sets/src/mage/sets/darksteel/LeoninShikari.java new file mode 100644 index 00000000000..8461dba8516 --- /dev/null +++ b/Mage.Sets/src/mage/sets/darksteel/LeoninShikari.java @@ -0,0 +1,103 @@ +/* + * 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; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.keyword.EquipAbility; +import mage.cards.CardImpl; +import mage.constants.AsThoughEffectType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; + +/** + * + * @author emerald000 + */ +public class LeoninShikari extends CardImpl { + + public LeoninShikari(UUID ownerId) { + super(ownerId, 6, "Leonin Shikari", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "DST"; + this.subtype.add("Cat"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // You may activate equip abilities any time you could cast an instant. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LeoninShikariEffect())); + } + + public LeoninShikari(final LeoninShikari card) { + super(card); + } + + @Override + public LeoninShikari copy() { + return new LeoninShikari(this); + } +} + +class LeoninShikariEffect extends AsThoughEffectImpl { + + LeoninShikariEffect() { + super(AsThoughEffectType.ACTIVATE_AS_INSTANT, Duration.EndOfGame, Outcome.Benefit); + staticText = "You may activate equip abilities any time you could cast an instant"; + } + + LeoninShikariEffect(final LeoninShikariEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public LeoninShikariEffect copy() { + return new LeoninShikariEffect(this); + } + + @Override + public boolean applies(UUID objectId, Ability affectedAbility, Ability source, Game game) { + return affectedAbility.getControllerId().equals(source.getControllerId()) && affectedAbility instanceof EquipAbility; + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + return false; // Not used + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodin/TajNarSwordsmith.java b/Mage.Sets/src/mage/sets/mirrodin/TajNarSwordsmith.java new file mode 100644 index 00000000000..7d2f6ddd78c --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodin/TajNarSwordsmith.java @@ -0,0 +1,110 @@ +/* + * 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; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.Filter.ComparisonType; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author emerald000 + */ +public class TajNarSwordsmith extends CardImpl { + + public TajNarSwordsmith(UUID ownerId) { + super(ownerId, 27, "Taj-Nar Swordsmith", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "MRD"; + this.subtype.add("Cat"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // When Taj-Nar Swordsmith enters the battlefield, you may pay {X}. If you do, search your library for an Equipment card with converted mana cost X or less and put that card onto the battlefield. Then shuffle your library. + this.addAbility(new EntersBattlefieldTriggeredAbility(new TajNarSwordsmithEffect())); + } + + public TajNarSwordsmith(final TajNarSwordsmith card) { + super(card); + } + + @Override + public TajNarSwordsmith copy() { + return new TajNarSwordsmith(this); + } +} + +class TajNarSwordsmithEffect extends OneShotEffect { + + TajNarSwordsmithEffect() { + super(Outcome.Benefit); + this.staticText = "you may pay {X}. If you do, search your library for an Equipment card with converted mana cost X or less and put that card onto the battlefield. Then shuffle your library"; + } + + TajNarSwordsmithEffect(final TajNarSwordsmithEffect effect) { + super(effect); + } + + @Override + public TajNarSwordsmithEffect copy() { + return new TajNarSwordsmithEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null && player.chooseUse(Outcome.BoostCreature, "Do you want to to pay {X}?", game)) { + int costX = player.announceXMana(0, Integer.MAX_VALUE, "Announce the value for {X}", game, source); + Cost cost = new GenericManaCost(costX); + if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) { + FilterCard filter = new FilterCard("Equipment card with converted mana cost " + costX + " or less"); + filter.add(new SubtypePredicate("Equipment")); + filter.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, costX + 1)); + new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, filter), true, true).apply(game, source); + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/KorHaven.java b/Mage.Sets/src/mage/sets/nemesis/KorHaven.java new file mode 100644 index 00000000000..09bc2c2cb88 --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/KorHaven.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.nemesis; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.PreventDamageByTargetEffect; +import mage.abilities.mana.ColorlessManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetAttackingCreature; + +/** + * + * @author emerald000 + */ +public class KorHaven extends CardImpl { + + public KorHaven(UUID ownerId) { + super(ownerId, 141, "Kor Haven", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "NMS"; + this.supertype.add("Legendary"); + + // {tap}: Add {1} to your mana pool. + this.addAbility(new ColorlessManaAbility()); + + // {1}{W}, {tap}: Prevent all combat damage that would be dealt by target attacking creature this turn. + Effect effect = new PreventDamageByTargetEffect(Duration.EndOfTurn, true); + effect.setText("Prevent all combat damage that would be dealt by target attacking creature this turn"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{1}{W}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetAttackingCreature()); + this.addAbility(ability); + } + + public KorHaven(final KorHaven card) { + super(card); + } + + @Override + public KorHaven copy() { + return new KorHaven(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/PlanarBirth.java b/Mage.Sets/src/mage/sets/urzassaga/PlanarBirth.java new file mode 100644 index 00000000000..fdd6644437e --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/PlanarBirth.java @@ -0,0 +1,99 @@ +/* + * 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.urzassaga; + +import java.util.UUID; +import mage.abilities.Ability; +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.FilterBasicLandCard; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author emerald000 + */ +public class PlanarBirth extends CardImpl { + + public PlanarBirth(UUID ownerId) { + super(ownerId, 31, "Planar Birth", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{W}"); + this.expansionSetCode = "USG"; + + // Return all basic land cards from all graveyards to the battlefield tapped under their owners' control. + this.getSpellAbility().addEffect(new PlanarBirthEffect()); + } + + public PlanarBirth(final PlanarBirth card) { + super(card); + } + + @Override + public PlanarBirth copy() { + return new PlanarBirth(this); + } +} + +class PlanarBirthEffect extends OneShotEffect { + + PlanarBirthEffect() { + super(Outcome.PutLandInPlay); + this.staticText = "Return all basic land cards from all graveyards to the battlefield tapped under their owners' control"; + } + + PlanarBirthEffect(final PlanarBirthEffect effect) { + super(effect); + } + + @Override + public PlanarBirthEffect copy() { + return new PlanarBirthEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + for (UUID playerId : controller.getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) { + for (Card card : player.getGraveyard().getCards(new FilterBasicLandCard(), source.getSourceId(), controller.getId(), game)) { + player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId(), true); + } + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/visions/PhyrexianMarauder.java b/Mage.Sets/src/mage/sets/visions/PhyrexianMarauder.java new file mode 100644 index 00000000000..0fa81436008 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/PhyrexianMarauder.java @@ -0,0 +1,168 @@ +/* + * 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.visions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.common.CantBlockAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.EntersBattlefieldEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.ReplacementEffectImpl; +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.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author emerald000 + */ +public class PhyrexianMarauder extends CardImpl { + + public PhyrexianMarauder(UUID ownerId) { + super(ownerId, 151, "Phyrexian Marauder", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{X}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Construct"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Phyrexian Marauder enters the battlefield with X +1/+1 counters on it. + this.addAbility(new EntersBattlefieldAbility(new PhyrexianMarauderEntersEffect(), "with X +1/+1 counters on it")); + + // Phyrexian Marauder can't block. + this.addAbility(new CantBlockAbility()); + + // Phyrexian Marauder can't attack unless you pay {1} for each +1/+1 counter on it. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhyrexianMarauderPayEffect())); + } + + public PhyrexianMarauder(final PhyrexianMarauder card) { + super(card); + } + + @Override + public PhyrexianMarauder copy() { + return new PhyrexianMarauder(this); + } +} + +class PhyrexianMarauderEntersEffect extends OneShotEffect { + + PhyrexianMarauderEntersEffect() { + super(Outcome.BoostCreature); + } + + PhyrexianMarauderEntersEffect(final PhyrexianMarauderEntersEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null && !permanent.isFaceDown(game)) { + Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (obj != null && obj instanceof SpellAbility) { + int amount = ((Ability) obj).getManaCostsToPay().getX(); + if (amount > 0) { + permanent.addCounters(CounterType.P1P1.createInstance(amount), game); + } + } + } + return true; + } + + @Override + public PhyrexianMarauderEntersEffect copy() { + return new PhyrexianMarauderEntersEffect(this); + } +} + +class PhyrexianMarauderPayEffect extends ReplacementEffectImpl { + + PhyrexianMarauderPayEffect() { + super(Duration.WhileOnBattlefield, Outcome.Neutral); + staticText = "{this} can't attack unless you pay {1} for each +1/+1 counter on it"; + } + + PhyrexianMarauderPayEffect(PhyrexianMarauderPayEffect effect) { + super(effect); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Player player = game.getPlayer(event.getPlayerId()); + Permanent permanent = game.getPermanent(source.getSourceId()); + if (player != null && permanent != null) { + int xValue = permanent.getCounters().getCount(CounterType.P1P1); + String chooseText; + if (event.getType().equals(GameEvent.EventType.DECLARE_ATTACKER)) { + chooseText = "Pay {" + xValue + "} to attack?"; + } else { + chooseText = "Pay {" + xValue + "} to block?"; + } + ManaCostsImpl attackTax = new ManaCostsImpl<>("{" + xValue + "}"); + if (attackTax.canPay(source, source.getSourceId(), event.getPlayerId(), game) + && player.chooseUse(Outcome.Neutral, chooseText, game)) { + if (attackTax.payOrRollback(source, game, source.getSourceId(), event.getPlayerId())) { + return false; + } + } + return true; + } + return false; + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARE_ATTACKER; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return event.getSourceId().equals(source.getSourceId()); + } + + @Override + public PhyrexianMarauderPayEffect copy() { + return new PhyrexianMarauderPayEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/ArgivianFind.java b/Mage.Sets/src/mage/sets/weatherlight/ArgivianFind.java new file mode 100644 index 00000000000..848fafb9b76 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/ArgivianFind.java @@ -0,0 +1,68 @@ +/* + * 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.weatherlight; + +import java.util.UUID; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author emerald000 + */ +public class ArgivianFind extends CardImpl { + + private static final FilterCard filter = new FilterCard("artifact or enchantment card"); + static { + filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.ENCHANTMENT))); + } + + public ArgivianFind(UUID ownerId) { + super(ownerId, 122, "Argivian Find", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}"); + this.expansionSetCode = "WTH"; + + // Return target artifact or enchantment card from your graveyard to your hand. + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter)); + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + } + + public ArgivianFind(final ArgivianFind card) { + super(card); + } + + @Override + public ArgivianFind copy() { + return new ArgivianFind(this); + } +}