From cb99dbd330626eea9c37a9f367b6a7dea2aefa7a Mon Sep 17 00:00:00 2001 From: mkalender Date: Tue, 23 Jun 2015 13:56:31 -0400 Subject: [PATCH 01/18] set filter on restriction effect --- Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java b/Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java index 4ae362d68d6..e614bae19e1 100644 --- a/Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java +++ b/Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java @@ -41,6 +41,9 @@ import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -73,6 +76,11 @@ public class TeferisMoat extends CardImpl { class TeferisMoatRestrictionEffect extends RestrictionEffect { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures without flying"); + static { + filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); + } + TeferisMoatRestrictionEffect(){ super(Duration.WhileOnBattlefield, Outcome.Benefit); staticText = "Creatures of the chosen color without flying can't attack you"; From 8357514142d72659344115642ed71f4ad98c1e26 Mon Sep 17 00:00:00 2001 From: mkalender Date: Tue, 23 Jun 2015 17:45:36 -0400 Subject: [PATCH 02/18] Revert "set filter on restriction effect" This reverts commit cb99dbd330626eea9c37a9f367b6a7dea2aefa7a. --- Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java b/Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java index e614bae19e1..4ae362d68d6 100644 --- a/Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java +++ b/Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java @@ -41,9 +41,6 @@ import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.AbilityPredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -76,11 +73,6 @@ public class TeferisMoat extends CardImpl { class TeferisMoatRestrictionEffect extends RestrictionEffect { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures without flying"); - static { - filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); - } - TeferisMoatRestrictionEffect(){ super(Duration.WhileOnBattlefield, Outcome.Benefit); staticText = "Creatures of the chosen color without flying can't attack you"; From 0b60b3750619ff4e8a0896ac3f5e7929605b59d7 Mon Sep 17 00:00:00 2001 From: mkalender Date: Tue, 23 Jun 2015 17:46:14 -0400 Subject: [PATCH 03/18] new card Mwonvulia Acid Moss --- .../sets/timespiral/MwonvuliAcidMoss.java | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/timespiral/MwonvuliAcidMoss.java diff --git a/Mage.Sets/src/mage/sets/timespiral/MwonvuliAcidMoss.java b/Mage.Sets/src/mage/sets/timespiral/MwonvuliAcidMoss.java new file mode 100644 index 00000000000..a3902e1aa77 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/MwonvuliAcidMoss.java @@ -0,0 +1,75 @@ +/* + * 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.timespiral; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author anonymous + */ +public class MwonvuliAcidMoss extends CardImpl { + + public MwonvuliAcidMoss(UUID ownerId) { + super(ownerId, 207, "Mwonvuli Acid-Moss", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{G}{G}"); + this.expansionSetCode = "TSP"; + + FilterPermanent filter = new FilterPermanent("land"); + filter.add(Predicates.and(new CardTypePredicate(CardType.LAND))); + + FilterCard filterForest = new FilterCard("a Forest card"); + filterForest.add(new SubtypePredicate("Forest")); + + // Destroy target land. Search your library for a Forest card and put that card onto the battlefield tapped. Then shuffle your library. + this.getSpellAbility().addEffect(new DestroyTargetEffect(true)); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filterForest), false, true)); + } + + public MwonvuliAcidMoss(final MwonvuliAcidMoss card) { + super(card); + } + + @Override + public MwonvuliAcidMoss copy() { + return new MwonvuliAcidMoss(this); + } +} + From d231ace13075e240c8d2cb689508394905c0c65d Mon Sep 17 00:00:00 2001 From: mkalender Date: Tue, 23 Jun 2015 13:56:31 -0400 Subject: [PATCH 04/18] set filter on restriction effect --- Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java b/Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java index e1edcb283c4..4fc0cf8e35c 100644 --- a/Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java +++ b/Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java @@ -41,6 +41,9 @@ import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -73,6 +76,11 @@ public class TeferisMoat extends CardImpl { class TeferisMoatRestrictionEffect extends RestrictionEffect { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures without flying"); + static { + filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); + } + TeferisMoatRestrictionEffect(){ super(Duration.WhileOnBattlefield, Outcome.Benefit); staticText = "Creatures of the chosen color without flying can't attack you"; @@ -100,4 +108,4 @@ class TeferisMoatRestrictionEffect extends RestrictionEffect { public TeferisMoatRestrictionEffect copy() { return new TeferisMoatRestrictionEffect(this); } -} \ No newline at end of file +} From 9bb10eb8c9c603a4fbce70262419f7be37805778 Mon Sep 17 00:00:00 2001 From: mkalender Date: Tue, 23 Jun 2015 17:45:36 -0400 Subject: [PATCH 05/18] Revert "set filter on restriction effect" This reverts commit cb99dbd330626eea9c37a9f367b6a7dea2aefa7a. --- Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java b/Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java index 4fc0cf8e35c..6348e83d0dd 100644 --- a/Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java +++ b/Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java @@ -41,9 +41,6 @@ import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.AbilityPredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -76,11 +73,6 @@ public class TeferisMoat extends CardImpl { class TeferisMoatRestrictionEffect extends RestrictionEffect { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures without flying"); - static { - filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); - } - TeferisMoatRestrictionEffect(){ super(Duration.WhileOnBattlefield, Outcome.Benefit); staticText = "Creatures of the chosen color without flying can't attack you"; From 271957a1a179faf69bb9981021e8f5c562f44f68 Mon Sep 17 00:00:00 2001 From: mkalender Date: Tue, 23 Jun 2015 17:46:14 -0400 Subject: [PATCH 06/18] new card Mwonvulia Acid Moss --- .../sets/timespiral/MwonvuliAcidMoss.java | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/timespiral/MwonvuliAcidMoss.java diff --git a/Mage.Sets/src/mage/sets/timespiral/MwonvuliAcidMoss.java b/Mage.Sets/src/mage/sets/timespiral/MwonvuliAcidMoss.java new file mode 100644 index 00000000000..a3902e1aa77 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/MwonvuliAcidMoss.java @@ -0,0 +1,75 @@ +/* + * 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.timespiral; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author anonymous + */ +public class MwonvuliAcidMoss extends CardImpl { + + public MwonvuliAcidMoss(UUID ownerId) { + super(ownerId, 207, "Mwonvuli Acid-Moss", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{G}{G}"); + this.expansionSetCode = "TSP"; + + FilterPermanent filter = new FilterPermanent("land"); + filter.add(Predicates.and(new CardTypePredicate(CardType.LAND))); + + FilterCard filterForest = new FilterCard("a Forest card"); + filterForest.add(new SubtypePredicate("Forest")); + + // Destroy target land. Search your library for a Forest card and put that card onto the battlefield tapped. Then shuffle your library. + this.getSpellAbility().addEffect(new DestroyTargetEffect(true)); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filterForest), false, true)); + } + + public MwonvuliAcidMoss(final MwonvuliAcidMoss card) { + super(card); + } + + @Override + public MwonvuliAcidMoss copy() { + return new MwonvuliAcidMoss(this); + } +} + From 9294bac4c2e0ac5a991356461226637bde5e05e0 Mon Sep 17 00:00:00 2001 From: Mark Date: Wed, 24 Jun 2015 11:15:22 -0400 Subject: [PATCH 07/18] Harvest Wurm implementation --- .../mage/sets/weatherlight/HarvestWurm.java | 66 ++++++++++++++ .../common/ReturnToHandFromGraveyardCost.java | 86 +++++++++++++++++++ 2 files changed, 152 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/weatherlight/HarvestWurm.java create mode 100644 Mage/src/mage/abilities/costs/common/ReturnToHandFromGraveyardCost.java diff --git a/Mage.Sets/src/mage/sets/weatherlight/HarvestWurm.java b/Mage.Sets/src/mage/sets/weatherlight/HarvestWurm.java new file mode 100644 index 00000000000..7b2c3be0442 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/HarvestWurm.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.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.common.ReturnToHandFromGraveyardCost; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterBasicLandCard; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author anonymous + */ +public class HarvestWurm extends CardImpl { + + public HarvestWurm(UUID ownerId) { + super(ownerId, 72, "Harvest Wurm", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Wurm"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // When Harvest Wurm enters the battlefield, sacrifice it unless you return a basic land card from your graveyard to your hand. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandFromGraveyardCost(new TargetCardInYourGraveyard(new FilterBasicLandCard()))))); + } + + public HarvestWurm(final HarvestWurm card) { + super(card); + } + + @Override + public HarvestWurm copy() { + return new HarvestWurm(this); + } +} diff --git a/Mage/src/mage/abilities/costs/common/ReturnToHandFromGraveyardCost.java b/Mage/src/mage/abilities/costs/common/ReturnToHandFromGraveyardCost.java new file mode 100644 index 00000000000..f73578adf39 --- /dev/null +++ b/Mage/src/mage/abilities/costs/common/ReturnToHandFromGraveyardCost.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.abilities.costs.common; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.CostImpl; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author BetaSteward_at_googlemail.com + */ +public class ReturnToHandFromGraveyardCost extends CostImpl { + + public ReturnToHandFromGraveyardCost(TargetCardInYourGraveyard target) { + this.addTarget(target); + if (target.getMaxNumberOfTargets() > 1 && target.getMaxNumberOfTargets() == target.getNumberOfTargets()) { + this.text = new StringBuilder("return ").append(target.getMaxNumberOfTargets()).append(" ").append(target.getTargetName()).append(" from graveyard to it's owner's hand").toString(); + } else { + this.text = new StringBuilder("return ").append(target.getTargetName()).append(" from graveyard to it's owner's hand").toString(); + } + } + public ReturnToHandFromGraveyardCost(ReturnToHandFromGraveyardCost cost) { + super(cost); + } + + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + Player controller = game.getPlayer(controllerId); + if (controller != null) { + if (targets.choose(Outcome.ReturnToHand, controllerId, sourceId, game)) { + for (UUID targetId: targets.get(0).getTargets()) { + mage.cards.Card targetCard = game.getCard(targetId); + if (targetCard == null) { + return false; + } + paid |= controller.moveCardToHandWithInfo(targetCard, sourceId, game, Zone.HAND); + } + } + } + return paid; + } + + @Override + public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { + return targets.canChoose(controllerId, game); + } + + @Override + public ReturnToHandFromGraveyardCost copy() { + return new ReturnToHandFromGraveyardCost(this); + } + +} From e35a7b2f364ddb1c9fc013f3631f03f4d2a7acb5 Mon Sep 17 00:00:00 2001 From: Mark Date: Thu, 25 Jun 2015 21:05:39 -0400 Subject: [PATCH 08/18] new cards Barbed Shocker ,Cabal Slaver, Shoker added new DiscardHandAndDrawEffect --- .../mage/sets/conspiracy/BarbedShocker.java | 70 +++++++++++++++ .../src/mage/sets/onslaught/CabalSlaver.java | 66 ++++++++++++++ Mage.Sets/src/mage/sets/tempest/Shocker.java | 64 +++++++++++++ .../mage/sets/timespiral/BarbedShocker.java | 52 +++++++++++ .../discard/DiscardHandAndDrawEffect.java | 89 +++++++++++++++++++ 5 files changed, 341 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/conspiracy/BarbedShocker.java create mode 100644 Mage.Sets/src/mage/sets/onslaught/CabalSlaver.java create mode 100644 Mage.Sets/src/mage/sets/tempest/Shocker.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/BarbedShocker.java create mode 100644 Mage/src/mage/abilities/effects/common/discard/DiscardHandAndDrawEffect.java diff --git a/Mage.Sets/src/mage/sets/conspiracy/BarbedShocker.java b/Mage.Sets/src/mage/sets/conspiracy/BarbedShocker.java new file mode 100644 index 00000000000..bc47168738b --- /dev/null +++ b/Mage.Sets/src/mage/sets/conspiracy/BarbedShocker.java @@ -0,0 +1,70 @@ +/* + * 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.conspiracy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.common.discard.DiscardHandAndDrawEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author anonymous + */ +public class BarbedShocker extends CardImpl { + + public BarbedShocker(UUID ownerId) { + super(ownerId, 136, "Barbed Shocker", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "CNS"; + this.subtype.add("Insect"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Haste + this.addAbility(HasteAbility.getInstance()); + // Whenever Barbed Shocker deals damage to a player, that player discards all the cards in his or her hand, then draws that many cards. + this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new DiscardHandAndDrawEffect(TargetController.OPPONENT), false, true)); + } + + public BarbedShocker(final BarbedShocker card) { + super(card); + } + + @Override + public BarbedShocker copy() { + return new BarbedShocker(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/onslaught/CabalSlaver.java b/Mage.Sets/src/mage/sets/onslaught/CabalSlaver.java new file mode 100644 index 00000000000..9b3ee5a8b82 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/CabalSlaver.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.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.common.discard.DiscardHandAndDrawEffect; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author anonymous + */ +public class CabalSlaver extends CardImpl { + + public CabalSlaver(UUID ownerId) { + super(ownerId, 131, "Cabal Slaver", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Whenever a Goblin deals combat damage to a player, that player discards a card. + this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new DiscardTargetEffect(1), false, true)); + } + + public CabalSlaver(final CabalSlaver card) { + super(card); + } + + @Override + public CabalSlaver copy() { + return new CabalSlaver(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/Shocker.java b/Mage.Sets/src/mage/sets/tempest/Shocker.java new file mode 100644 index 00000000000..fe32c73bab3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/Shocker.java @@ -0,0 +1,64 @@ +/* + * 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.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.common.discard.DiscardHandAndDrawEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author anonymous + */ +public class Shocker extends CardImpl { + + public Shocker(UUID ownerId) { + super(ownerId, 204, "Shocker", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Insect"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever Shocker deals damage to a player, that player discards all the cards in his or her hand, then draws that many cards. + this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new DiscardHandAndDrawEffect(TargetController.OPPONENT), false, true)); + } + + public Shocker(final Shocker card) { + super(card); + } + + @Override + public Shocker copy() { + return new Shocker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/BarbedShocker.java b/Mage.Sets/src/mage/sets/timespiral/BarbedShocker.java new file mode 100644 index 00000000000..fe57ec4b632 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/BarbedShocker.java @@ -0,0 +1,52 @@ +/* + * 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.timespiral; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class BarbedShocker extends mage.sets.conspiracy.BarbedShocker { + + public BarbedShocker(UUID ownerId) { + super(ownerId); + this.cardNumber = 144; + this.expansionSetCode = "TSP"; + } + + public BarbedShocker(final BarbedShocker card) { + super(card); + } + + @Override + public BarbedShocker copy() { + return new BarbedShocker(this); + } +} diff --git a/Mage/src/mage/abilities/effects/common/discard/DiscardHandAndDrawEffect.java b/Mage/src/mage/abilities/effects/common/discard/DiscardHandAndDrawEffect.java new file mode 100644 index 00000000000..322d613dcc7 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/discard/DiscardHandAndDrawEffect.java @@ -0,0 +1,89 @@ +/* + * 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.discard; + +import java.util.Set; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.constants.Outcome; +import mage.constants.TargetController; +import mage.game.Game; +import mage.players.Player; + +/** + * @author mluds + */ +public class DiscardHandAndDrawEffect extends OneShotEffect { + + private int CardDrawOffset = 0; + public DiscardHandAndDrawEffect(TargetController targetController) { + this(targetController,0); + } + public DiscardHandAndDrawEffect(TargetController targetController, int cardDrawOffset) { + super(Outcome.Discard); + String PostText = ""; + if (cardDrawOffset >0){ + PostText = " plus " + cardDrawOffset; + }else if(cardDrawOffset < 0){ + PostText = " minus " + cardDrawOffset; + } + this.CardDrawOffset = cardDrawOffset; + switch(targetController) { + case OPPONENT: + this.staticText = "Opponent discards his hand then draws that many cards" + PostText; + break; + case YOU: + this.staticText = "Discard your hand then draws that many cards" + PostText; + break; + } + } + + public DiscardHandAndDrawEffect(final DiscardHandAndDrawEffect effect) { + super(effect); + } + + @Override + public DiscardHandAndDrawEffect copy() { + return new DiscardHandAndDrawEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + if (player != null) { + Set cards = player.getHand().getCards(game); + int count = cards.size(); + for (Card card : cards) { + player.discard(card, source, game); + } + player.drawCards(count + this.CardDrawOffset, game); + } + return true; + } +} From f3f48496381199283d1752d3b3cc5f42fd14c8c7 Mon Sep 17 00:00:00 2001 From: Mark Date: Thu, 2 Jul 2015 15:14:45 -0400 Subject: [PATCH 09/18] fixed Barbed Shocker ,Cabal Slaver, Shoker removed DiscardHandAndDrawEffect added author name --- .../mage/sets/conspiracy/BarbedShocker.java | 42 ++++++++- .../src/mage/sets/onslaught/CabalSlaver.java | 16 ++-- Mage.Sets/src/mage/sets/tempest/Shocker.java | 41 ++++++++- .../mage/sets/timespiral/BarbedShocker.java | 2 +- .../sets/timespiral/MwonvuliAcidMoss.java | 16 ++-- .../mage/sets/weatherlight/HarvestWurm.java | 2 +- .../common/ReturnToHandFromGraveyardCost.java | 2 +- .../discard/DiscardHandAndDrawEffect.java | 89 ------------------- 8 files changed, 97 insertions(+), 113 deletions(-) delete mode 100644 Mage/src/mage/abilities/effects/common/discard/DiscardHandAndDrawEffect.java diff --git a/Mage.Sets/src/mage/sets/conspiracy/BarbedShocker.java b/Mage.Sets/src/mage/sets/conspiracy/BarbedShocker.java index bc47168738b..0fb985c6562 100644 --- a/Mage.Sets/src/mage/sets/conspiracy/BarbedShocker.java +++ b/Mage.Sets/src/mage/sets/conspiracy/BarbedShocker.java @@ -27,20 +27,26 @@ */ package mage.sets.conspiracy; +import java.util.Set; import java.util.UUID; import mage.MageInt; +import mage.abilities.Ability; import mage.abilities.common.DealsDamageToAPlayerTriggeredAbility; -import mage.abilities.effects.common.discard.DiscardHandAndDrawEffect; +import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.TrampleAbility; import mage.abilities.keyword.HasteAbility; +import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; +import mage.game.Game; +import mage.players.Player; /** * - * @author anonymous + * @author markedagain */ public class BarbedShocker extends CardImpl { @@ -56,7 +62,7 @@ public class BarbedShocker extends CardImpl { // Haste this.addAbility(HasteAbility.getInstance()); // Whenever Barbed Shocker deals damage to a player, that player discards all the cards in his or her hand, then draws that many cards. - this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new DiscardHandAndDrawEffect(TargetController.OPPONENT), false, true)); + this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new BarbedShockerEffect(), false, true)); } public BarbedShocker(final BarbedShocker card) { @@ -67,4 +73,34 @@ public class BarbedShocker extends CardImpl { public BarbedShocker copy() { return new BarbedShocker(this); } +} +class BarbedShockerEffect extends OneShotEffect { + + public BarbedShockerEffect() { + super(Outcome.Discard); + this.staticText = " that player discards all the cards in his or her hand, then draws that many cards"; + } + + public BarbedShockerEffect(final BarbedShockerEffect effect) { + super(effect); + } + + @Override + public BarbedShockerEffect copy() { + return new BarbedShockerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); + if (targetPlayer != null) { + int count = targetPlayer.getHand().size(); + for (Card card : targetPlayer.getHand().getCards(game)) { + targetPlayer.discard(card, source, game); + } + targetPlayer.drawCards(count, game); + return false; + } + return true; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/onslaught/CabalSlaver.java b/Mage.Sets/src/mage/sets/onslaught/CabalSlaver.java index 9b3ee5a8b82..ac9da8f9eae 100644 --- a/Mage.Sets/src/mage/sets/onslaught/CabalSlaver.java +++ b/Mage.Sets/src/mage/sets/onslaught/CabalSlaver.java @@ -29,19 +29,25 @@ package mage.sets.onslaught; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.DealsDamageToAPlayerTriggeredAbility; -import mage.abilities.effects.common.discard.DiscardHandAndDrawEffect; +import mage.abilities.common.DealsDamageToAPlayerAllTriggeredAbility; import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.constants.TargetController; +import mage.constants.SetTargetPointer; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * - * @author anonymous + * @author markedagain */ public class CabalSlaver extends CardImpl { + private static final FilterPermanent filter = new FilterPermanent("Goblin"); + + static { + filter.add(new SubtypePredicate("Goblin")); + } public CabalSlaver(UUID ownerId) { super(ownerId, 131, "Cabal Slaver", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); @@ -52,7 +58,7 @@ public class CabalSlaver extends CardImpl { this.toughness = new MageInt(1); // Whenever a Goblin deals combat damage to a player, that player discards a card. - this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new DiscardTargetEffect(1), false, true)); + this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(new DiscardTargetEffect(1),filter, false, SetTargetPointer.NONE, true)); } public CabalSlaver(final CabalSlaver card) { diff --git a/Mage.Sets/src/mage/sets/tempest/Shocker.java b/Mage.Sets/src/mage/sets/tempest/Shocker.java index fe32c73bab3..4ed38a71f35 100644 --- a/Mage.Sets/src/mage/sets/tempest/Shocker.java +++ b/Mage.Sets/src/mage/sets/tempest/Shocker.java @@ -29,16 +29,21 @@ package mage.sets.tempest; import java.util.UUID; import mage.MageInt; +import mage.abilities.Ability; import mage.abilities.common.DealsDamageToAPlayerTriggeredAbility; -import mage.abilities.effects.common.discard.DiscardHandAndDrawEffect; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; +import mage.game.Game; +import mage.players.Player; /** * - * @author anonymous + * @author markedagain */ public class Shocker extends CardImpl { @@ -50,7 +55,7 @@ public class Shocker extends CardImpl { this.toughness = new MageInt(1); // Whenever Shocker deals damage to a player, that player discards all the cards in his or her hand, then draws that many cards. - this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new DiscardHandAndDrawEffect(TargetController.OPPONENT), false, true)); + this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new ShockerEffect(), false, true)); } public Shocker(final Shocker card) { @@ -62,3 +67,33 @@ public class Shocker extends CardImpl { return new Shocker(this); } } +class ShockerEffect extends OneShotEffect { + + public ShockerEffect() { + super(Outcome.Discard); + this.staticText = " that player discards all the cards in his or her hand, then draws that many cards"; + } + + public ShockerEffect(final ShockerEffect effect) { + super(effect); + } + + @Override + public ShockerEffect copy() { + return new ShockerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); + if (targetPlayer != null) { + int count = targetPlayer.getHand().size(); + for (Card card : targetPlayer.getHand().getCards(game)) { + targetPlayer.discard(card, source, game); + } + targetPlayer.drawCards(count, game); + return false; + } + return true; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/timespiral/BarbedShocker.java b/Mage.Sets/src/mage/sets/timespiral/BarbedShocker.java index fe57ec4b632..28587af3873 100644 --- a/Mage.Sets/src/mage/sets/timespiral/BarbedShocker.java +++ b/Mage.Sets/src/mage/sets/timespiral/BarbedShocker.java @@ -31,7 +31,7 @@ import java.util.UUID; /** * - * @author anonymous + * @author markedagain */ public class BarbedShocker extends mage.sets.conspiracy.BarbedShocker { diff --git a/Mage.Sets/src/mage/sets/timespiral/MwonvuliAcidMoss.java b/Mage.Sets/src/mage/sets/timespiral/MwonvuliAcidMoss.java index a3902e1aa77..7bb54c0dd5b 100644 --- a/Mage.Sets/src/mage/sets/timespiral/MwonvuliAcidMoss.java +++ b/Mage.Sets/src/mage/sets/timespiral/MwonvuliAcidMoss.java @@ -33,33 +33,29 @@ import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.filter.FilterCard; -import mage.filter.FilterPermanent; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.common.FilterBasicLandCard; +import mage.filter.common.FilterLandCard; +import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPermanent; import mage.target.common.TargetCardInLibrary; /** * - * @author anonymous + * @author markedagain */ public class MwonvuliAcidMoss extends CardImpl { public MwonvuliAcidMoss(UUID ownerId) { super(ownerId, 207, "Mwonvuli Acid-Moss", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{G}{G}"); this.expansionSetCode = "TSP"; - - FilterPermanent filter = new FilterPermanent("land"); - filter.add(Predicates.and(new CardTypePredicate(CardType.LAND))); - FilterCard filterForest = new FilterCard("a Forest card"); + FilterLandCard filterForest = new FilterLandCard(); filterForest.add(new SubtypePredicate("Forest")); // Destroy target land. Search your library for a Forest card and put that card onto the battlefield tapped. Then shuffle your library. this.getSpellAbility().addEffect(new DestroyTargetEffect(true)); - this.getSpellAbility().addTarget(new TargetPermanent(filter)); + this.getSpellAbility().addTarget(new TargetPermanent(new FilterLandPermanent())); this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filterForest), false, true)); } diff --git a/Mage.Sets/src/mage/sets/weatherlight/HarvestWurm.java b/Mage.Sets/src/mage/sets/weatherlight/HarvestWurm.java index 7b2c3be0442..075ebcb48e0 100644 --- a/Mage.Sets/src/mage/sets/weatherlight/HarvestWurm.java +++ b/Mage.Sets/src/mage/sets/weatherlight/HarvestWurm.java @@ -40,7 +40,7 @@ import mage.target.common.TargetCardInYourGraveyard; /** * - * @author anonymous + * @author markedagain */ public class HarvestWurm extends CardImpl { diff --git a/Mage/src/mage/abilities/costs/common/ReturnToHandFromGraveyardCost.java b/Mage/src/mage/abilities/costs/common/ReturnToHandFromGraveyardCost.java index f73578adf39..91b85072c9a 100644 --- a/Mage/src/mage/abilities/costs/common/ReturnToHandFromGraveyardCost.java +++ b/Mage/src/mage/abilities/costs/common/ReturnToHandFromGraveyardCost.java @@ -40,7 +40,7 @@ import mage.target.common.TargetCardInYourGraveyard; /** * - * @author BetaSteward_at_googlemail.com + * @author markedagain */ public class ReturnToHandFromGraveyardCost extends CostImpl { diff --git a/Mage/src/mage/abilities/effects/common/discard/DiscardHandAndDrawEffect.java b/Mage/src/mage/abilities/effects/common/discard/DiscardHandAndDrawEffect.java deleted file mode 100644 index 322d613dcc7..00000000000 --- a/Mage/src/mage/abilities/effects/common/discard/DiscardHandAndDrawEffect.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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.discard; - -import java.util.Set; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; -import mage.constants.Outcome; -import mage.constants.TargetController; -import mage.game.Game; -import mage.players.Player; - -/** - * @author mluds - */ -public class DiscardHandAndDrawEffect extends OneShotEffect { - - private int CardDrawOffset = 0; - public DiscardHandAndDrawEffect(TargetController targetController) { - this(targetController,0); - } - public DiscardHandAndDrawEffect(TargetController targetController, int cardDrawOffset) { - super(Outcome.Discard); - String PostText = ""; - if (cardDrawOffset >0){ - PostText = " plus " + cardDrawOffset; - }else if(cardDrawOffset < 0){ - PostText = " minus " + cardDrawOffset; - } - this.CardDrawOffset = cardDrawOffset; - switch(targetController) { - case OPPONENT: - this.staticText = "Opponent discards his hand then draws that many cards" + PostText; - break; - case YOU: - this.staticText = "Discard your hand then draws that many cards" + PostText; - break; - } - } - - public DiscardHandAndDrawEffect(final DiscardHandAndDrawEffect effect) { - super(effect); - } - - @Override - public DiscardHandAndDrawEffect copy() { - return new DiscardHandAndDrawEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - if (player != null) { - Set cards = player.getHand().getCards(game); - int count = cards.size(); - for (Card card : cards) { - player.discard(card, source, game); - } - player.drawCards(count + this.CardDrawOffset, game); - } - return true; - } -} From 7146b0b02759f8ed553a58dd1ffafadf2393b1e1 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 6 Jul 2015 19:49:13 +0200 Subject: [PATCH 10/18] * Fixed wrong text for becomes renown triggered effect. --- .../common/BecomesRenownSourceTriggeredAbility.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Mage/src/mage/abilities/common/BecomesRenownSourceTriggeredAbility.java b/Mage/src/mage/abilities/common/BecomesRenownSourceTriggeredAbility.java index 0864328cee7..44ae09a0f2b 100644 --- a/Mage/src/mage/abilities/common/BecomesRenownSourceTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/BecomesRenownSourceTriggeredAbility.java @@ -15,7 +15,6 @@ import mage.game.events.GameEvent; * * @author LevelX2 */ - public class BecomesRenownSourceTriggeredAbility extends TriggeredAbilityImpl { private int renownValue; @@ -54,6 +53,6 @@ public class BecomesRenownSourceTriggeredAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return "When {this} becomes monstrous, " + super.getRule(); + return "When {this} becomes renown, " + super.getRule(); } -} \ No newline at end of file +} From 6e5acee2dc1aca53d0985effeaa620349207c983 Mon Sep 17 00:00:00 2001 From: Wehk Date: Mon, 6 Jul 2015 21:53:22 +0200 Subject: [PATCH 11/18] Avatar test Testing access to a "normal" avatar that is not added to "available_avatars". Can't test name cases in local build. --- Mage.Server/src/main/java/mage/server/Session.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Mage.Server/src/main/java/mage/server/Session.java b/Mage.Server/src/main/java/mage/server/Session.java index 4d6368fae2e..c705ffd740a 100644 --- a/Mage.Server/src/main/java/mage/server/Session.java +++ b/Mage.Server/src/main/java/mage/server/Session.java @@ -181,6 +181,8 @@ public class Session { return 1018; case "Bandit": return 1020; + case "Wehk": + return 66; } return 51; } From 512ea669c2e7c707889feae8e2c89ecd3febc9e6 Mon Sep 17 00:00:00 2001 From: Wehk Date: Mon, 6 Jul 2015 23:24:50 +0200 Subject: [PATCH 12/18] Added card: Dryad's Caress --- .../src/mage/sets/ravnica/DryadsCaress.java | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/ravnica/DryadsCaress.java diff --git a/Mage.Sets/src/mage/sets/ravnica/DryadsCaress.java b/Mage.Sets/src/mage/sets/ravnica/DryadsCaress.java new file mode 100644 index 00000000000..0e7052ceda0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnica/DryadsCaress.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.ravnica; + +import java.util.UUID; +import mage.abilities.condition.common.ManaWasSpentCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.UntapAllControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author Wehk + */ +public class DryadsCaress extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature on the battlefield"); + private static final String rule = "untap all creatures you control"; + + public DryadsCaress(UUID ownerId) { + super(ownerId, 160, "Dryad's Caress", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{4}{G}{G}"); + this.expansionSetCode = "RAV"; + + // You gain 1 life for each creature on the battlefield. + + this.getSpellAbility().addEffect(new GainLifeEffect(new PermanentsOnBattlefieldCount(filter))); + + //If {W} was spent to cast Dryad's Caress, untap all creatures you control. + this.getSpellAbility().addEffect(new ConditionalOneShotEffect( + new UntapAllControllerEffect(new FilterControlledCreaturePermanent(), rule), + new ManaWasSpentCondition(ColoredManaSymbol.W), "If {W} was spent to cast {this}, untap all creatures you control")); + } + + public DryadsCaress(final DryadsCaress card) { + super(card); + } + + @Override + public DryadsCaress copy() { + return new DryadsCaress(this); + } +} From 5c3deaa13a4e0ee0ebf4d747fdab0916462b16c2 Mon Sep 17 00:00:00 2001 From: Wehk Date: Mon, 6 Jul 2015 23:25:16 +0200 Subject: [PATCH 13/18] Added card: Golgari Germination --- .../mage/sets/ravnica/GolgariGermination.java | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/ravnica/GolgariGermination.java diff --git a/Mage.Sets/src/mage/sets/ravnica/GolgariGermination.java b/Mage.Sets/src/mage/sets/ravnica/GolgariGermination.java new file mode 100644 index 00000000000..c4c3cde7ba2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnica/GolgariGermination.java @@ -0,0 +1,72 @@ +/* + * 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.ravnica; + +import java.util.UUID; +import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.filter.predicate.permanent.TokenPredicate; +import mage.game.permanent.token.SaprolingToken; + +/** + * + * @author Wehk + */ +public class GolgariGermination extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nontoken creature you control"); + + static { + filter.add(new ControllerPredicate(TargetController.YOU)); + filter.add(Predicates.not(new TokenPredicate())); + } + + public GolgariGermination(UUID ownerId) { + super(ownerId, 209, "Golgari Germination", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}{G}"); + this.expansionSetCode = "RAV"; + + // Whenever a nontoken creature you control dies, put a 1/1 green Saproling creature token onto the battlefield. + this.addAbility(new DiesCreatureTriggeredAbility(new CreateTokenEffect(new SaprolingToken()), false, filter)); + } + + public GolgariGermination(final GolgariGermination card) { + super(card); + } + + @Override + public GolgariGermination copy() { + return new GolgariGermination(this); + } +} From 35b470d370c966fda0f6ed41273527d8202678ad Mon Sep 17 00:00:00 2001 From: Wehk Date: Mon, 6 Jul 2015 23:25:47 +0200 Subject: [PATCH 14/18] Added card: Stone-Seeder Hierophant --- .../sets/ravnica/StoneSeederHierophant.java | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/ravnica/StoneSeederHierophant.java diff --git a/Mage.Sets/src/mage/sets/ravnica/StoneSeederHierophant.java b/Mage.Sets/src/mage/sets/ravnica/StoneSeederHierophant.java new file mode 100644 index 00000000000..b6aeee6f40c --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnica/StoneSeederHierophant.java @@ -0,0 +1,78 @@ +/* + * 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.ravnica; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterLandPermanent; +import mage.target.Target; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author Wehk + */ +public class StoneSeederHierophant extends CardImpl { + + public StoneSeederHierophant(UUID ownerId) { + super(ownerId, 184, "Stone-Seeder Hierophant", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "RAV"; + this.subtype.add("Human"); + this.subtype.add("Druid"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever a land enters the battlefield under your control, untap Stone-Seeder Hierophant. + this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new UntapSourceEffect(), new FilterLandPermanent("a land"), false)); + + // {tap}: Untap target land. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new TapSourceCost()); + Target target = new TargetLandPermanent(); + ability.addTarget(target); + this.addAbility(ability); + } + + public StoneSeederHierophant(final StoneSeederHierophant card) { + super(card); + } + + @Override + public StoneSeederHierophant copy() { + return new StoneSeederHierophant(this); + } +} From 0173325a984d4a7a5b12bbf4742980c62c0be17c Mon Sep 17 00:00:00 2001 From: Wehk Date: Mon, 6 Jul 2015 23:26:11 +0200 Subject: [PATCH 15/18] Added card: Seed Spark --- .../src/mage/sets/ravnica/SeedSpark.java | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/ravnica/SeedSpark.java diff --git a/Mage.Sets/src/mage/sets/ravnica/SeedSpark.java b/Mage.Sets/src/mage/sets/ravnica/SeedSpark.java new file mode 100644 index 00000000000..0818865d24d --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnica/SeedSpark.java @@ -0,0 +1,71 @@ +/* + * 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.ravnica; + +import java.util.UUID; +import mage.abilities.condition.common.ManaWasSpentCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Rarity; +import mage.filter.common.FilterArtifactOrEnchantmentPermanent; +import mage.game.permanent.token.SaprolingToken; +import mage.target.TargetPermanent; +import mage.abilities.effects.common.CreateTokenEffect; + +/** + * + * @author Wehk + */ +public class SeedSpark extends CardImpl { + + public SeedSpark(UUID ownerId) { + super(ownerId, 30, "Seed Spark", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{W}"); + this.expansionSetCode = "RAV"; + + // Destroy target artifact or enchantment. + this.getSpellAbility().addTarget(new TargetPermanent(new FilterArtifactOrEnchantmentPermanent())); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + + //If {G} was spent to cast Seed Spark, put two 1/1 green Saproling creature tokens onto the battlefield. + this.getSpellAbility().addEffect(new ConditionalOneShotEffect( + new CreateTokenEffect(new SaprolingToken(), 2), + new ManaWasSpentCondition(ColoredManaSymbol.G), "If {G} was spent to cast {this}, put two 1/1 green Saproling creature tokens onto the battlefield")); + } + + public SeedSpark(final SeedSpark card) { + super(card); + } + + @Override + public SeedSpark copy() { + return new SeedSpark(this); + } +} From aca92886307b0b7e5c2284e034ca22160d284612 Mon Sep 17 00:00:00 2001 From: Wehk Date: Mon, 6 Jul 2015 23:26:47 +0200 Subject: [PATCH 16/18] Added card: Hour Of Reckoning --- .../mage/sets/ravnica/HourOfReckoning.java | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/ravnica/HourOfReckoning.java diff --git a/Mage.Sets/src/mage/sets/ravnica/HourOfReckoning.java b/Mage.Sets/src/mage/sets/ravnica/HourOfReckoning.java new file mode 100644 index 00000000000..523d5581683 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnica/HourOfReckoning.java @@ -0,0 +1,73 @@ +/* + * 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.ravnica; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.abilities.keyword.ConvokeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.permanent.TokenPredicate; + +/** + * + * @author Wehk + */ +public class HourOfReckoning extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nontoken creature"); + + static { + filter.add(Predicates.not(new TokenPredicate())); + } + + public HourOfReckoning(UUID ownerId) { + super(ownerId, 21, "Hour of Reckoning", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{W}{W}{W}"); + this.expansionSetCode = "RAV"; + + // Convoke + this.addAbility(new ConvokeAbility()); + + // Destroy all nontoken creatures. + this.getSpellAbility().addEffect(new DestroyAllEffect(filter)); + } + + public HourOfReckoning(final HourOfReckoning card) { + super(card); + } + + @Override + public HourOfReckoning copy() { + return new HourOfReckoning(this); + } +} From 134809ea5ad9e8077fbdbc7e8dee8bbc9000b360 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 7 Jul 2015 00:29:56 +0200 Subject: [PATCH 17/18] * Dark Dabbling - Fixed the missing card draw effect. --- Mage.Sets/src/mage/sets/magicorigins/DarkDabbling.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Mage.Sets/src/mage/sets/magicorigins/DarkDabbling.java b/Mage.Sets/src/mage/sets/magicorigins/DarkDabbling.java index f8b734832f8..43b0d5783e5 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/DarkDabbling.java +++ b/Mage.Sets/src/mage/sets/magicorigins/DarkDabbling.java @@ -31,6 +31,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.condition.common.SpellMasteryCondition; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.RegenerateTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -53,6 +54,7 @@ public class DarkDabbling extends CardImpl { // Regenerate target creature. Draw a card. this.getSpellAbility().addEffect(new RegenerateTargetEffect()); + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); // Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, also regenerate each other creature you control. this.getSpellAbility().addEffect(new DarkDabblingEffect()); From 31c225373e34c51f302168343ecb0ef7ef66d4b0 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 7 Jul 2015 00:31:34 +0200 Subject: [PATCH 18/18] * Infectious Bloodlust - Fixed handling of attack requirement. --- .../mage/sets/magicorigins/InfectiousBloodlust.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Mage.Sets/src/mage/sets/magicorigins/InfectiousBloodlust.java b/Mage.Sets/src/mage/sets/magicorigins/InfectiousBloodlust.java index 56631e05d85..219311c74be 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/InfectiousBloodlust.java +++ b/Mage.Sets/src/mage/sets/magicorigins/InfectiousBloodlust.java @@ -29,11 +29,11 @@ package mage.sets.magicorigins; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.common.AttacksEachTurnStaticAbility; import mage.abilities.common.DiesAttachedTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.combat.AttacksIfAbleAttachedEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; @@ -42,6 +42,7 @@ import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.constants.AttachmentType; import mage.constants.CardType; +import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; @@ -56,7 +57,7 @@ import mage.target.common.TargetCreaturePermanent; * @author fireshoes */ public class InfectiousBloodlust extends CardImpl { - + private static final FilterCard filter = new FilterCard("card named Infectious Bloodlust"); static { @@ -74,7 +75,7 @@ public class InfectiousBloodlust extends CardImpl { this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); - + // Enchanted creature gets +2/+1, has haste, and attacks each turn if able. Effect effect = new BoostEnchantedEffect(2, 1); effect.setText("Enchanted creature gets +2/+1"); @@ -82,11 +83,12 @@ public class InfectiousBloodlust extends CardImpl { effect = new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.AURA); effect.setText("has haste"); ability.addEffect(effect); - effect = new GainAbilityAttachedEffect(new AttacksEachTurnStaticAbility(), AttachmentType.AURA); + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Duration.WhileOnBattlefield)); + effect = new AttacksIfAbleAttachedEffect(Duration.WhileOnBattlefield, AttachmentType.AURA); effect.setText("and attacks each turn if able"); ability.addEffect(effect); this.addAbility(ability); - + // When enchanted creature dies, you may search your library for a card named Infectious Bloodlust, reveal it, put it into your hand, then shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter); this.addAbility(new DiesAttachedTriggeredAbility(new SearchLibraryPutInHandEffect(target, true, true), "enchanted creature", true));