diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/HeedTheMists.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/HeedTheMists.java index e39f8f5c0f..b9884dbfe0 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/HeedTheMists.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/HeedTheMists.java @@ -50,7 +50,7 @@ public class HeedTheMists extends CardImpl { super(ownerId, 36, "Heed the Mists", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{U}{U}"); this.expansionSetCode = "BOK"; this.subtype.add("Arcane"); - + this.color.setBlue(true); // Put the top card of your library into your graveyard, then draw cards equal to that card's converted mana cost. @@ -65,36 +65,36 @@ public class HeedTheMists extends CardImpl { public HeedTheMists copy() { return new HeedTheMists(this); } - + private class HeedTheMistsEffect extends OneShotEffect { - public HeedTheMistsEffect() { - super(Outcome.DrawCard); - staticText = "Put the top card of your library into your graveyard, then draw cards equal to that card's converted mana cost"; - } + public HeedTheMistsEffect() { + super(Outcome.DrawCard); + staticText = "Put the top card of your library into your graveyard, then draw cards equal to that card's converted mana cost"; + } - public HeedTheMistsEffect(HeedTheMistsEffect effect) { - super(effect); - } + public HeedTheMistsEffect(HeedTheMistsEffect effect) { + super(effect); + } - @Override - public boolean apply(Game game, Ability source) { - boolean result = false; - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - Card card = player.getLibrary().removeFromTop(game); - if (card != null) { - int cmc = card.getManaCost().convertedManaCost(); - result = card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, true); - player.drawCards(cmc, game); - } - } - return result; + @Override + public boolean apply(Game game, Ability source) { + boolean result = false; + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Card card = controller.getLibrary().removeFromTop(game); + if (card != null) { + int cmc = card.getManaCost().convertedManaCost(); + controller.moveCardToGraveyardWithInfo(card, source.getSourceId(), game, Zone.LIBRARY); + controller.drawCards(cmc, game); + } } + return result; + } - @Override - public HeedTheMistsEffect copy() { - return new HeedTheMistsEffect(this); - } + @Override + public HeedTheMistsEffect copy() { + return new HeedTheMistsEffect(this); + } } } diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/ChargeAcrossTheAraba.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/ChargeAcrossTheAraba.java index 3eabd4590e..c5e9c0c6d1 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/ChargeAcrossTheAraba.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/ChargeAcrossTheAraba.java @@ -1,4 +1,4 @@ -/* + /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are @@ -30,8 +30,8 @@ package mage.sets.saviorsofkamigawa; import java.util.UUID; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.SweepNumber; -import mage.abilities.effects.keyword.SweepEffect; import mage.abilities.effects.common.continious.BoostControlledEffect; +import mage.abilities.effects.keyword.SweepEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/OboroEnvoy.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/OboroEnvoy.java new file mode 100644 index 0000000000..5000c71c9c --- /dev/null +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/OboroEnvoy.java @@ -0,0 +1,84 @@ +/* + * 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.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ReturnToHandTargetCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; +import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continious.BoostTargetEffect; +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.FilterControlledLandPermanent; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class OboroEnvoy extends CardImpl { + + public OboroEnvoy(UUID ownerId) { + super(ownerId, 49, "Oboro Envoy", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "SOK"; + this.subtype.add("Moonfolk"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {2}, Return a land you control to its owner's hand: Target creature gets -X/-0 until end of turn, where X is the number of cards in your hand. + Effect effect = new BoostTargetEffect(new SignInversionDynamicValue(new CardsInControllerHandCount()), new StaticValue(-0), Duration.EndOfTurn); + effect.setText("Target creature gets -X/-0 until end of turn, where X is the number of cards in your hand"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(2)); + ability.addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(new FilterControlledLandPermanent("a land")))); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public OboroEnvoy(final OboroEnvoy card) { + super(card); + } + + @Override + public OboroEnvoy copy() { + return new OboroEnvoy(this); + } +} diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/OppressiveWill.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/OppressiveWill.java new file mode 100644 index 0000000000..35a812dd6a --- /dev/null +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/OppressiveWill.java @@ -0,0 +1,112 @@ +/* + * 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.MageObject; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.stack.StackObject; +import mage.players.Player; +import mage.target.TargetSpell; + +/** + * + * @author LevelX2 + */ +public class OppressiveWill extends CardImpl { + + public OppressiveWill(UUID ownerId) { + super(ownerId, 50, "Oppressive Will", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{U}"); + this.expansionSetCode = "SOK"; + + // Counter target spell unless its controller pays {1} for each card in your hand. + this.getSpellAbility().addEffect(new SpellSyphonEffect()); + this.getSpellAbility().addTarget(new TargetSpell()); + } + + public OppressiveWill(final OppressiveWill card) { + super(card); + } + + @Override + public OppressiveWill copy() { + return new OppressiveWill(this); + } +} + +class SpellSyphonEffect extends OneShotEffect { + + public SpellSyphonEffect() { + super(Outcome.Benefit); + } + + public SpellSyphonEffect(final SpellSyphonEffect effect) { + super(effect); + } + + @Override + public SpellSyphonEffect copy() { + return new SpellSyphonEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + StackObject spell = game.getStack().getStackObject(targetPointer.getFirst(game, source)); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (sourceObject != null && spell != null) { + Player player = game.getPlayer(spell.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); + if (player != null && controller != null) { + int amount = controller.getHand().size(); + if (amount > 0) { + GenericManaCost cost = new GenericManaCost(amount); + if (!cost.pay(source, game, spell.getControllerId(), spell.getControllerId(), false)) { + game.informPlayers(sourceObject.getLogName() + ": cost wasn't payed - countering target spell."); + return game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); + } + } + return true; + } + } + return false; + } + + @Override + public String getText(Mode mode) { + return "Counter target spell unless its controller pays {1} for each card in your hand"; + } + +} diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/SakashimaTheImpostor.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SakashimaTheImpostor.java new file mode 100644 index 0000000000..5e769b0a00 --- /dev/null +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SakashimaTheImpostor.java @@ -0,0 +1,135 @@ +/* + * 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.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.EntersBattlefieldEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.TargetPermanent; +import mage.util.functions.ApplyToPermanent; + +/** + * + * @author LevelX2 + */ +public class SakashimaTheImpostor extends CardImpl { + + private static final String abilityText = "You may have {this} enter the battlefield as a copy of any creature on the battlefield, except its name is still Sakashima the Impostor, it's legendary in addition to its other types, and it gains \"{2}{U}{U}: Return Sakashima the Impostor to its owner's hand at the beginning of the next end step.\""; + + public SakashimaTheImpostor(UUID ownerId) { + super(ownerId, 53, "Sakashima the Impostor", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + this.expansionSetCode = "SOK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Rogue"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // You may have Sakashima the Impostor enter the battlefield as a copy of any creature on the battlefield, except its name is still Sakashima the Impostor, it's legendary in addition to its other types, and it gains "{2}{U}{U}: Return Sakashima the Impostor to its owner's hand at the beginning of the next end step." + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect( + new SakashimaTheImpostorCopyEffect(), abilityText, true)); + this.addAbility(ability); + } + + public SakashimaTheImpostor(final SakashimaTheImpostor card) { + super(card); + } + + @Override + public SakashimaTheImpostor copy() { + return new SakashimaTheImpostor(this); + } +} + +class SakashimaTheImpostorCopyEffect extends OneShotEffect { + + public SakashimaTheImpostorCopyEffect() { + super(Outcome.Copy); + } + + public SakashimaTheImpostorCopyEffect(final SakashimaTheImpostorCopyEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (player != null && sourcePermanent != null) { + Target target = new TargetPermanent(new FilterCreaturePermanent()); + target.setNotTarget(true); + if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { + player.choose(Outcome.Copy, target, source.getSourceId(), game); + Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget()); + if (copyFromPermanent != null) { + game.copyPermanent(copyFromPermanent, sourcePermanent, source, new ApplyToPermanent() { + @Override + public Boolean apply(Game game, Permanent permanent) { + if (!permanent.getSupertype().contains("Legendary")) { + permanent.getSubtype().add("Legendary"); + } + permanent.setName("Sakashima the Impostor"); + // {2}{U}{U}: Return Sakashima the Impostor to its owner's hand at the beginning of the next end step + permanent.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnToHandSourceEffect(true)), false), + new ManaCostsImpl("{2}{U}{U}") + ), game); + return true; + } + }); + + return true; + } + } + } + return false; + } + + @Override + public SakashimaTheImpostorCopyEffect copy() { + return new SakashimaTheImpostorCopyEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/ShiftingBorders.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/ShiftingBorders.java new file mode 100644 index 0000000000..056882c4b2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/ShiftingBorders.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.saviorsofkamigawa; + +import java.util.UUID; +import mage.abilities.effects.common.continious.ExchangeControlTargetEffect; +import mage.abilities.keyword.SpliceOntoArcaneAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LevelX2 + */ +public class ShiftingBorders extends CardImpl { + + public ShiftingBorders(UUID ownerId) { + super(ownerId, 56, "Shifting Borders", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{U}"); + this.expansionSetCode = "SOK"; + this.subtype.add("Arcane"); + + // Exchange control of two target lands. + this.getSpellAbility().addEffect(new ExchangeControlTargetEffect(Duration.EndOfGame, "Exchange control of two target lands")); + this.getSpellAbility().addTarget(new TargetLandPermanent(2)); + + // Splice onto Arcane {3}{U} + this.addAbility(new SpliceOntoArcaneAbility("{3}{U}")); + } + + public ShiftingBorders(final ShiftingBorders card) { + super(card); + } + + @Override + public ShiftingBorders copy() { + return new ShiftingBorders(this); + } +} diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/SoramaroFirstToDream.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SoramaroFirstToDream.java new file mode 100644 index 0000000000..f2fa8c08c1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SoramaroFirstToDream.java @@ -0,0 +1,86 @@ +/* + * 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.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.ReturnToHandTargetCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; +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.FilterControlledLandPermanent; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LevelX2 + */ +public class SoramaroFirstToDream extends CardImpl { + + public SoramaroFirstToDream(UUID ownerId) { + super(ownerId, 58, "Soramaro, First to Dream", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{U}{U}"); + this.expansionSetCode = "SOK"; + this.supertype.add("Legendary"); + this.subtype.add("Spirit"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Soramaro, First to Dream's power and toughness are each equal to the number of cards in your hand. + DynamicValue xValue= new CardsInControllerHandCount(); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame))); + + // {4}, Return a land you control to its owner's hand: Draw a card. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new DrawCardSourceControllerEffect(1), new GenericManaCost(4)); + ability.addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(new FilterControlledLandPermanent("a land")))); + this.addAbility(ability); + + } + + public SoramaroFirstToDream(final SoramaroFirstToDream card) { + super(card); + } + + @Override + public SoramaroFirstToDream copy() { + return new SoramaroFirstToDream(this); + } +} diff --git a/Mage/src/mage/abilities/dynamicvalue/common/SweepNumber.java b/Mage/src/mage/abilities/dynamicvalue/common/SweepNumber.java index 27ffa7d6e4..2f47aeab8d 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/SweepNumber.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/SweepNumber.java @@ -40,8 +40,8 @@ import mage.game.Game; public class SweepNumber implements DynamicValue { private int zoneChangeCounter = 0; - private String sweepSubtype; - private boolean previousZone; + private final String sweepSubtype; + private final boolean previousZone; public SweepNumber(String sweepSubtype, boolean previousZone) { this.sweepSubtype = sweepSubtype; @@ -62,7 +62,7 @@ public class SweepNumber implements DynamicValue { int number = 0; Integer sweepNumber = (Integer) game.getState().getValue(new StringBuilder("sweep").append(source.getSourceId()).append(zoneChangeCounter).toString()); if (sweepNumber != null) { - number = sweepNumber.intValue(); + number = sweepNumber; } return number; } @@ -79,6 +79,6 @@ public class SweepNumber implements DynamicValue { @Override public String getMessage() { - return new StringBuilder("the number of ").append(sweepSubtype).append("s returned this way").toString(); + return new StringBuilder("the number of ").append(sweepSubtype).append(sweepSubtype.endsWith("s") ? "":"s").append(" returned this way").toString(); } } diff --git a/Mage/src/mage/abilities/effects/common/LookLibraryControllerEffect.java b/Mage/src/mage/abilities/effects/common/LookLibraryControllerEffect.java index 87529bf822..fe2fa546ef 100644 --- a/Mage/src/mage/abilities/effects/common/LookLibraryControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/LookLibraryControllerEffect.java @@ -221,6 +221,9 @@ public class LookLibraryControllerEffect extends OneShotEffect { } public String setText(Mode mode, String middleText) { + if (staticText != null && !staticText.isEmpty()) { + return staticText; + } int numberLook; try { numberLook = Integer.parseInt(numberOfCards.toString()); diff --git a/Mage/src/mage/abilities/effects/keyword/SweepEffect.java b/Mage/src/mage/abilities/effects/keyword/SweepEffect.java index 610facfb70..01b1069355 100644 --- a/Mage/src/mage/abilities/effects/keyword/SweepEffect.java +++ b/Mage/src/mage/abilities/effects/keyword/SweepEffect.java @@ -48,12 +48,12 @@ import mage.util.CardUtil; */ public class SweepEffect extends OneShotEffect { - private String sweepSubtype; + private final String sweepSubtype; public SweepEffect(String sweepSubtype) { super(Outcome.Benefit); this.sweepSubtype = sweepSubtype; - this.staticText = new StringBuilder("Sweep - Return any number of ").append(sweepSubtype).append(sweepSubtype.endsWith("s")?"":"s").append(" you control to their owner's hand").toString(); + this.staticText = "Sweep - Return any number of "+ sweepSubtype + (sweepSubtype.endsWith("s") ? "":"s") + " you control to their owner's hand"; } public SweepEffect(final SweepEffect effect) { @@ -77,7 +77,7 @@ public class SweepEffect extends OneShotEffect { game.getState().setValue(CardUtil.getCardZoneString("sweep", source.getSourceId(), game), target.getTargets().size()); for (UUID uuid : target.getTargets()) { Permanent land = game.getPermanent(uuid); - land.moveToZone(Zone.HAND, source.getSourceId(), game, false); + controller.moveCardToHandWithInfo(land, source.getSourceId(), game, Zone.HAND); } } return true;