From 53650b1592d4fbc2a0e072f2af2b38fdda740bb5 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 11 Dec 2014 02:06:57 +0100 Subject: [PATCH] [SOK] Added 5 green cards. --- .../sets/saviorsofkamigawa/DenseCanopy.java | 103 ++++++++++++++++ .../saviorsofkamigawa/ElderPineOfJukai.java | 116 ++++++++++++++++++ .../InnerCalmOuterStrength.java | 67 ++++++++++ .../MasumaroFirstToLive.java | 74 +++++++++++ .../sets/saviorsofkamigawa/RendingVines.java | 102 +++++++++++++++ 5 files changed, 462 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/saviorsofkamigawa/DenseCanopy.java create mode 100644 Mage.Sets/src/mage/sets/saviorsofkamigawa/ElderPineOfJukai.java create mode 100644 Mage.Sets/src/mage/sets/saviorsofkamigawa/InnerCalmOuterStrength.java create mode 100644 Mage.Sets/src/mage/sets/saviorsofkamigawa/MasumaroFirstToLive.java create mode 100644 Mage.Sets/src/mage/sets/saviorsofkamigawa/RendingVines.java diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/DenseCanopy.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/DenseCanopy.java new file mode 100644 index 0000000000..4a45301e3e --- /dev/null +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/DenseCanopy.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.saviorsofkamigawa; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.RestrictionEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author LevelX2 + */ +public class DenseCanopy extends CardImpl { + + public DenseCanopy(UUID ownerId) { + super(ownerId, 125, "Dense Canopy", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); + this.expansionSetCode = "SOK"; + + this.color.setGreen(true); + + // Creatures with flying can block only creatures with flying. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DenseCanopyCantBlockEffect())); + } + + public DenseCanopy(final DenseCanopy card) { + super(card); + } + + @Override + public DenseCanopy copy() { + return new DenseCanopy(this); + } +} + +class DenseCanopyCantBlockEffect extends RestrictionEffect { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures with flying"); + + static { + filter.add(new AbilityPredicate(FlyingAbility.class)); + } + + public DenseCanopyCantBlockEffect() { + super(Duration.WhileOnBattlefield); + staticText = "creatures with flying can block only creatures with flying"; + } + + public DenseCanopyCantBlockEffect(final DenseCanopyCantBlockEffect effect) { + super(effect); + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + return filter.match(permanent, source.getSourceId(), source.getControllerId(), game); + } + + @Override + public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { + return attacker.hasAbility(FlyingAbility.getInstance().getId(), game); + } + + @Override + public DenseCanopyCantBlockEffect copy() { + return new DenseCanopyCantBlockEffect(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/ElderPineOfJukai.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/ElderPineOfJukai.java new file mode 100644 index 0000000000..ff7a9ba805 --- /dev/null +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/ElderPineOfJukai.java @@ -0,0 +1,116 @@ +/* + * 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.saviorsofkamigawa; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.SpellCastAllTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.SoulshiftAbility; +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.common.FilterSpiritOrArcaneCard; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class ElderPineOfJukai extends CardImpl { + + public ElderPineOfJukai(UUID ownerId) { + super(ownerId, 128, "Elder Pine of Jukai", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "SOK"; + this.subtype.add("Spirit"); + + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Whenever you cast a Spirit or Arcane spell, reveal the top three cards of your library. Put all land cards revealed this way into your hand and the rest on the bottom of your library in any order. + this.addAbility(new SpellCastAllTriggeredAbility(new ElderPineOfJukaiEffect(), new FilterSpiritOrArcaneCard(), false)); + + // Soulshift 2 + this.addAbility(new SoulshiftAbility(2)); + } + + public ElderPineOfJukai(final ElderPineOfJukai card) { + super(card); + } + + @Override + public ElderPineOfJukai copy() { + return new ElderPineOfJukai(this); + } +} + +class ElderPineOfJukaiEffect extends OneShotEffect { + + public ElderPineOfJukaiEffect() { + super(Outcome.DrawCard); + this.staticText = "reveal the top three cards of your library. Put all land cards revealed this way into your hand and the rest on the bottom of your library in any order"; + } + + public ElderPineOfJukaiEffect(final ElderPineOfJukaiEffect effect) { + super(effect); + } + + @Override + public ElderPineOfJukaiEffect copy() { + return new ElderPineOfJukaiEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller == null || sourceObject == null) { + return false; + } + Cards cards = new CardsImpl(); + cards.addAll(controller.getLibrary().getTopCards(game, 3)); + controller.revealCards(sourceObject.getLogName(), cards, game); + for (Card card: cards.getCards(game)) { + if (card.getCardType().contains(CardType.LAND)) { + controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY); + cards.remove(card); + } + } + controller.putCardsOnBottomOfLibrary(cards, game, source, true); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/InnerCalmOuterStrength.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/InnerCalmOuterStrength.java new file mode 100644 index 0000000000..854cc2aaae --- /dev/null +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/InnerCalmOuterStrength.java @@ -0,0 +1,67 @@ +/* + * 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.saviorsofkamigawa; + +import java.util.UUID; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; +import mage.abilities.effects.common.continious.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class InnerCalmOuterStrength extends CardImpl { + + public InnerCalmOuterStrength(UUID ownerId) { + super(ownerId, 133, "Inner Calm, Outer Strength", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{G}"); + this.expansionSetCode = "SOK"; + this.subtype.add("Arcane"); + + this.color.setGreen(true); + + // Target creature gets +X/+X until end of turn, where X is the number of cards in your hand. + DynamicValue xValue= new CardsInControllerHandCount(); + this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public InnerCalmOuterStrength(final InnerCalmOuterStrength card) { + super(card); + } + + @Override + public InnerCalmOuterStrength copy() { + return new InnerCalmOuterStrength(this); + } +} diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/MasumaroFirstToLive.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/MasumaroFirstToLive.java new file mode 100644 index 0000000000..3ec36740db --- /dev/null +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/MasumaroFirstToLive.java @@ -0,0 +1,74 @@ +/* + * 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.saviorsofkamigawa; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.MultipliedValue; +import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; +import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class MasumaroFirstToLive extends CardImpl { + + public MasumaroFirstToLive(UUID ownerId) { + super(ownerId, 136, "Masumaro, First to Live", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}{G}{G}"); + this.expansionSetCode = "SOK"; + this.supertype.add("Legendary"); + this.subtype.add("Spirit"); + + this.color.setGreen(true); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Masumaro, First to Live's power and toughness are each equal to twice the number of cards in your hand. + DynamicValue xValue= new MultipliedValue(new CardsInControllerHandCount(), 2); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame))); + + + } + + public MasumaroFirstToLive(final MasumaroFirstToLive card) { + super(card); + } + + @Override + public MasumaroFirstToLive copy() { + return new MasumaroFirstToLive(this); + } +} diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/RendingVines.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/RendingVines.java new file mode 100644 index 0000000000..f448a82504 --- /dev/null +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/RendingVines.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.saviorsofkamigawa; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterArtifactOrEnchantmentPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPermanent; + +/** + * + * @author LevelX2 + */ +public class RendingVines extends CardImpl { + + public RendingVines(UUID ownerId) { + super(ownerId, 143, "Rending Vines", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}{G}"); + this.expansionSetCode = "SOK"; + this.subtype.add("Arcane"); + + this.color.setGreen(true); + + // Destroy target artifact or enchantment if its converted mana cost is less than or equal to the number of cards in your hand. + this.getSpellAbility().addEffect(new RendingVinesEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(new FilterArtifactOrEnchantmentPermanent())); + + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + } + + public RendingVines(final RendingVines card) { + super(card); + } + + @Override + public RendingVines copy() { + return new RendingVines(this); + } +} + +class RendingVinesEffect extends OneShotEffect { + + public RendingVinesEffect() { + super(Outcome.DestroyPermanent); + this.staticText = "Destroy target artifact or enchantment if its converted mana cost is less than or equal to the number of cards in your hand"; + } + + public RendingVinesEffect(final RendingVinesEffect effect) { + super(effect); + } + + @Override + public RendingVinesEffect copy() { + return new RendingVinesEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (controller != null) { + if (permanent.getManaCost().convertedManaCost() <= controller.getHand().size()) { + return permanent.destroy(source.getSourceId(), game, false); + } + } + return false; + } +}