From d6366be9ea2f7b35495b9e68bd89b1a04858ca71 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 16 Sep 2016 17:27:21 +0200 Subject: [PATCH] [KLD] Added 3 green adn 3 red cards. --- .../src/mage/sets/kaladesh/FlameLash.java | 60 +++++++++ .../kaladesh/GuardianOfTheGreatConduit.java | 87 +++++++++++++ .../sets/kaladesh/LiberatingCombustion.java | 123 ++++++++++++++++++ .../mage/sets/kaladesh/RenegadeFirebrand.java | 85 ++++++++++++ .../mage/sets/kaladesh/TerrainElemental.java | 58 +++++++++ .../mage/sets/kaladesh/VerdantCrescendo.java | 118 +++++++++++++++++ 6 files changed, 531 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/kaladesh/FlameLash.java create mode 100644 Mage.Sets/src/mage/sets/kaladesh/GuardianOfTheGreatConduit.java create mode 100644 Mage.Sets/src/mage/sets/kaladesh/LiberatingCombustion.java create mode 100644 Mage.Sets/src/mage/sets/kaladesh/RenegadeFirebrand.java create mode 100644 Mage.Sets/src/mage/sets/kaladesh/TerrainElemental.java create mode 100644 Mage.Sets/src/mage/sets/kaladesh/VerdantCrescendo.java diff --git a/Mage.Sets/src/mage/sets/kaladesh/FlameLash.java b/Mage.Sets/src/mage/sets/kaladesh/FlameLash.java new file mode 100644 index 00000000000..826331ccb82 --- /dev/null +++ b/Mage.Sets/src/mage/sets/kaladesh/FlameLash.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.kaladesh; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LevelX2 + */ +public class FlameLash extends CardImpl { + + public FlameLash(UUID ownerId) { + super(ownerId, 266, "Flame Lash", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{R}"); + this.expansionSetCode = "KLD"; + + // Flame Lash deals 4 damage to target creature or player. + this.getSpellAbility().addEffect(new DamageTargetEffect(4)); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + } + + public FlameLash(final FlameLash card) { + super(card); + } + + @Override + public FlameLash copy() { + return new FlameLash(this); + } +} diff --git a/Mage.Sets/src/mage/sets/kaladesh/GuardianOfTheGreatConduit.java b/Mage.Sets/src/mage/sets/kaladesh/GuardianOfTheGreatConduit.java new file mode 100644 index 00000000000..e95b70f4f03 --- /dev/null +++ b/Mage.Sets/src/mage/sets/kaladesh/GuardianOfTheGreatConduit.java @@ -0,0 +1,87 @@ +/* + * 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.kaladesh; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.ReachAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LevelX2 + */ +public class GuardianOfTheGreatConduit extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent(); + private static final String rule = "As long as you control a Nissa planeswalker, {this} gets +2/+0"; + + static { + filter.add(new CardTypePredicate(CardType.PLANESWALKER)); + filter.add(new SubtypePredicate("Nissa")); + } + + public GuardianOfTheGreatConduit(UUID ownerId) { + super(ownerId, 271, "Guardian of the Great Conduit", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "KLD"; + this.subtype.add("Elemental"); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Reach + this.addAbility(ReachAbility.getInstance()); + // As long as you control a Nissa planeswalker, Guardian of the Great Conduit gets +2/+0 and has vigilance. + ConditionalContinuousEffect effect1 = new ConditionalContinuousEffect(new BoostSourceEffect(2, 0, Duration.WhileOnBattlefield), new PermanentsOnTheBattlefieldCondition(filter), rule); + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect1); + ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(VigilanceAbility.getInstance(), Duration.WhileOnBattlefield), new PermanentsOnTheBattlefieldCondition(filter), "and has vigilance")); + this.addAbility(ability); + } + + public GuardianOfTheGreatConduit(final GuardianOfTheGreatConduit card) { + super(card); + } + + @Override + public GuardianOfTheGreatConduit copy() { + return new GuardianOfTheGreatConduit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/kaladesh/LiberatingCombustion.java b/Mage.Sets/src/mage/sets/kaladesh/LiberatingCombustion.java new file mode 100644 index 00000000000..0bb00fd3708 --- /dev/null +++ b/Mage.Sets/src/mage/sets/kaladesh/LiberatingCombustion.java @@ -0,0 +1,123 @@ +/* + * 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.kaladesh; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class LiberatingCombustion extends CardImpl { + + public LiberatingCombustion(UUID ownerId) { + super(ownerId, 267, "Liberating Combustion", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{R}"); + this.expansionSetCode = "KLD"; + + // Liberating Combustion deals 6 damage to target creature. + this.getSpellAbility().addEffect(new DamageTargetEffect(6)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + // You may search your library and/or graveyard for a card named Chandra, Pyrogenius, reveal it, and put it into your hand. If you search your library this way, shuffle it. + this.getSpellAbility().addEffect(new LiberatingCombustionEffect()); + } + + public LiberatingCombustion(final LiberatingCombustion card) { + super(card); + } + + @Override + public LiberatingCombustion copy() { + return new LiberatingCombustion(this); + } +} + +class LiberatingCombustionEffect extends OneShotEffect { + + public LiberatingCombustionEffect() { + super(Outcome.Benefit); + staticText = "You may search your library and/or graveyard for a card named Chandra, Pyrogenius, reveal it, and put it into your hand. If you search your library this way, shuffle it"; + } + + public LiberatingCombustionEffect(final LiberatingCombustionEffect effect) { + super(effect); + } + + @Override + public LiberatingCombustionEffect copy() { + return new LiberatingCombustionEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null && controller.chooseUse(outcome, "Search your library and/or graveyard for a card named Chandra, Pyrogenius?", source, game)) { + //Search your library and graveyard + Cards allCards = new CardsImpl(); + boolean librarySearched = false; + if (controller.chooseUse(outcome, "Search also your library?", source, game)) { + librarySearched = true; + allCards.addAll(controller.getLibrary().getCardList()); + } + allCards.addAll(controller.getGraveyard()); + FilterCard filter = new FilterCard("a card named Chandra, Pyrogenius"); + filter.add(new NamePredicate("Chandra, Pyrogenius")); + TargetCard target = new TargetCard(0, 1, Zone.ALL, new FilterCard()); + if (controller.choose(outcome, allCards, target, game)) { + Card cardFound = game.getCard(target.getFirstTarget()); + if (cardFound != null) { + controller.revealCards(sourceObject.getIdName(), allCards, game); + controller.moveCards(cardFound, Zone.HAND, source, game); + } + } + if (librarySearched) { + controller.shuffleLibrary(source, game); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/kaladesh/RenegadeFirebrand.java b/Mage.Sets/src/mage/sets/kaladesh/RenegadeFirebrand.java new file mode 100644 index 00000000000..57f19c83e6d --- /dev/null +++ b/Mage.Sets/src/mage/sets/kaladesh/RenegadeFirebrand.java @@ -0,0 +1,85 @@ +/* + * 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.kaladesh; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LevelX2 + */ +public class RenegadeFirebrand extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent(); + private static final String rule = "As long as you control a Chandra planeswalker, {this} gets +1/+0"; + + static { + filter.add(new CardTypePredicate(CardType.PLANESWALKER)); + filter.add(new SubtypePredicate("Chandra")); + } + + public RenegadeFirebrand(UUID ownerId) { + super(ownerId, 268, "Renegade Firebrand", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "KLD"; + this.subtype.add("Human"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // As long as you control a Chandra planeswalker, Renegade Firebrand gets +1/+0 and has first strike. + ConditionalContinuousEffect effect1 = new ConditionalContinuousEffect(new BoostSourceEffect(1, 0, Duration.WhileOnBattlefield), new PermanentsOnTheBattlefieldCondition(filter), rule); + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect1); + ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield), new PermanentsOnTheBattlefieldCondition(filter), "and has first strike")); + this.addAbility(ability); + } + + public RenegadeFirebrand(final RenegadeFirebrand card) { + super(card); + } + + @Override + public RenegadeFirebrand copy() { + return new RenegadeFirebrand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/kaladesh/TerrainElemental.java b/Mage.Sets/src/mage/sets/kaladesh/TerrainElemental.java new file mode 100644 index 00000000000..cbe11fd37a2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/kaladesh/TerrainElemental.java @@ -0,0 +1,58 @@ +/* + * 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.kaladesh; + +import java.util.UUID; +import mage.MageInt; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class TerrainElemental extends CardImpl { + + public TerrainElemental(UUID ownerId) { + super(ownerId, 272, "Terrain Elemental", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "KLD"; + this.subtype.add("Elemental"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + } + + public TerrainElemental(final TerrainElemental card) { + super(card); + } + + @Override + public TerrainElemental copy() { + return new TerrainElemental(this); + } +} diff --git a/Mage.Sets/src/mage/sets/kaladesh/VerdantCrescendo.java b/Mage.Sets/src/mage/sets/kaladesh/VerdantCrescendo.java new file mode 100644 index 00000000000..0822f31e10e --- /dev/null +++ b/Mage.Sets/src/mage/sets/kaladesh/VerdantCrescendo.java @@ -0,0 +1,118 @@ +/* + * 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.kaladesh; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.common.FilterBasicLandCard; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author LevelX2 + */ +public class VerdantCrescendo extends CardImpl { + + public VerdantCrescendo(UUID ownerId) { + super(ownerId, 273, "Verdant Crescendo", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{G}"); + this.expansionSetCode = "KLD"; + + // Search your library for a basic land card and put it onto the battlefield tapped. + this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterBasicLandCard()), true, false)); + + // Search your library and graveyard for a card named Nissa, Nature's Artisan, reveal it, and put it into your hand. Then shuffle your library. + this.getSpellAbility().addEffect(new VerdantCrescendoEffect()); + } + + public VerdantCrescendo(final VerdantCrescendo card) { + super(card); + } + + @Override + public VerdantCrescendo copy() { + return new VerdantCrescendo(this); + } +} + +class VerdantCrescendoEffect extends OneShotEffect { + + public VerdantCrescendoEffect() { + super(Outcome.Benefit); + staticText = "Search your library and graveyard for a card named Nissa, Nature's Artisan, reveal it, and put it into your hand. Then shuffle your library"; + } + + public VerdantCrescendoEffect(final VerdantCrescendoEffect effect) { + super(effect); + } + + @Override + public VerdantCrescendoEffect copy() { + return new VerdantCrescendoEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null) { + //Search your library and graveyard + Cards allCards = new CardsImpl(); + allCards.addAll(controller.getLibrary().getCardList()); + allCards.addAll(controller.getGraveyard()); + FilterCard filter = new FilterCard("a card named Nissa, Nature's Artisan"); + filter.add(new NamePredicate("Nissa, Nature's Artisan")); + TargetCard target = new TargetCard(0, 1, Zone.ALL, new FilterCard()); + if (controller.choose(outcome, allCards, target, game)) { + Card cardFound = game.getCard(target.getFirstTarget()); + if (cardFound != null) { + controller.revealCards(sourceObject.getIdName(), allCards, game); + controller.moveCards(cardFound, Zone.HAND, source, game); + } + } + controller.shuffleLibrary(source, game); + return true; + } + return false; + } +}