diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/BudokaGardener.java b/Mage.Sets/src/mage/sets/championsofkamigawa/BudokaGardener.java index a6c12bfaedc..fde7ab17a8d 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/BudokaGardener.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/BudokaGardener.java @@ -40,7 +40,6 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.FlipSourceEffect; import mage.abilities.effects.common.continious.BoostSourceEffect; -import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; @@ -49,12 +48,9 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.common.FilterLandCard; import mage.game.Game; import mage.game.permanent.token.Token; import mage.players.Player; -import mage.target.Target; -import mage.target.common.TargetCardInHand; /** * @author Loki @@ -73,7 +69,9 @@ public class BudokaGardener extends CardImpl { this.flipCardName = "Dokai, Weaver of Life"; // {T}: You may put a land card from your hand onto the battlefield. If you control ten or more lands, flip Budoka Gardener. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BudokaGardenerEffect(), new TapSourceCost())); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BudokaGardenerEffect(), new TapSourceCost()); + ability.addEffect(new BudokaGardenerEffect()); + this.addAbility(ability); } public BudokaGardener(final BudokaGardener card) { @@ -91,7 +89,7 @@ class BudokaGardenerEffect extends OneShotEffect { BudokaGardenerEffect() { super(Outcome.PutLandInPlay); - staticText = "You may put a land card from your hand onto the battlefield. If you control ten or more lands, flip {this}"; + staticText = "If you control ten or more lands, flip {this}"; } BudokaGardenerEffect(final BudokaGardenerEffect effect) { @@ -102,17 +100,6 @@ class BudokaGardenerEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - Target target = new TargetCardInHand(new FilterLandCard()); - target.setRequired(true); - target.setNotTarget(true); - if (target.canChoose(source.getSourceId(), source.getControllerId(), game) - && controller.chooseUse(outcome, "Put land onto the battlefield?", game) - && controller.chooseTarget(outcome, target, source, game)) { - Card card = game.getCard(target.getFirstTarget()); - if (card != null) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId()); - } - } if (game.getBattlefield().count(DokaiWeaverofLifeToken.filterLands, source.getSourceId(), source.getControllerId(), game) >= 10) { new FlipSourceEffect(new DokaiWeaverofLife()).apply(game, source); } diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/SakuraTribeScout.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SakuraTribeScout.java new file mode 100644 index 00000000000..fe67e7113c5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SakuraTribeScout.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.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.PutLandFromHandOntoBattlefieldEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterLandCard; +import mage.target.common.TargetCardInHand; + +/** + * + * @author LevelX2 + */ +public class SakuraTribeScout extends CardImpl { + + public SakuraTribeScout(UUID ownerId) { + super(ownerId, 144, "Sakura-Tribe Scout", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "SOK"; + this.subtype.add("Snake"); + this.subtype.add("Shaman"); + this.subtype.add("Scout"); + + this.color.setGreen(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: You may put a land card from your hand onto the battlefield. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutLandFromHandOntoBattlefieldEffect(), new TapSourceCost()); + ability.addTarget(new TargetCardInHand(new FilterLandCard())); + this.addAbility(ability); + } + + public SakuraTribeScout(final SakuraTribeScout card) { + super(card); + } + + @Override + public SakuraTribeScout copy() { + return new SakuraTribeScout(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/SkyshroudRanger.java b/Mage.Sets/src/mage/sets/tempest/SkyshroudRanger.java index 40887a587fa..be49a2db6c3 100644 --- a/Mage.Sets/src/mage/sets/tempest/SkyshroudRanger.java +++ b/Mage.Sets/src/mage/sets/tempest/SkyshroudRanger.java @@ -32,15 +32,12 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.ActivateAsSorceryActivatedAbility; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; +import mage.abilities.effects.common.PutLandFromHandOntoBattlefieldEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterLandCard; -import mage.game.Game; import mage.target.common.TargetCardInHand; /** @@ -59,7 +56,7 @@ public class SkyshroudRanger extends CardImpl { this.toughness = new MageInt(1); // {tap}: You may put a land card from your hand onto the battlefield. Activate this ability only any time you could cast a sorcery. - Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new SkyshroudRangerEffect(), new TapSourceCost()); + Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new PutLandFromHandOntoBattlefieldEffect(), new TapSourceCost()); ability.addTarget(new TargetCardInHand(0, 1, new FilterLandCard())); this.addAbility(ability); @@ -74,30 +71,3 @@ public class SkyshroudRanger extends CardImpl { return new SkyshroudRanger(this); } } - -class SkyshroudRangerEffect extends OneShotEffect { - - SkyshroudRangerEffect() { - super(Outcome.PutLandInPlay); - staticText = "You may put a land card from your hand onto the battlefield"; - } - - SkyshroudRangerEffect(final SkyshroudRangerEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Card card = game.getCard(targetPointer.getFirst(game, source)); - if (card != null) { - card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false); - } - return true; - } - - @Override - public SkyshroudRangerEffect copy() { - return new SkyshroudRangerEffect(this); - } - - } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/worldwake/WalkingAtlas.java b/Mage.Sets/src/mage/sets/worldwake/WalkingAtlas.java index b10bc27d2e2..21475d2e597 100644 --- a/Mage.Sets/src/mage/sets/worldwake/WalkingAtlas.java +++ b/Mage.Sets/src/mage/sets/worldwake/WalkingAtlas.java @@ -29,20 +29,16 @@ package mage.sets.worldwake; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; +import mage.abilities.effects.common.PutLandFromHandOntoBattlefieldEffect; import mage.cards.CardImpl; -import mage.constants.Outcome; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterLandCard; -import mage.game.Game; import mage.target.common.TargetCardInHand; /** @@ -57,7 +53,8 @@ public class WalkingAtlas extends CardImpl { this.subtype.add("Construct"); this.power = new MageInt(1); this.toughness = new MageInt(1); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new WalkingAtlasEffect(), new TapSourceCost()); + // {tap}: You may put a land card from your hand onto the battlefield. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutLandFromHandOntoBattlefieldEffect(), new TapSourceCost()); ability.addTarget(new TargetCardInHand(new FilterLandCard())); this.addAbility(ability); } @@ -72,30 +69,3 @@ public class WalkingAtlas extends CardImpl { } } - -class WalkingAtlasEffect extends OneShotEffect { - WalkingAtlasEffect() { - super(Outcome.PutLandInPlay); - staticText = "You may put a land card from your hand onto the battlefield"; - } - - WalkingAtlasEffect(final WalkingAtlasEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Card c = game.getCard(targetPointer.getFirst(game, source)); - if (c != null) { - c.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false); - return true; - } - return false; - } - - @Override - public WalkingAtlasEffect copy() { - return new WalkingAtlasEffect(this); - } - -} \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/PutLandFromHandOntoBattlefieldEffect.java b/Mage/src/mage/abilities/effects/common/PutLandFromHandOntoBattlefieldEffect.java new file mode 100644 index 00000000000..f21d7398621 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/PutLandFromHandOntoBattlefieldEffect.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.abilities.effects.common; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class PutLandFromHandOntoBattlefieldEffect extends OneShotEffect { + + public PutLandFromHandOntoBattlefieldEffect() { + super(Outcome.PutLandInPlay); + staticText = "You may put a land card from your hand onto the battlefield"; + } + + public PutLandFromHandOntoBattlefieldEffect(final PutLandFromHandOntoBattlefieldEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Card card = game.getCard(targetPointer.getFirst(game, source)); + if (card != null) { + controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId()); + } + return true; + + } + return false; + + } + + @Override + public PutLandFromHandOntoBattlefieldEffect copy() { + return new PutLandFromHandOntoBattlefieldEffect(this); + } + + } \ No newline at end of file