diff --git a/Mage.Sets/src/mage/sets/fifthedition/Millstone.java b/Mage.Sets/src/mage/sets/fifthedition/Millstone.java index 5c8862c8b1..8df11284bb 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Millstone.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Millstone.java @@ -28,7 +28,6 @@ package mage.sets.fifthedition; import java.util.UUID; -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.cards.CardImpl; @@ -37,11 +36,8 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.Constants.Zone; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.MillTargetEffect; import mage.target.TargetPlayer; -import mage.abilities.effects.OneShotEffect; -import mage.players.Player; -import mage.cards.Card; -import mage.game.Game; /** * @@ -54,7 +50,7 @@ public class Millstone extends CardImpl { this.expansionSetCode = "5ED"; // {2}, {tap}: Target player puts the top two cards of his or her library into his or her graveyard. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MillstoneEffect(2), new GenericManaCost(2)); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MillTargetEffect(2), new GenericManaCost(2)); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetPlayer()); this.addAbility(ability); @@ -68,42 +64,4 @@ public class Millstone extends CardImpl { public Millstone copy() { return new Millstone(this); } -} - -class MillstoneEffect extends OneShotEffect { - - int count = 0; - - public MillstoneEffect(final MillstoneEffect effect) { - super(effect); - this.count = effect.count; - } - - public MillstoneEffect(final int count) { - super(Constants.Outcome.Detriment); - this.count = count; - this.staticText = "Target player puts the top " + count + " cards of his or her library into his or her graveyard"; - } - - @Override - public boolean apply(Game game, Ability source) { - Player targetPlayer = game.getPlayer(source.getFirstTarget()); - if (targetPlayer != null) { - for (int i = 0; i { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("untapped Merfolk you control"); + + static { + filter.add(new SubtypePredicate("Merfolk")); + filter.add(Predicates.not(new TappedPredicate())); + } + + public DrownerOfSecrets(UUID ownerId) { + super(ownerId, 58, "Drowner of Secrets", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Merfolk"); + this.subtype.add("Wizard"); + + this.color.setBlue(true); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Tap an untapped Merfolk you control: Target player puts the top card of his or her library into his or her graveyard. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new MillTargetEffect(1), new TapTargetCost(new TargetControlledPermanent(filter))); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public DrownerOfSecrets(final DrownerOfSecrets card) { + super(card); + } + + @Override + public DrownerOfSecrets copy() { + return new DrownerOfSecrets(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/visions/AnvilOfBogardan.java b/Mage.Sets/src/mage/sets/visions/AnvilOfBogardan.java new file mode 100644 index 0000000000..3754d1ada0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/AnvilOfBogardan.java @@ -0,0 +1,98 @@ +/* + * 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.visions; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfDrawTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continious.MaximumHandSizeControllerEffect; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author jeffwadsworth + */ +public class AnvilOfBogardan extends CardImpl { + + public AnvilOfBogardan(UUID ownerId) { + super(ownerId, 141, "Anvil of Bogardan", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "VIS"; + + // Players have no maximum hand size. + Effect effect = new MaximumHandSizeControllerEffect(Integer.MAX_VALUE, Constants.Duration.WhileOnBattlefield, false, true); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect)); + + // At the beginning of each player's draw step, that player draws an additional card, then discards a card. + this.addAbility(new BeginningOfDrawTriggeredAbility(Constants.Zone.BATTLEFIELD, new AnvilOfBogardanEffect(), Constants.TargetController.ANY, false)); + } + + public AnvilOfBogardan(final AnvilOfBogardan card) { + super(card); + } + + @Override + public AnvilOfBogardan copy() { + return new AnvilOfBogardan(this); + } +} + +class AnvilOfBogardanEffect extends OneShotEffect { + + public AnvilOfBogardanEffect(final AnvilOfBogardanEffect effect) { + super(effect); + } + + public AnvilOfBogardanEffect() { + super(Constants.Outcome.Neutral); + staticText = "that player draws an additional card, then discards a card"; + } + + @Override + public boolean apply(Game game, Ability source) { + Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); + if (targetPlayer != null) { + targetPlayer.drawCards(1, game); + targetPlayer.discard(1, source, game); + return true; + } + return false; + } + + @Override + public AnvilOfBogardanEffect copy() { + return new AnvilOfBogardanEffect(this); + } +} diff --git a/Mage/src/mage/abilities/effects/common/MillTargetEffect.java b/Mage/src/mage/abilities/effects/common/MillTargetEffect.java new file mode 100644 index 0000000000..0dd8e2964a --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/MillTargetEffect.java @@ -0,0 +1,90 @@ +/* + * 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.Constants; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author jeff + */ + + +public class MillTargetEffect extends OneShotEffect { + + int count = 0; + + public MillTargetEffect(final MillTargetEffect effect) { + super(effect); + this.count = effect.count; + } + + public MillTargetEffect(final int count) { + super(Constants.Outcome.Detriment); + this.count = count; + getText(); + } + + @Override + public boolean apply(Game game, Ability source) { + Player targetPlayer = game.getPlayer(source.getFirstTarget()); + if (targetPlayer != null) { + for (int i = 0; i < count; i++) { + if (!targetPlayer.getLibrary().getCardList().isEmpty()) { + Card card = targetPlayer.getLibrary().removeFromTop(game); + if (card != null) { + card.moveToZone(Constants.Zone.GRAVEYARD, source.getId(), game, false); + } + } + } + return true; + } + return false; + } + + @Override + public MillTargetEffect copy() { + return new MillTargetEffect(this); + } + + private void getText() { + StringBuilder sb = new StringBuilder("Target player puts the top "); + if (count > 1) { + sb.append(count).append(" cards of his or her library into his or her graveyard"); + }else { + sb.append("card of his or her library into his or her graveyard"); + } + staticText = sb.toString(); + } +} diff --git a/Mage/src/mage/abilities/effects/common/continious/MaximumHandSizeControllerEffect.java b/Mage/src/mage/abilities/effects/common/continious/MaximumHandSizeControllerEffect.java index 8b1a398cdd..04a7a7ccda 100644 --- a/Mage/src/mage/abilities/effects/common/continious/MaximumHandSizeControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/MaximumHandSizeControllerEffect.java @@ -1,31 +1,30 @@ /* -* 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. -*/ - + * 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.continious; import mage.Constants.Duration; @@ -44,11 +43,13 @@ public class MaximumHandSizeControllerEffect extends ContinuousEffectImpl