From 52e7a45adbff2ae096d5b58521d9aff9e3626a7f Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 2 Jun 2018 09:33:25 -0400 Subject: [PATCH] Implemented Salvager of Secrets --- Mage.Sets/src/mage/cards/a/Archaeomancer.java | 14 +--- .../src/mage/cards/s/SalvagerOfSecrets.java | 73 +++++++++++++++++++ Mage.Sets/src/mage/sets/CoreSet2019.java | 1 + 3 files changed, 77 insertions(+), 11 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/s/SalvagerOfSecrets.java diff --git a/Mage.Sets/src/mage/cards/a/Archaeomancer.java b/Mage.Sets/src/mage/cards/a/Archaeomancer.java index 7e9412f556..4edbf46e8f 100644 --- a/Mage.Sets/src/mage/cards/a/Archaeomancer.java +++ b/Mage.Sets/src/mage/cards/a/Archaeomancer.java @@ -35,9 +35,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; -import mage.filter.FilterCard; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.common.FilterInstantOrSorceryCard; import mage.target.Target; import mage.target.common.TargetCardInYourGraveyard; @@ -47,16 +45,10 @@ import mage.target.common.TargetCardInYourGraveyard; */ public final class Archaeomancer extends CardImpl { - private static final FilterCard filter = new FilterCard("instant or sorcery card from your graveyard"); - - static { - filter.add(Predicates.or( - new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - } + private static final FilterInstantOrSorceryCard filter = new FilterInstantOrSorceryCard("instant or sorcery card from your graveyard"); public Archaeomancer(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.WIZARD); diff --git a/Mage.Sets/src/mage/cards/s/SalvagerOfSecrets.java b/Mage.Sets/src/mage/cards/s/SalvagerOfSecrets.java new file mode 100644 index 0000000000..4a39b0537d --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SalvagerOfSecrets.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.cards.s; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.common.FilterInstantOrSorceryCard; +import mage.target.Target; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author TheElk801 + */ +public final class SalvagerOfSecrets extends CardImpl { + + private static final FilterInstantOrSorceryCard filter = new FilterInstantOrSorceryCard("instant or sorcery card from your graveyard"); + + public SalvagerOfSecrets(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); + + this.subtype.add(SubType.MERFOLK); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Salvager of Secrets enters the battlefield, return target instant or sorcery card from your graveyard to your hand. + EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), false); + Target target = new TargetCardInYourGraveyard(filter); + ability.addTarget(target); + this.addAbility(ability); + } + + public SalvagerOfSecrets(final SalvagerOfSecrets card) { + super(card); + } + + @Override + public SalvagerOfSecrets copy() { + return new SalvagerOfSecrets(this); + } +} diff --git a/Mage.Sets/src/mage/sets/CoreSet2019.java b/Mage.Sets/src/mage/sets/CoreSet2019.java index b69ed9285d..327f3e51aa 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2019.java +++ b/Mage.Sets/src/mage/sets/CoreSet2019.java @@ -77,6 +77,7 @@ public final class CoreSet2019 extends ExpansionSet { cards.add(new SetCardInfo("Oreskos Swiftclaw", 31, Rarity.COMMON, mage.cards.o.OreskosSwiftclaw.class)); cards.add(new SetCardInfo("Revitalize", 35, Rarity.COMMON, mage.cards.r.Revitalize.class)); cards.add(new SetCardInfo("Rustwing Falcon", 36, Rarity.COMMON, mage.cards.r.RustwingFalcon.class)); + cards.add(new SetCardInfo("Salvager of Secrets", 70, Rarity.COMMON, mage.cards.s.SalvagerOfSecrets.class)); cards.add(new SetCardInfo("Scholar of Stars", 71, Rarity.COMMON, mage.cards.s.ScholarOfStars.class)); cards.add(new SetCardInfo("Skyscanner", 245, Rarity.COMMON, mage.cards.s.Skyscanner.class)); cards.add(new SetCardInfo("Sovereign's Bite", 120, Rarity.COMMON, mage.cards.s.SovereignsBite.class));