From be49bb3d13be0735811c4865ac288d849e66b990 Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 6 Nov 2013 12:04:47 -0600 Subject: [PATCH] - Added Evershrike, Ward of Bones, Springjack Pasture, Antler Skulkin, Batwing Brume. Small addition to class. --- .../sets/commander2013/SpringjackPasture.java | 218 ++++++++++++++++++ .../src/mage/sets/eventide/AntlerSkulkin.java | 83 +++++++ .../src/mage/sets/eventide/BatwingBrume.java | 107 +++++++++ .../src/mage/sets/eventide/Evershrike.java | 155 +++++++++++++ .../mage/sets/eventide/SpringjackPasture.java | 53 +++++ .../src/mage/sets/eventide/WardOfBones.java | 134 +++++++++++ .../common/TargetCreaturePermanent.java | 5 + 7 files changed, 755 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/commander2013/SpringjackPasture.java create mode 100644 Mage.Sets/src/mage/sets/eventide/AntlerSkulkin.java create mode 100644 Mage.Sets/src/mage/sets/eventide/BatwingBrume.java create mode 100644 Mage.Sets/src/mage/sets/eventide/Evershrike.java create mode 100644 Mage.Sets/src/mage/sets/eventide/SpringjackPasture.java create mode 100644 Mage.Sets/src/mage/sets/eventide/WardOfBones.java diff --git a/Mage.Sets/src/mage/sets/commander2013/SpringjackPasture.java b/Mage.Sets/src/mage/sets/commander2013/SpringjackPasture.java new file mode 100644 index 00000000000..8bbea0f2a86 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2013/SpringjackPasture.java @@ -0,0 +1,218 @@ +/* + * 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.commander2013; + +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.CostImpl; +import mage.abilities.costs.VariableCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.GetXValue; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.mana.ColorlessManaAbility; +import mage.cards.CardImpl; +import mage.choices.ChoiceColor; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterMana; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.permanent.token.Token; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author jeffwadsworth + * + */ +public class SpringjackPasture extends CardImpl { + + public SpringjackPasture(UUID ownerId) { + super(ownerId, 326, "Springjack Pasture", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "C13"; + + // {tap}: Add {1} to your mana pool. + this.addAbility(new ColorlessManaAbility()); + + // {4}, {tap}: Put a 0/1 white Goat creature token onto the battlefield. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new GoatToken()), new ManaCostsImpl("{4}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + // {tap}, Sacrifice X Goats: Add X mana of any one color to your mana pool. You gain X life. + Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SpringjackPastureEffect(), new TapSourceCost()); + ability2.addCost(new SpringjackPastureCost()); + this.addAbility(ability2); + + } + + public SpringjackPasture(final SpringjackPasture card) { + super(card); + } + + @Override + public SpringjackPasture copy() { + return new SpringjackPasture(this); + } +} + +class SpringjackPastureEffect extends OneShotEffect { + + public SpringjackPastureEffect() { + super(Outcome.Benefit); + staticText = "Add X mana of any one color to your mana pool. You gain X life"; + } + + public SpringjackPastureEffect(final SpringjackPastureEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player you = game.getPlayer(source.getControllerId()); + ChoiceColor choice = (ChoiceColor) source.getChoices().get(0); + int count = new GetXValue().calculate(game, source); + if (choice.getColor().isBlack()) { + you.getManaPool().addMana(new Mana(0, 0, 0, 0, count, 0, 0), game, source); + you.gainLife(count, game); + return true; + } else if (choice.getColor().isBlue()) { + you.getManaPool().addMana(new Mana(0, 0, count, 0, 0, 0, 0), game, source); + you.gainLife(count, game); + return true; + } else if (choice.getColor().isRed()) { + you.getManaPool().addMana(new Mana(count, 0, 0, 0, 0, 0, 0), game, source); + you.gainLife(count, game); + return true; + } else if (choice.getColor().isGreen()) { + you.getManaPool().addMana(new Mana(0, count, 0, 0, 0, 0, 0), game, source); + you.gainLife(count, game); + return true; + } else if (choice.getColor().isWhite()) { + you.getManaPool().addMana(new Mana(0, 0, 0, count, 0, 0, 0), game, source); + you.gainLife(count, game); + return true; + } + return false; + } + + @Override + public SpringjackPastureEffect copy() { + return new SpringjackPastureEffect(this); + } +} + +class SpringjackPastureCost extends CostImpl implements VariableCost { + + protected int amountPaid = 0; + + public SpringjackPastureCost() { + this.text = "sacrifice X Goats"; + } + + public SpringjackPastureCost(final SpringjackPastureCost cost) { + super(cost); + this.amountPaid = cost.amountPaid; + } + + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + return true; + } + + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + amountPaid = 0; + FilterCreaturePermanent filter = new FilterCreaturePermanent("X number of goats you control."); + filter.add(new SubtypePredicate("Goat")); + filter.add(new ControllerPredicate(TargetController.YOU)); + TargetCreaturePermanent target = new TargetCreaturePermanent(filter); + while (true) { + target.clearChosen(); + if (target.canChoose(controllerId, game) && target.choose(Outcome.Sacrifice, controllerId, sourceId, game)) { + UUID goat = target.getFirstTarget(); + if (goat != null) { + game.getPermanent(goat).sacrifice(sourceId, game); + amountPaid++; + } + } else { + break; + } + } + paid = true; + return true; + } + + @Override + public int getAmount() { + return amountPaid; + } + + @Override + public void setFilter(FilterMana filter) { + } + + @Override + public FilterMana getFilter() { + return new FilterMana(); + } + + @Override + public SpringjackPastureCost copy() { + return new SpringjackPastureCost(this); + } + + @Override + public void setAmount(int amount) { + amountPaid = amount; + } +} + +class GoatToken extends Token { + + public GoatToken() { + super("Goat", "a 0/1 white Goat creature token"); + cardType.add(CardType.CREATURE); + color = ObjectColor.WHITE; + subtype.add("Goat"); + power = new MageInt(0); + toughness = new MageInt(1); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/eventide/AntlerSkulkin.java b/Mage.Sets/src/mage/sets/eventide/AntlerSkulkin.java new file mode 100644 index 00000000000..dece9c9642b --- /dev/null +++ b/Mage.Sets/src/mage/sets/eventide/AntlerSkulkin.java @@ -0,0 +1,83 @@ +/* + * 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.eventide; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continious.GainAbilityTargetEffect; +import mage.abilities.keyword.PersistAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author jeffwadsworth + + */ +public class AntlerSkulkin extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("white creature"); + + static { + filter.add(new ColorPredicate(ObjectColor.WHITE)); + } + + public AntlerSkulkin(UUID ownerId) { + super(ownerId, 167, "Antler Skulkin", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}"); + this.expansionSetCode = "EVE"; + this.subtype.add("Scarecrow"); + + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {2}: Target white creature gains persist until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(new PersistAbility(), Duration.EndOfTurn), new ManaCostsImpl("{2}")); + ability.addTarget(new TargetCreaturePermanent(filter, true)); + this.addAbility(ability); + + } + + public AntlerSkulkin(final AntlerSkulkin card) { + super(card); + } + + @Override + public AntlerSkulkin copy() { + return new AntlerSkulkin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/eventide/BatwingBrume.java b/Mage.Sets/src/mage/sets/eventide/BatwingBrume.java new file mode 100644 index 00000000000..a2955c69f93 --- /dev/null +++ b/Mage.Sets/src/mage/sets/eventide/BatwingBrume.java @@ -0,0 +1,107 @@ +/* + * 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.eventide; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.condition.common.ManaWasSpentCondition; +import mage.abilities.decorator.ConditionalContinousEffect; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.PreventAllDamageEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.ManaType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterAttackingCreature; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author jeffwadsworth + * + */ +public class BatwingBrume extends CardImpl { + + public BatwingBrume(UUID ownerId) { + super(ownerId, 81, "Batwing Brume", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{W/B}"); + this.expansionSetCode = "EVE"; + + this.color.setBlack(true); + this.color.setWhite(true); + + // Prevent all combat damage that would be dealt this turn if {W} was spent to cast Batwing Brume. Each player loses 1 life for each attacking creature he or she controls if {B} was spent to cast Batwing Brume. + this.getSpellAbility().addEffect(new ConditionalContinousEffect( + new PreventAllDamageEffect(Duration.EndOfTurn, true), + new ManaWasSpentCondition(ManaType.WHITE), "Prevent all combat damage that would be dealt this turn if {W} was spent to cast {this}", true)); + this.getSpellAbility().addEffect(new ConditionalOneShotEffect( + new BatwingBrumeEffect(), + new ManaWasSpentCondition(ManaType.BLACK), "Each player loses 1 life for each attacking creature he or she controls if {B} was spent to cast {this}")); + this.addInfo("Info1", "(Do both if {W}{B} was spent.)"); + + } + + public BatwingBrume(final BatwingBrume card) { + super(card); + } + + @Override + public BatwingBrume copy() { + return new BatwingBrume(this); + } +} + +class BatwingBrumeEffect extends OneShotEffect { + + public BatwingBrumeEffect() { + super(Outcome.LoseLife); + } + + public BatwingBrumeEffect(final BatwingBrumeEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + for (Player player : game.getPlayers().values()) { + if (player != null) { + final int amount = game.getBattlefield().getAllActivePermanents(new FilterAttackingCreature(), player.getId(), game).size(); + player.loseLife(amount, game); + } + } + return true; + } + + @Override + public BatwingBrumeEffect copy() { + return new BatwingBrumeEffect(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/eventide/Evershrike.java b/Mage.Sets/src/mage/sets/eventide/Evershrike.java new file mode 100644 index 00000000000..ca98f08ece7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/eventide/Evershrike.java @@ -0,0 +1,155 @@ +/* + * 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.eventide; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.AuraAttachedCount; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continious.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter.ComparisonType; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.other.AuraCardCanAttachToPermanentId; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetCard; + +/** + * + * @author jeffwadsworth + * + */ +public class Evershrike extends CardImpl { + + public Evershrike(UUID ownerId) { + super(ownerId, 88, "Evershrike", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}"); + this.expansionSetCode = "EVE"; + this.subtype.add("Elemental"); + this.subtype.add("Spirit"); + + this.color.setBlack(true); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Evershrike gets +2/+2 for each Aura attached to it. + AuraAttachedCount amount = new AuraAttachedCount(2); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(amount, amount, Duration.WhileOnBattlefield))); + + // {X}{WB}{WB}: Return Evershrike from your graveyard to the battlefield. You may put an Aura card with converted mana cost X or less from your hand onto the battlefield attached to it. If you don't, exile Evershrike. + this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, new EvershrikeEffect(), new ManaCostsImpl("{X}{W/B}{W/B}"))); + + } + + public Evershrike(final Evershrike card) { + super(card); + } + + @Override + public Evershrike copy() { + return new Evershrike(this); + } +} + +class EvershrikeEffect extends OneShotEffect { + + public EvershrikeEffect() { + super(Outcome.Benefit); + staticText = "Return {this} from your graveyard to the battlefield. You may put an Aura card with converted mana cost X or less from your hand onto the battlefield attached to it. If you don't, exile {this}"; + } + + public EvershrikeEffect(final EvershrikeEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + boolean exiled = true; + Card evershrikeCard = game.getCard(source.getSourceId()); + Player you = game.getPlayer(source.getControllerId()); + int xAmount = source.getManaCostsToPay().getX() + 1; + if (evershrikeCard != null) { + if (evershrikeCard.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false)) { + Permanent evershrikePermanent = game.getPermanent(source.getSourceId()); + if (evershrikePermanent == null) { + return false; + } + FilterCard filterAuraCard = new FilterCard("Aura card with converted mana cost X or less from your hand"); + filterAuraCard.add(new CardTypePredicate(CardType.ENCHANTMENT)); + filterAuraCard.add(new SubtypePredicate("Aura")); + filterAuraCard.add(new AuraCardCanAttachToPermanentId(evershrikePermanent.getId())); + filterAuraCard.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, xAmount)); + int count = you.getHand().count(filterAuraCard, game); + while (count > 0 && you.chooseUse(Outcome.Benefit, "Do you wish to put an Aura card from your hand onto Evershrike", game)) { + TargetCard targetAura = new TargetCard(Zone.PICK, filterAuraCard); + if (you.choose(Outcome.Benefit, you.getHand(), targetAura, game)) { + Card aura = game.getCard(targetAura.getFirstTarget()); + if (aura != null) { + game.getState().setValue("attachTo:" + aura.getId(), evershrikePermanent); + aura.putOntoBattlefield(game, Zone.HAND, source.getId(), you.getId()); + evershrikePermanent.addAttachment(aura.getId(), game); + exiled = false; + count = you.getHand().count(filterAuraCard, game); + } + } + + + } + if (exiled) { + return evershrikePermanent.moveToExile(source.getSourceId(), "Evershrike Exile", source.getId(), game); + } + return true; + } + } + return false; + } + + @Override + public EvershrikeEffect copy() { + return new EvershrikeEffect(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/eventide/SpringjackPasture.java b/Mage.Sets/src/mage/sets/eventide/SpringjackPasture.java new file mode 100644 index 00000000000..22d0f896ab8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/eventide/SpringjackPasture.java @@ -0,0 +1,53 @@ +/* + * 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.eventide; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + + */ +public class SpringjackPasture extends mage.sets.commander2013.SpringjackPasture { + + public SpringjackPasture(UUID ownerId) { + super(ownerId); + this.cardNumber = 179; + this.expansionSetCode = "EVE"; + } + + public SpringjackPasture(final SpringjackPasture card) { + super(card); + } + + @Override + public SpringjackPasture copy() { + return new SpringjackPasture(this); + } +} diff --git a/Mage.Sets/src/mage/sets/eventide/WardOfBones.java b/Mage.Sets/src/mage/sets/eventide/WardOfBones.java new file mode 100644 index 00000000000..f89c2e04b8d --- /dev/null +++ b/Mage.Sets/src/mage/sets/eventide/WardOfBones.java @@ -0,0 +1,134 @@ +/* + * 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.eventide; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterArtifactPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.common.FilterEnchantmentPermanent; +import mage.filter.common.FilterLandPermanent; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; + +/** + * + * @author jeffwadsworth + * + */ +public class WardOfBones extends CardImpl { + + public WardOfBones(UUID ownerId) { + super(ownerId, 174, "Ward of Bones", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{1}"); + this.expansionSetCode = "EVE"; + + // Each opponent who controls more creatures than you can't play creature cards. The same is true for artifacts, enchantments, and lands. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new WardOfBonesEffect())); + + } + + public WardOfBones(final WardOfBones card) { + super(card); + } + + @Override + public WardOfBones copy() { + return new WardOfBones(this); + } +} + +class WardOfBonesEffect extends ReplacementEffectImpl { + + public WardOfBonesEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "Each opponent who controls more creatures than you can't play creature cards. The same is true for artifacts, enchantments, and lands"; + } + + public WardOfBonesEffect(final WardOfBonesEffect effect) { + super(effect); + } + + @Override + public WardOfBonesEffect copy() { + return new WardOfBonesEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == GameEvent.EventType.PLAY_LAND + || event.getType() == GameEvent.EventType.CAST_SPELL + && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { + final Card card = game.getCard(event.getTargetId()); + final Player opponent = game.getPlayer(event.getPlayerId()); + if (card == null || opponent == null) { + return false; + } + final int yourCreatures = game.getBattlefield().countAll(new FilterCreaturePermanent(), source.getControllerId(), game); + final int yourArtifacts = game.getBattlefield().countAll(new FilterArtifactPermanent(), source.getControllerId(), game); + final int yourEnchantments = game.getBattlefield().countAll(new FilterEnchantmentPermanent(), source.getControllerId(), game); + final int yourLands = game.getBattlefield().countAll(new FilterLandPermanent(), source.getControllerId(), game); + if (card.getCardType().contains(CardType.CREATURE) + && game.getBattlefield().countAll(new FilterCreaturePermanent(), opponent.getId(), game) > yourCreatures) { + return true; + } + if (card.getCardType().contains(CardType.ARTIFACT) + && game.getBattlefield().countAll(new FilterArtifactPermanent(), opponent.getId(), game) > yourArtifacts) { + return true; + } + if (card.getCardType().contains(CardType.ENCHANTMENT) + && game.getBattlefield().countAll(new FilterEnchantmentPermanent(), opponent.getId(), game) > yourEnchantments) { + return true; + } + if (card.getCardType().contains(CardType.LAND) + && game.getBattlefield().countAll(new FilterLandPermanent(), opponent.getId(), game) > yourLands) { + return true; + } + } + return false; + } +} \ No newline at end of file diff --git a/Mage/src/mage/target/common/TargetCreaturePermanent.java b/Mage/src/mage/target/common/TargetCreaturePermanent.java index 41957cc69df..6062a5de8dd 100644 --- a/Mage/src/mage/target/common/TargetCreaturePermanent.java +++ b/Mage/src/mage/target/common/TargetCreaturePermanent.java @@ -49,6 +49,11 @@ public class TargetCreaturePermanent> exten public TargetCreaturePermanent(FilterCreaturePermanent filter) { this(1, 1, filter, false); } + + public TargetCreaturePermanent(FilterCreaturePermanent filter, boolean required) { + this(1, 1, filter, false); + setRequired(required); + } public TargetCreaturePermanent(int numTargets) { this(numTargets, numTargets, new FilterCreaturePermanent(), false);