From e142c6c21112b12d51f6f02457795328097fe24e Mon Sep 17 00:00:00 2001 From: "maurer.it" Date: Thu, 24 Feb 2011 10:11:32 -0500 Subject: [PATCH 1/5] Nissa's Chosen will now actually go to the bottom instead of the graveyard. --- Mage.Sets/src/mage/sets/zendikar/NissasChosen.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; } From 103eb610511ea4b7ffbadd00edff52f42334d368 Mon Sep 17 00:00:00 2001 From: "maurer.it" Date: Fri, 25 Feb 2011 16:40:55 -0500 Subject: [PATCH 2/5] Possible fix for Arc Trail Targetting. --- .../src/main/java/mage/player/ai/ComputerPlayer.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 ec056f11d84..2764882e2de 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()) { From 4b696471edc9f6285c88fe9835d62e140495f76d Mon Sep 17 00:00:00 2001 From: "maurer.it" Date: Sun, 6 Mar 2011 12:08:55 -0500 Subject: [PATCH 3/5] Dispel --- Mage.Sets/src/mage/sets/worldwake/Dispel.java | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/worldwake/Dispel.java 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); + } +} From 5c1b9e021853a0757a0ea439eaac618f680cca3b Mon Sep 17 00:00:00 2001 From: "maurer.it" Date: Sun, 6 Mar 2011 12:27:07 -0500 Subject: [PATCH 4/5] Divine Offering. --- .../sets/mirrodinbesieged/DivineOffering.java | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/mirrodinbesieged/DivineOffering.java diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/DivineOffering.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/DivineOffering.java new file mode 100644 index 00000000000..5b2af3f6c85 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/DivineOffering.java @@ -0,0 +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.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); + } +} From dd616efcb9891d87217b57fb2cfbe7c3e20459cf Mon Sep 17 00:00:00 2001 From: "maurer.it" Date: Sun, 6 Mar 2011 22:13:43 -0500 Subject: [PATCH 5/5] GftT, Eldrazi Temple (possibly hacky), Abyssal Persecutor, Disfigure --- .../sets/mirrodinbesieged/GofortheThroat.java | 71 +++++++++++ .../sets/riseoftheeldrazi/EldraziTemple.java | 110 +++++++++++++++++ .../sets/worldwake/AbyssalPersecutor.java | 114 ++++++++++++++++++ .../src/mage/sets/zendikar/Disfigure.java | 61 ++++++++++ 4 files changed, 356 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/mirrodinbesieged/GofortheThroat.java create mode 100644 Mage.Sets/src/mage/sets/riseoftheeldrazi/EldraziTemple.java create mode 100644 Mage.Sets/src/mage/sets/worldwake/AbyssalPersecutor.java create mode 100644 Mage.Sets/src/mage/sets/zendikar/Disfigure.java 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/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); + } +}