diff --git a/Mage.Sets/src/mage/sets/conspiracy/RousingOfSouls.java b/Mage.Sets/src/mage/sets/conspiracy/RousingOfSouls.java new file mode 100644 index 00000000000..419e0d0a3fa --- /dev/null +++ b/Mage.Sets/src/mage/sets/conspiracy/RousingOfSouls.java @@ -0,0 +1,101 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.conspiracy; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.common.ParleyCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DrawCardAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.token.SpiritWhiteToken; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class RousingOfSouls extends CardImpl { + + public RousingOfSouls(UUID ownerId) { + super(ownerId, 19, "Rousing of Souls", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{W}"); + this.expansionSetCode = "CNS"; + + // Parley - Each player reveals the top card of his or her library. For each nonland card revealed this way, + // you put a 1/1 white Spirit creature token with flying onto the battlefield. Then each player draws a card. + this.getSpellAbility().addEffect(new RousingOfSoulsEffect()); + Effect effect = new DrawCardAllEffect(1); + effect.setText("Then each player draws a card"); + this.getSpellAbility().addEffect(effect); + } + + public RousingOfSouls(final RousingOfSouls card) { + super(card); + } + + @Override + public RousingOfSouls copy() { + return new RousingOfSouls(this); + } +} + +class RousingOfSoulsEffect extends OneShotEffect { + + public RousingOfSoulsEffect() { + super(Outcome.Benefit); + this.staticText = "Parley — Each player reveals the top card of his or her library. For each nonland card revealed this way, you put a 1/1 white Spirit creature token with flying onto the battlefield"; + } + + public RousingOfSoulsEffect(final RousingOfSoulsEffect effect) { + super(effect); + } + + @Override + public RousingOfSoulsEffect copy() { + return new RousingOfSoulsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int parley = ParleyCount.getInstance().calculate(game, source, this); + if (parley > 0) { + new CreateTokenEffect(new SpiritWhiteToken(), parley).apply(game, source); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/conspiracy/SelvalasCharge.java b/Mage.Sets/src/mage/sets/conspiracy/SelvalasCharge.java new file mode 100644 index 00000000000..ea2b5291118 --- /dev/null +++ b/Mage.Sets/src/mage/sets/conspiracy/SelvalasCharge.java @@ -0,0 +1,100 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.conspiracy; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.common.ParleyCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DrawCardAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.token.ElephantToken; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class SelvalasCharge extends CardImpl { + + public SelvalasCharge(UUID ownerId) { + super(ownerId, 39, "Selvala's Charge", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{G}"); + this.expansionSetCode = "CNS"; + + // Parley - Each player reveals the top card of his or her library. For each nonland card revealed this way, you put a 3/3 green Elephant creature token onto the battlefield. Then each player draws a card. + this.getSpellAbility().addEffect(new SelvalasChargeEffect()); + Effect effect = new DrawCardAllEffect(1); + effect.setText("Then each player draws a card"); + this.getSpellAbility().addEffect(effect); + } + + public SelvalasCharge(final SelvalasCharge card) { + super(card); + } + + @Override + public SelvalasCharge copy() { + return new SelvalasCharge(this); + } +} + +class SelvalasChargeEffect extends OneShotEffect { + + public SelvalasChargeEffect() { + super(Outcome.Benefit); + this.staticText = "Parley — Each player reveals the top card of his or her library. For each nonland card revealed this way, you put a 3/3 green Elephant creature token onto the battlefield"; + } + + public SelvalasChargeEffect(final SelvalasChargeEffect effect) { + super(effect); + } + + @Override + public SelvalasChargeEffect copy() { + return new SelvalasChargeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int parley = ParleyCount.getInstance().calculate(game, source, this); + if (parley > 0) { + new CreateTokenEffect(new ElephantToken(), parley).apply(game, source); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/conspiracy/SelvalasEnforcer.java b/Mage.Sets/src/mage/sets/conspiracy/SelvalasEnforcer.java new file mode 100644 index 00000000000..c846d64caa0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/conspiracy/SelvalasEnforcer.java @@ -0,0 +1,111 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.conspiracy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.dynamicvalue.common.ParleyCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class SelvalasEnforcer extends CardImpl { + + public SelvalasEnforcer(UUID ownerId) { + super(ownerId, 40, "Selvala's Enforcer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "CNS"; + this.subtype.add("Elf"); + this.subtype.add("Warrior"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Parley - When Selvala's Enforcer enters the battlefield, each player reveals the top card of his or her library. + // For each nonland card revealed this way, put a +1/+1 counter on Selvala's Enforcer. Then each player draws a card. + Ability ability = new EntersBattlefieldTriggeredAbility(new SelvalasEnforcerEffect(), false, "Parley — "); + Effect effect = new DrawCardAllEffect(1); + effect.setText("Then each player draws a card"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public SelvalasEnforcer(final SelvalasEnforcer card) { + super(card); + } + + @Override + public SelvalasEnforcer copy() { + return new SelvalasEnforcer(this); + } +} + +class SelvalasEnforcerEffect extends OneShotEffect { + + public SelvalasEnforcerEffect() { + super(Outcome.Benefit); + this.staticText = "each player reveals the top card of his or her library. For each nonland card revealed this way, put a +1/+1 counter on {this}"; + } + + public SelvalasEnforcerEffect(final SelvalasEnforcerEffect effect) { + super(effect); + } + + @Override + public SelvalasEnforcerEffect copy() { + return new SelvalasEnforcerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int parley = ParleyCount.getInstance().calculate(game, source, this); + if (parley > 0) { + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (sourcePermanent != null) { + sourcePermanent.addCounters(CounterType.P1P1.createInstance(parley), game); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/conspiracy/WoodvineElemental.java b/Mage.Sets/src/mage/sets/conspiracy/WoodvineElemental.java new file mode 100644 index 00000000000..1a6eafc4bf8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/conspiracy/WoodvineElemental.java @@ -0,0 +1,113 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.conspiracy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.dynamicvalue.common.ParleyCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardAllEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterAttackingCreature; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class WoodvineElemental extends CardImpl { + + final private String rule = "Parley — Whenever {this} attacks, each player reveals the top card of his or her library. " + + "For each nonland card revealed this way, attacking creatures you control get +1/+1 until end of turn. Then each player draws a card."; + + public WoodvineElemental(UUID ownerId) { + super(ownerId, 52, "Woodvine Elemental", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{G}{W}"); + this.expansionSetCode = "CNS"; + this.subtype.add("Elemental"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Parley - Whenever Woodvine Elemental attacks, each player reveals the top card of his or her library. + // For each nonland card revealed this way, attacking creatures you control get +1/+1 until end of turn. Then each player draws a card. + Ability ability = new AttacksTriggeredAbility(new WoodvineElementalEffect(), false, rule); + Effect effect = new DrawCardAllEffect(1); + ability.addEffect(effect); + this.addAbility(ability); + } + + public WoodvineElemental(final WoodvineElemental card) { + super(card); + } + + @Override + public WoodvineElemental copy() { + return new WoodvineElemental(this); + } +} + +class WoodvineElementalEffect extends OneShotEffect { + + public WoodvineElementalEffect() { + super(Outcome.Benefit); + } + + public WoodvineElementalEffect(final WoodvineElementalEffect effect) { + super(effect); + } + + @Override + public WoodvineElementalEffect copy() { + return new WoodvineElementalEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int parley = ParleyCount.getInstance().calculate(game, source, this); + if (parley > 0) { + game.addEffect(new BoostControlledEffect(parley, parley, Duration.EndOfTurn, new FilterAttackingCreature("Attacking creatures"), false), source); + } + return true; + } + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/iceage/Clairvoyance.java b/Mage.Sets/src/mage/sets/iceage/Clairvoyance.java index 997effb3bd1..c5cf6f7d4e7 100644 --- a/Mage.Sets/src/mage/sets/iceage/Clairvoyance.java +++ b/Mage.Sets/src/mage/sets/iceage/Clairvoyance.java @@ -28,19 +28,14 @@ package mage.sets.iceage; import java.util.UUID; -import mage.MageObject; -import mage.abilities.Ability; import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.LookAtTargetPlayerHandEffect; 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.players.Player; import mage.target.TargetPlayer; /** @@ -54,7 +49,7 @@ public class Clairvoyance extends CardImpl { this.expansionSetCode = "ICE"; // Look at target player's hand. - this.getSpellAbility().addEffect(new ClairvoyanceEffect()); + this.getSpellAbility().addEffect(new LookAtTargetPlayerHandEffect()); this.getSpellAbility().addTarget(new TargetPlayer()); // Draw a card at the beginning of the next turn's upkeep. @@ -71,32 +66,3 @@ public class Clairvoyance extends CardImpl { return new Clairvoyance(this); } } - -class ClairvoyanceEffect extends OneShotEffect { - - ClairvoyanceEffect() { - super(Outcome.DrawCard); - staticText = "Look at target player's hand"; - } - - ClairvoyanceEffect(final ClairvoyanceEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - MageObject sourceObject = source.getSourceObject(game); - if (player != null && controller != null && sourceObject != null) { - controller.lookAtCards(sourceObject.getIdName() + " (" + player.getName() + ")", player.getHand(), game); - } - return true; - } - - @Override - public ClairvoyanceEffect copy() { - return new ClairvoyanceEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/sets/newphyrexia/GitaxianProbe.java b/Mage.Sets/src/mage/sets/newphyrexia/GitaxianProbe.java index bf3054706e8..298ed67b7b6 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/GitaxianProbe.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/GitaxianProbe.java @@ -1,99 +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.newphyrexia; - -import java.util.UUID; -import mage.MageObject; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.DrawCardSourceControllerEffect; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.game.Game; -import mage.players.Player; -import mage.target.TargetPlayer; - -/** - * - * @author Loki - */ -public class GitaxianProbe extends CardImpl { - - public GitaxianProbe(UUID ownerId) { - super(ownerId, 35, "Gitaxian Probe", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{UP}"); - this.expansionSetCode = "NPH"; - - // Look at target player's hand. - this.getSpellAbility().addEffect(new GitaxianProbeEffect()); - this.getSpellAbility().addTarget(new TargetPlayer()); - // Draw a card. - this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); - - } - - public GitaxianProbe(final GitaxianProbe card) { - super(card); - } - - @Override - public GitaxianProbe copy() { - return new GitaxianProbe(this); - } - -} - -class GitaxianProbeEffect extends OneShotEffect { - - GitaxianProbeEffect() { - super(Outcome.DrawCard); - staticText = "Look at target player's hand"; - } - - GitaxianProbeEffect(final GitaxianProbeEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - MageObject sourceObject = source.getSourceObject(game); - if (player != null && controller != null && sourceObject != null) { - controller.lookAtCards(sourceObject.getIdName() + " (" + player.getName() + ")", player.getHand(), game); - } - return true; - } - - @Override - public GitaxianProbeEffect copy() { - return new GitaxianProbeEffect(this); - } - -} +/* + * 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.newphyrexia; + +import java.util.UUID; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.LookAtTargetPlayerHandEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author Loki + */ +public class GitaxianProbe extends CardImpl { + + public GitaxianProbe(UUID ownerId) { + super(ownerId, 35, "Gitaxian Probe", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{UP}"); + this.expansionSetCode = "NPH"; + + // Look at target player's hand. + this.getSpellAbility().addEffect(new LookAtTargetPlayerHandEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + + } + + public GitaxianProbe(final GitaxianProbe card) { + super(card); + } + + @Override + public GitaxianProbe copy() { + return new GitaxianProbe(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/onslaught/MagesGuile.java b/Mage.Sets/src/mage/sets/onslaught/MagesGuile.java new file mode 100644 index 00000000000..d8609439697 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/MagesGuile.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.CyclingAbility; +import mage.abilities.keyword.ShroudAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class MagesGuile extends CardImpl { + + public MagesGuile(UUID ownerId) { + super(ownerId, 91, "Mage's Guile", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); + this.expansionSetCode = "ONS"; + + // Target creature gains shroud until end of turn. + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(ShroudAbility.getInstance(), Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + // Cycling {U} + this.addAbility(new CyclingAbility(new ManaCostsImpl("{U}"))); + } + + public MagesGuile(final MagesGuile card) { + super(card); + } + + @Override + public MagesGuile copy() { + return new MagesGuile(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/IngeniousThief.java b/Mage.Sets/src/mage/sets/portal/IngeniousThief.java index d6e59b8c80d..37e244c39e5 100644 --- a/Mage.Sets/src/mage/sets/portal/IngeniousThief.java +++ b/Mage.Sets/src/mage/sets/portal/IngeniousThief.java @@ -29,17 +29,13 @@ package mage.sets.portal; import java.util.UUID; import mage.MageInt; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.LookAtTargetPlayerHandEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.game.Game; -import mage.players.Player; import mage.target.TargetPlayer; /** @@ -60,7 +56,7 @@ public class IngeniousThief extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // When Ingenious Thief enters the battlefield, look at target player's hand. - Ability ability = new EntersBattlefieldTriggeredAbility(new IngeniousThiefEffect(), false); + Ability ability = new EntersBattlefieldTriggeredAbility(new LookAtTargetPlayerHandEffect(), false); ability.addTarget(new TargetPlayer()); this.addAbility(ability); } @@ -74,32 +70,3 @@ public class IngeniousThief extends CardImpl { return new IngeniousThief(this); } } - -class IngeniousThiefEffect extends OneShotEffect { - - IngeniousThiefEffect() { - super(Outcome.Benefit); - staticText = "Look at target player's hand"; - } - - IngeniousThiefEffect(final IngeniousThiefEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - MageObject sourceObject = source.getSourceObject(game); - if (player != null && controller != null && sourceObject != null) { - controller.lookAtCards(sourceObject.getIdName() + " (" + player.getName() + ")", player.getHand(), game); - } - return true; - } - - @Override - public IngeniousThiefEffect copy() { - return new IngeniousThiefEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/sets/portal/SorcerousSight.java b/Mage.Sets/src/mage/sets/portal/SorcerousSight.java index a3eef859808..ebe908a5389 100644 --- a/Mage.Sets/src/mage/sets/portal/SorcerousSight.java +++ b/Mage.Sets/src/mage/sets/portal/SorcerousSight.java @@ -28,16 +28,12 @@ package mage.sets.portal; import java.util.UUID; -import mage.MageObject; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.LookAtTargetPlayerHandEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.game.Game; -import mage.players.Player; import mage.target.common.TargetOpponent; /** @@ -51,7 +47,9 @@ public class SorcerousSight extends CardImpl { this.expansionSetCode = "POR"; // Look at target opponent's hand. - this.getSpellAbility().addEffect(new SorcerousSightEffect()); + Effect effect = new LookAtTargetPlayerHandEffect(); + effect.setText("Look at target opponent's hand"); + this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetOpponent()); // Draw a card. @@ -67,32 +65,3 @@ public class SorcerousSight extends CardImpl { return new SorcerousSight(this); } } - -class SorcerousSightEffect extends OneShotEffect { - - SorcerousSightEffect() { - super(Outcome.DrawCard); - staticText = "Look at target opponent's hand"; - } - - SorcerousSightEffect(final SorcerousSightEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - MageObject sourceObject = source.getSourceObject(game); - if (player != null && controller != null && sourceObject != null) { - controller.lookAtCards(sourceObject.getIdName() + " (" + player.getName() + ")", player.getHand(), game); - } - return true; - } - - @Override - public SorcerousSightEffect copy() { - return new SorcerousSightEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/sets/tenthedition/Peek.java b/Mage.Sets/src/mage/sets/tenthedition/Peek.java index b4428101533..01a5efcb2e8 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/Peek.java +++ b/Mage.Sets/src/mage/sets/tenthedition/Peek.java @@ -1,98 +1,64 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.tenthedition; - -import java.util.UUID; -import mage.MageObject; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.DrawCardSourceControllerEffect; -import mage.cards.CardImpl; -import mage.constants.Outcome; -import mage.game.Game; -import mage.players.Player; -import mage.target.TargetPlayer; - -/** - * - * @author Loki - */ -public class Peek extends CardImpl { - - public Peek(UUID ownerId) { - super(ownerId, 94, "Peek", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); - this.expansionSetCode = "10E"; - - // Look at target player's hand. - this.getSpellAbility().addEffect(new PeekEffect()); - this.getSpellAbility().addTarget(new TargetPlayer()); - - // Draw a card. - this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); - } - - public Peek(final Peek card) { - super(card); - } - - @Override - public Peek copy() { - return new Peek(this); - } -} - -class PeekEffect extends OneShotEffect { - PeekEffect() { - super(Outcome.Detriment); - staticText = "look at target player's hand"; - } - - PeekEffect(final PeekEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - MageObject sourceObject = source.getSourceObject(game); - if (player != null && controller != null && sourceObject != null) { - controller.lookAtCards(sourceObject.getIdName() + " " + player.getName() + " (" + game.getTurnNum()+"|"+game.getPhase().getType() +")", player.getHand(), game); - } - return true; - } - - @Override - public PeekEffect copy() { - return new PeekEffect(this); - } - -} +/* + * 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.tenthedition; + +import java.util.UUID; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.LookAtTargetPlayerHandEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author Loki + */ +public class Peek extends CardImpl { + + public Peek(UUID ownerId) { + super(ownerId, 94, "Peek", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "10E"; + + // Look at target player's hand. + this.getSpellAbility().addEffect(new LookAtTargetPlayerHandEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + } + + public Peek(final Peek card) { + super(card); + } + + @Override + public Peek copy() { + return new Peek(this); + } +}