diff --git a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java index 4f86502e5d7..5326ac6958b 100644 --- a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java @@ -287,9 +287,12 @@ public class ComputerPlayer> extends PlayerImpl i targets = threats(opponentId, ((FilterCreatureOrPlayer)t.getFilter()).getCreatureFilter(), game); } for (Permanent permanent: targets) { + List alreadyTargetted = target.getTargets(); if (t.canTarget(playerId, permanent.getId(), source, game)) { - target.addTarget(permanent.getId(), source, game); - return true; + if ( alreadyTargetted != null && !alreadyTargetted.contains(permanent.getId()) ) { + target.addTarget(permanent.getId(), source, game); + return true; + } } } if (outcome.isGood()) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/DivineOffering.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/DivineOffering.java index 9ae25d811c8..5b2af3f6c85 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/DivineOffering.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/DivineOffering.java @@ -1,112 +1,115 @@ -/* - * 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.mirrodinbesieged; - -import java.util.UUID; - -import mage.Constants; -import mage.Constants.CardType; -import mage.Constants.Rarity; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.DestroyTargetEffect; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.filter.Filter; -import mage.filter.FilterPermanent; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.TargetPermanent; - -/** - * - * @author ayratn - */ -public class DivineOffering extends CardImpl { - - private static FilterPermanent filter = new FilterPermanent("artifact"); - - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); - } - - public DivineOffering (UUID ownerId) { - super(ownerId, 5, "Divine Offering", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); - this.expansionSetCode = "MBS"; - this.color.setWhite(true); - this.getSpellAbility().addTarget(new TargetPermanent(filter)); - this.getSpellAbility().addEffect(new DestroyTargetEffect()); - this.getSpellAbility().addEffect(new DivineOfferingEffect()); - } - - public DivineOffering (final DivineOffering card) { - super(card); - } - - @Override - public DivineOffering copy() { - return new DivineOffering(this); - } - - private class DivineOfferingEffect extends OneShotEffect { - - public DivineOfferingEffect() { - super(Constants.Outcome.DestroyPermanent); - } - - public DivineOfferingEffect(DivineOfferingEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Card card = game.getLastKnownInformation(source.getFirstTarget(), Constants.Zone.BATTLEFIELD); - if (card != null) { - int cost = card.getManaCost().get(0).convertedManaCost(); - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.gainLife(cost, game); - } - } - return true; - } - - @Override - public DivineOfferingEffect copy() { - return new DivineOfferingEffect(this); - } - - @Override - public String getText(Ability source) { - return "You gain life equal to its converted mana cost"; - } - } -} +/* + * 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.mirrodinbesieged; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.filter.FilterPermanent; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.TargetPermanent; + +/** + * + * @author matt.maurer + */ +public class DivineOffering extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent(); + + static { + filter.getCardType().add(CardType.ARTIFACT); + } + + public DivineOffering(UUID ownerId) { + super(ownerId, 5, "Divine Offering", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); + this.expansionSetCode = "MBS"; + this.getColor().setWhite(true); + + Target target = new TargetPermanent(filter); + target.setTargetName("artifact"); + target.setRequired(true); + this.getSpellAbility().addTarget(target); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addEffect(new DivineOfferingGainLifeEffect()); + } + + public DivineOffering(final DivineOffering card) { + super(card); + } + + @Override + public DivineOffering copy() { + return new DivineOffering(this); + } +} + +class DivineOfferingGainLifeEffect extends OneShotEffect { + + DivineOfferingGainLifeEffect() { + super(Outcome.DestroyPermanent); + } + + DivineOfferingGainLifeEffect ( final DivineOfferingGainLifeEffect effect ) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + Card card = player.getGraveyard().get(source.getFirstTarget(), game); + if (card == null) { + card = game.getLastKnownInformation(source.getFirstTarget(), Zone.GRAVEYARD); + } + if (card != null) { + player.gainLife(card.getManaCost().convertedManaCost(), game); + } + } + return true; + } + + @Override + public String getText(Ability source) { + return "You gain life equal to it's converted mana cost."; + } + + @Override + public DivineOfferingGainLifeEffect copy() { + return new DivineOfferingGainLifeEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/GofortheThroat.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/GofortheThroat.java new file mode 100644 index 00000000000..e34cc491955 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/GofortheThroat.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.mirrodinbesieged; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.Target; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Loki + */ +public class GofortheThroat extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.setNotCardType(true); + } + + public GofortheThroat(UUID ownerId) { + super(ownerId, 43, "Go for the Throat", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{B}"); + this.expansionSetCode = "MBS"; + this.color.setBlack(true); + + Target target = new TargetCreaturePermanent(filter); + target.setTargetName("nonartifact creature"); + this.getSpellAbility().addTarget(target); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + } + + public GofortheThroat(final GofortheThroat card) { + super(card); + } + + @Override + public GofortheThroat copy() { + return new GofortheThroat(this); + } +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EldraziTemple.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EldraziTemple.java new file mode 100644 index 00000000000..ba7b7445ce5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EldraziTemple.java @@ -0,0 +1,110 @@ +/* + * 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.riseoftheeldrazi; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Mana; +import mage.abilities.effects.common.ManaEffect; +import mage.abilities.mana.BasicManaAbility; +import mage.abilities.mana.ColorlessManaAbility; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.game.stack.SpellStack; +import mage.game.stack.StackObject; + +/** + * + * @author Loki + */ +public class EldraziTemple extends CardImpl { + + public EldraziTemple(UUID ownerId) { + super(ownerId, 227, "Eldrazi Temple", Rarity.RARE, new CardType[]{ CardType.LAND }, null); + this.expansionSetCode = "ROE"; + + this.addAbility(new ColorlessManaAbility()); + this.addAbility(new EldraziTempleManaAbility()); + } + + public EldraziTemple(final EldraziTemple card) { + super(card); + } + + @Override + public EldraziTemple copy() { + return new EldraziTemple(this); + } +} + +class EldraziTempleManaAbility extends BasicManaAbility { + + private static final String abilityText = "Spend this mana only to cast colorless Eldrazi spells or activate abilities of colorless Eldrazi. " + + "(Mage Tip: This ability can only be activated when an Eldrazi spell or ability is on the stack.)"; + + EldraziTempleManaAbility ( ) { + super(new ManaEffect(Mana.ColorlessMana(2))); + this.netMana.setColorless(2); + } + + EldraziTempleManaAbility ( EldraziTempleManaAbility ability ) { + super(ability); + } + + @Override + public boolean canActivate(UUID playerId, Game game) { + boolean eldraziSpellBeingCast = false; + + SpellStack stack = game.getStack(); + for ( int idx = 0; idx < stack.size(); idx++ ) { + StackObject stackObject = stack.get(idx); + if ( stackObject.getControllerId().equals(playerId) ) { + eldraziSpellBeingCast |= stackObject.getSubtype().contains("Eldrazi"); + } + } + + return super.canActivate(playerId, game) && eldraziSpellBeingCast; + } + + @Override + public String getRule() { + return super.getRule() + " " + abilityText; + } + + @Override + public String getRule(String source) { + return super.getRule(source); + } + + @Override + public EldraziTempleManaAbility copy ( ) { + return new EldraziTempleManaAbility(this); + } +} diff --git a/Mage.Sets/src/mage/sets/worldwake/AbyssalPersecutor.java b/Mage.Sets/src/mage/sets/worldwake/AbyssalPersecutor.java new file mode 100644 index 00000000000..74375a5bafe --- /dev/null +++ b/Mage.Sets/src/mage/sets/worldwake/AbyssalPersecutor.java @@ -0,0 +1,114 @@ +/* + * 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.worldwake; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; + +/** + * + * @author Loki + */ +public class AbyssalPersecutor extends CardImpl { + + public AbyssalPersecutor(UUID ownerId) { + super(ownerId, 47, "Abyssal Persecutor", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "WWK"; + this.subtype.add("Demon"); + this.color.setBlack(true); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(TrampleAbility.getInstance()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AbyssalPersecutorCannotWinEffect())); + } + + public AbyssalPersecutor(final AbyssalPersecutor card) { + super(card); + } + + @Override + public AbyssalPersecutor copy() { + return new AbyssalPersecutor(this); + } +} + +class AbyssalPersecutorCannotWinEffect extends ReplacementEffectImpl { + + AbyssalPersecutorCannotWinEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + } + + AbyssalPersecutorCannotWinEffect ( final AbyssalPersecutorCannotWinEffect effect ) { + super(effect); + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if ((event.getType() == EventType.LOSES && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) + || (event.getType() == EventType.WINS && event.getPlayerId().equals(source.getControllerId()))) { + return true; + } + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } + + @Override + public String getText(Ability source) { + return "You can't win the game and your opponents can't lose the game"; + } + + @Override + public AbyssalPersecutorCannotWinEffect copy() { + return new AbyssalPersecutorCannotWinEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/worldwake/Dispel.java b/Mage.Sets/src/mage/sets/worldwake/Dispel.java new file mode 100644 index 00000000000..b80e7787039 --- /dev/null +++ b/Mage.Sets/src/mage/sets/worldwake/Dispel.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.worldwake; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.cards.CardImpl; +import mage.filter.FilterSpell; +import mage.target.TargetSpell; + +/** + * + * @author Loki + */ +public class Dispel extends CardImpl { + + private static FilterSpell filter = new FilterSpell("instant spell"); + + static { + filter.getCardType().add(CardType.INSTANT); + } + + public Dispel(UUID ownerId) { + super(ownerId, 26, "Dispel", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "WWK"; + this.color.setBlue(true); + this.getSpellAbility().addTarget(new TargetSpell(filter)); + this.getSpellAbility().addEffect(new CounterTargetEffect()); + } + + public Dispel(final Dispel card) { + super(card); + } + + @Override + public Dispel copy() { + return new Dispel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikar/Disfigure.java b/Mage.Sets/src/mage/sets/zendikar/Disfigure.java new file mode 100644 index 00000000000..8d97f6bd8de --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikar/Disfigure.java @@ -0,0 +1,61 @@ +/* + * 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.zendikar; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.abilities.effects.common.continious.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Loki + */ +public class Disfigure extends CardImpl { + + public Disfigure(UUID ownerId) { + super(ownerId, 87, "Disfigure", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}"); + this.expansionSetCode = "ZEN"; + + this.color.setBlack(true); + this.getSpellAbility().addEffect(new BoostTargetEffect(-2, -2, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public Disfigure(final Disfigure card) { + super(card); + } + + @Override + public Disfigure copy() { + return new Disfigure(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikar/NissasChosen.java b/Mage.Sets/src/mage/sets/zendikar/NissasChosen.java index 160b5d49965..b6f51500cda 100644 --- a/Mage.Sets/src/mage/sets/zendikar/NissasChosen.java +++ b/Mage.Sets/src/mage/sets/zendikar/NissasChosen.java @@ -37,12 +37,12 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ReplacementEffectImpl; +import mage.cards.Card; import mage.cards.CardImpl; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; -import mage.game.permanent.Permanent; /** * @@ -98,9 +98,9 @@ class NissasChosenEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if ( permanent != null && event.getTargetId().equals(source.getSourceId()) ) { - return permanent.moveToZone(Zone.LIBRARY, source.getId(), game, onTop); + Card card = game.getCard(event.getTargetId()); + if ( card != null && event.getTargetId().equals(source.getSourceId()) ) { + return card.moveToZone(Zone.LIBRARY, source.getId(), game, onTop); } return false; }