From 4b0e8c25e3188e01bafe8fd1893bb74e2b6526d2 Mon Sep 17 00:00:00 2001 From: FenrisulfrX Date: Wed, 8 Apr 2015 10:05:48 -0300 Subject: [PATCH 1/3] Added Sawtooth Loon --- .../mage/sets/planeshift/SawtoothLoon.java | 52 +++++++ .../mage/sets/venservskoth/SawtoothLoon.java | 130 ++++++++++++++++++ 2 files changed, 182 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/planeshift/SawtoothLoon.java create mode 100644 Mage.Sets/src/mage/sets/venservskoth/SawtoothLoon.java diff --git a/Mage.Sets/src/mage/sets/planeshift/SawtoothLoon.java b/Mage.Sets/src/mage/sets/planeshift/SawtoothLoon.java new file mode 100644 index 00000000000..b2f836bc9f8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/SawtoothLoon.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.planeshift; + +import java.util.UUID; + +/** + * + * @author FenrisulfrX + */ +public class SawtoothLoon extends mage.sets.venservskoth.SawtoothLoon { + + public SawtoothLoon(UUID ownerId) { + super(ownerId); + this.cardNumber = 123; + this.expansionSetCode = "PLS"; + } + + public SawtoothLoon(final SawtoothLoon card) { + super(card); + } + + @Override + public SawtoothLoon copy() { + return new SawtoothLoon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/venservskoth/SawtoothLoon.java b/Mage.Sets/src/mage/sets/venservskoth/SawtoothLoon.java new file mode 100644 index 00000000000..ccef7acff4d --- /dev/null +++ b/Mage.Sets/src/mage/sets/venservskoth/SawtoothLoon.java @@ -0,0 +1,130 @@ +/* + * 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.venservskoth; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ReturnToHandChosenControlledPermanentEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInHand; + +/** + * + * @author FenrisulfrX + */ +public class SawtoothLoon extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("white or blue creature you control"); + + static { + Predicates.or( + new ColorPredicate(ObjectColor.WHITE), + new ColorPredicate(ObjectColor.BLUE)); + } + + public SawtoothLoon(UUID ownerId) { + super(ownerId, 17, "Sawtooth Loon", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}{U}"); + this.expansionSetCode = "DDI"; + this.subtype.add("Bird"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Sawtooth Loon enters the battlefield, return a white or blue creature you control to its owner's hand. + this.addAbility(new EntersBattlefieldTriggeredAbility(new ReturnToHandChosenControlledPermanentEffect(filter), false)); + + // When Sawtooth Loon enters the battlefield, draw two cards, then put two cards from your hand on the bottom of your library. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SawtoothLoonEffect())); + } + + public SawtoothLoon(final SawtoothLoon card) { + super(card); + } + + @Override + public SawtoothLoon copy() { + return new SawtoothLoon(this); + } +} + +class SawtoothLoonEffect extends OneShotEffect { + + public SawtoothLoonEffect() { + super(Outcome.DrawCard); + this.staticText = "Draw two cards, then put two cards from your hand on the bottom of your library"; + } + + public SawtoothLoonEffect(final SawtoothLoonEffect effect) { + super(effect); + } + + @Override + public SawtoothLoonEffect copy() { + return new SawtoothLoonEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + controller.drawCards(2, game); + putOnLibrary(controller, source, game); + putOnLibrary(controller, source, game); + return true; + } + return false; + } + + private boolean putOnLibrary(Player player, Ability source, Game game) { + TargetCardInHand target = new TargetCardInHand(); + player.chooseTarget(Outcome.ReturnToHand, target, source, game); + Card card = player.getHand().get(target.getFirstTarget(), game); + if (card != null) { + player.getHand().remove(card); + player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, false, false); + } + return true; + } +} From 639e5f30118c08600cb1dee999d1a061e15ca9d0 Mon Sep 17 00:00:00 2001 From: FenrisulfrX Date: Wed, 8 Apr 2015 10:32:33 -0300 Subject: [PATCH 2/3] Added Overrule --- .../src/mage/sets/dissension/Overrule.java | 52 +++++++++++++++ .../src/mage/sets/venservskoth/Overrule.java | 65 +++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/dissension/Overrule.java create mode 100644 Mage.Sets/src/mage/sets/venservskoth/Overrule.java diff --git a/Mage.Sets/src/mage/sets/dissension/Overrule.java b/Mage.Sets/src/mage/sets/dissension/Overrule.java new file mode 100644 index 00000000000..eca7ae0b9aa --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/Overrule.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.dissension; + +import java.util.UUID; + +/** + * + * @author FenrisulfrX + */ +public class Overrule extends mage.sets.venservskoth.Overrule { + + public Overrule(UUID ownerId) { + super(ownerId); + this.cardNumber = 120; + this.expansionSetCode = "DIS"; + } + + public Overrule(final Overrule card) { + super(card); + } + + @Override + public Overrule copy() { + return new Overrule(this); + } +} diff --git a/Mage.Sets/src/mage/sets/venservskoth/Overrule.java b/Mage.Sets/src/mage/sets/venservskoth/Overrule.java new file mode 100644 index 00000000000..1a62dbe8abc --- /dev/null +++ b/Mage.Sets/src/mage/sets/venservskoth/Overrule.java @@ -0,0 +1,65 @@ +/* + * 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.venservskoth; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.common.CounterUnlessPaysEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetSpell; + +/** + * + * @author FenrisulfrX + */ +public class Overrule extends CardImpl { + + public Overrule(UUID ownerId) { + super(ownerId, 32, "Overrule", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{X}{W}{U}"); + this.expansionSetCode = "DDI"; + + // Counter target spell unless its controller pays {X}. + this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new ManacostVariableValue())); + this.getSpellAbility().addTarget(new TargetSpell()); + + // You gain X life. + this.getSpellAbility().addEffect(new GainLifeEffect(new ManacostVariableValue())); + } + + public Overrule(final Overrule card) { + super(card); + } + + @Override + public Overrule copy() { + return new Overrule(this); + } +} From 5594516c014606196025a95c2daf7130c18d1bc8 Mon Sep 17 00:00:00 2001 From: emerald000 Date: Wed, 8 Apr 2015 15:23:46 -0400 Subject: [PATCH 3/3] [TPR] Added Dream Prowler, Kor Chant and Legerdemain. --- .../src/mage/sets/conspiracy/KorChant.java | 52 +++++++ Mage.Sets/src/mage/sets/exodus/KorChant.java | 130 ++++++++++++++++++ .../mage/sets/ninthedition/DreamProwler.java | 52 +++++++ .../mage/sets/stronghold/DreamProwler.java | 54 ++++++++ .../src/mage/sets/tempest/Legerdemain.java | 105 ++++++++++++++ .../sets/tempestremastered/DreamProwler.java | 71 ++++++++++ .../mage/sets/tempestremastered/KorChant.java | 54 ++++++++ .../sets/tempestremastered/Legerdemain.java | 52 +++++++ .../abilities/effects/RedirectionEffect.java | 4 +- 9 files changed, 572 insertions(+), 2 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/conspiracy/KorChant.java create mode 100644 Mage.Sets/src/mage/sets/exodus/KorChant.java create mode 100644 Mage.Sets/src/mage/sets/ninthedition/DreamProwler.java create mode 100644 Mage.Sets/src/mage/sets/stronghold/DreamProwler.java create mode 100644 Mage.Sets/src/mage/sets/tempest/Legerdemain.java create mode 100644 Mage.Sets/src/mage/sets/tempestremastered/DreamProwler.java create mode 100644 Mage.Sets/src/mage/sets/tempestremastered/KorChant.java create mode 100644 Mage.Sets/src/mage/sets/tempestremastered/Legerdemain.java diff --git a/Mage.Sets/src/mage/sets/conspiracy/KorChant.java b/Mage.Sets/src/mage/sets/conspiracy/KorChant.java new file mode 100644 index 00000000000..2e0ab4df9c1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/conspiracy/KorChant.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.conspiracy; + +import java.util.UUID; + +/** + * + * @author emerald000 + */ +public class KorChant extends mage.sets.exodus.KorChant { + + public KorChant(UUID ownerId) { + super(ownerId); + this.cardNumber = 73; + this.expansionSetCode = "CNS"; + } + + public KorChant(final KorChant card) { + super(card); + } + + @Override + public KorChant copy() { + return new KorChant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/exodus/KorChant.java b/Mage.Sets/src/mage/sets/exodus/KorChant.java new file mode 100644 index 00000000000..33d0c0d38c0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/exodus/KorChant.java @@ -0,0 +1,130 @@ +/* + * 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.exodus; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.RedirectionEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.TargetSource; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author emerald000 + */ +public class KorChant extends CardImpl { + + public KorChant(UUID ownerId) { + super(ownerId, 9, "Kor Chant", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{W}"); + this.expansionSetCode = "EXO"; + + // All damage that would be dealt this turn to target creature you control by a source of your choice is dealt to another target creature instead. + this.getSpellAbility().addEffect(new KorChantEffect()); + this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); + this.getSpellAbility().addTarget(new KorChantSecondTarget()); + } + + public KorChant(final KorChant card) { + super(card); + } + + @Override + public KorChant copy() { + return new KorChant(this); + } +} + +class KorChantSecondTarget extends TargetCreaturePermanent { + + KorChantSecondTarget() { + super(); + this.targetName = "another creature"; + } + + KorChantSecondTarget(final KorChantSecondTarget target) { + super(target); + } + + @Override + public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) { + if (source.getTargets().get(0).getTargets().contains(id)) { + return false; + } + return super.canTarget(controllerId, id, source, game); + } + + @Override + public KorChantSecondTarget copy() { + return new KorChantSecondTarget(this); + } +} + +class KorChantEffect extends RedirectionEffect { + + protected TargetSource target = new TargetSource(); + + KorChantEffect() { + super(Duration.EndOfTurn); + staticText = "All damage that would be dealt this turn to target creature you control by a source of your choice is dealt to another target creature instead"; + } + + KorChantEffect(final KorChantEffect effect) { + super(effect); + this.target = effect.target; + } + + @Override + public KorChantEffect copy() { + return new KorChantEffect(this); + } + + @Override + public void init(Ability source, Game game) { + super.init(source, game); + this.target.choose(Outcome.PreventDamage, source.getControllerId(), source.getSourceId(), game); + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == GameEvent.EventType.DAMAGE_CREATURE + && event.getTargetId().equals(this.getTargetPointer().getFirst(game, source)) + && event.getSourceId().equals(this.target.getFirstTarget())) { + this.redirectTarget = source.getTargets().get(1); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/DreamProwler.java b/Mage.Sets/src/mage/sets/ninthedition/DreamProwler.java new file mode 100644 index 00000000000..99d20b5baf2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/DreamProwler.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.ninthedition; + +import java.util.UUID; + +/** + * + * @author emerald000 + */ +public class DreamProwler extends mage.sets.tempestremastered.DreamProwler { + + public DreamProwler(UUID ownerId) { + super(ownerId); + this.cardNumber = 74; + this.expansionSetCode = "9ED"; + } + + public DreamProwler(final DreamProwler card) { + super(card); + } + + @Override + public DreamProwler copy() { + return new DreamProwler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/DreamProwler.java b/Mage.Sets/src/mage/sets/stronghold/DreamProwler.java new file mode 100644 index 00000000000..f128661e0a4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/DreamProwler.java @@ -0,0 +1,54 @@ +/* + * 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.stronghold; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author emerald000 + */ +public class DreamProwler extends mage.sets.tempestremastered.DreamProwler { + + public DreamProwler(UUID ownerId) { + super(ownerId); + this.cardNumber = 29; + this.expansionSetCode = "STH"; + this.rarity = Rarity.COMMON; + } + + public DreamProwler(final DreamProwler card) { + super(card); + } + + @Override + public DreamProwler copy() { + return new DreamProwler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/Legerdemain.java b/Mage.Sets/src/mage/sets/tempest/Legerdemain.java new file mode 100644 index 00000000000..b9a529f2e87 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/Legerdemain.java @@ -0,0 +1,105 @@ +/* + * 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.abilities.Ability; +import mage.abilities.effects.common.continuous.ExchangeControlTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; + +/** + * + * @author emerald000 + */ +public class Legerdemain extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("artifact or creature"); + static { + filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE))); + } + + public Legerdemain(UUID ownerId) { + super(ownerId, 72, "Legerdemain", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{U}{U}"); + this.expansionSetCode = "TMP"; + + // Exchange control of target artifact or creature and another target permanent that shares one of those types with it. + this.getSpellAbility().addEffect(new ExchangeControlTargetEffect(Duration.EndOfGame, "Exchange control of target artifact or creature and another target permanent that shares one of those types with it", false, true)); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + this.getSpellAbility().addTarget(new LegerdemainSecondTarget()); + } + + public Legerdemain(final Legerdemain card) { + super(card); + } + + @Override + public Legerdemain copy() { + return new Legerdemain(this); + } +} + +class LegerdemainSecondTarget extends TargetPermanent { + + LegerdemainSecondTarget() { + super(); + this.targetName = "another permanent that shares one of those types"; + } + + LegerdemainSecondTarget(final LegerdemainSecondTarget target) { + super(target); + } + + @Override + public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) { + Permanent firstPermanent = game.getPermanent(source.getTargets().getFirstTarget()); + Permanent secondPermanent = game.getPermanent(id); + if (firstPermanent != null && secondPermanent != null) { + if (firstPermanent.getCardType().contains(CardType.CREATURE) && secondPermanent.getCardType().contains(CardType.CREATURE)) { + return true; + } + if (firstPermanent.getCardType().contains(CardType.ARTIFACT) && secondPermanent.getCardType().contains(CardType.ARTIFACT)) { + return true; + } + } + return false; + } + + @Override + public LegerdemainSecondTarget copy() { + return new LegerdemainSecondTarget(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempestremastered/DreamProwler.java b/Mage.Sets/src/mage/sets/tempestremastered/DreamProwler.java new file mode 100644 index 00000000000..023a934fb4c --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempestremastered/DreamProwler.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.tempestremastered; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.decorator.ConditionalRestrictionEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterAttackingCreature; + +/** + * + * @author emerald000 + */ +public class DreamProwler extends CardImpl { + + public DreamProwler(UUID ownerId) { + super(ownerId, 47, "Dream Prowler", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + this.expansionSetCode = "TPR"; + this.subtype.add("Illusion"); + this.power = new MageInt(1); + this.toughness = new MageInt(5); + + // Dream Prowler can't be blocked as long as it's attacking alone. + Effect effect = new ConditionalRestrictionEffect(new CantBeBlockedSourceEffect(), new PermanentsOnTheBattlefieldCondition(new FilterAttackingCreature(), CountType.FEWER_THAN, 2)); + effect.setText("{this} can't be blocked as long as it's attacking alone"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + } + + public DreamProwler(final DreamProwler card) { + super(card); + } + + @Override + public DreamProwler copy() { + return new DreamProwler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempestremastered/KorChant.java b/Mage.Sets/src/mage/sets/tempestremastered/KorChant.java new file mode 100644 index 00000000000..dccc93e46f3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempestremastered/KorChant.java @@ -0,0 +1,54 @@ +/* + * 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.tempestremastered; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author emerald000 + */ +public class KorChant extends mage.sets.exodus.KorChant { + + public KorChant(UUID ownerId) { + super(ownerId); + this.cardNumber = 17; + this.expansionSetCode = "TPR"; + this.rarity = Rarity.UNCOMMON; + } + + public KorChant(final KorChant card) { + super(card); + } + + @Override + public KorChant copy() { + return new KorChant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempestremastered/Legerdemain.java b/Mage.Sets/src/mage/sets/tempestremastered/Legerdemain.java new file mode 100644 index 00000000000..26baf30a059 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempestremastered/Legerdemain.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.tempestremastered; + +import java.util.UUID; + +/** + * + * @author emerald000 + */ +public class Legerdemain extends mage.sets.tempest.Legerdemain { + + public Legerdemain(UUID ownerId) { + super(ownerId); + this.cardNumber = 57; + this.expansionSetCode = "TPR"; + } + + public Legerdemain(final Legerdemain card) { + super(card); + } + + @Override + public Legerdemain copy() { + return new Legerdemain(this); + } +} diff --git a/Mage/src/mage/abilities/effects/RedirectionEffect.java b/Mage/src/mage/abilities/effects/RedirectionEffect.java index 51cde3a74c8..6c339460edf 100644 --- a/Mage/src/mage/abilities/effects/RedirectionEffect.java +++ b/Mage/src/mage/abilities/effects/RedirectionEffect.java @@ -37,7 +37,7 @@ import mage.game.events.DamageEvent; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.players.Player; -import mage.target.TargetPermanent; +import mage.target.Target; /** * @@ -45,7 +45,7 @@ import mage.target.TargetPermanent; */ public abstract class RedirectionEffect extends ReplacementEffectImpl { - protected TargetPermanent redirectTarget; + protected Target redirectTarget; public RedirectionEffect(Duration duration) { super(duration, Outcome.RedirectDamage);