From 3c8c439d19b27c41b35f7b367fce0c5c627c926e Mon Sep 17 00:00:00 2001 From: fireshoes Date: Wed, 26 Aug 2015 12:58:26 -0500 Subject: [PATCH] Cleaned up some of the cards from earlier and related cards. --- .../src/mage/sets/alliances/Burnout.java | 13 +- .../mage/sets/antiquities/GateToPhyrexia.java | 7 - .../darkascension/FalkenrathAristocrat.java | 234 +++++++-------- Mage.Sets/src/mage/sets/iceage/Icequake.java | 203 +++++++------ Mage.Sets/src/mage/sets/iceage/Pyroblast.java | 274 +++++++++--------- .../sets/masterseditionii/EbonPraetor.java | 2 +- .../sets/masterseditionii/Thermokarst.java | 5 +- .../mage/sets/mercadianmasques/CaveSense.java | 8 +- .../mercadianmasques/HauntedCrossroads.java | 4 +- .../sets/mercadianmasques/TigerClaws.java | 8 +- .../src/mage/sets/thedark/ScarwoodHag.java | 5 +- 11 files changed, 382 insertions(+), 381 deletions(-) diff --git a/Mage.Sets/src/mage/sets/alliances/Burnout.java b/Mage.Sets/src/mage/sets/alliances/Burnout.java index 746f36cd8de..e0c33b0a1c1 100644 --- a/Mage.Sets/src/mage/sets/alliances/Burnout.java +++ b/Mage.Sets/src/mage/sets/alliances/Burnout.java @@ -30,6 +30,7 @@ package mage.sets.alliances; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; @@ -41,6 +42,7 @@ import mage.constants.Rarity; import mage.filter.FilterSpell; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; +import mage.game.stack.Spell; import mage.target.TargetSpell; /** @@ -60,8 +62,10 @@ public class Burnout extends CardImpl { this.expansionSetCode = "ALL"; // Counter target instant spell if it's blue. + Effect effect = new BurnoutCounterTargetEffect(); + effect.setText("Counter target instant spell if it's blue"); this.getSpellAbility().addTarget(new TargetSpell(filter)); - this.getSpellAbility().addEffect(new BurnoutCounterTargetEffect()); + this.getSpellAbility().addEffect(effect); // Draw a card at the beginning of the next turn's upkeep. this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( @@ -95,13 +99,10 @@ class BurnoutCounterTargetEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - if(game.getStack().getSpell(source.getFirstTarget()).getColor(game).isBlue()){ + Spell targetSpell = game.getStack().getSpell(source.getFirstTarget()); + if(targetSpell != null && targetSpell.getColor(game).isBlue()){ game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); } return true; } - - public String getText(Ability source) { - return "Counter target instant spell if it's blue"; - } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/antiquities/GateToPhyrexia.java b/Mage.Sets/src/mage/sets/antiquities/GateToPhyrexia.java index ca2291a5eb5..1d2a88c9abc 100644 --- a/Mage.Sets/src/mage/sets/antiquities/GateToPhyrexia.java +++ b/Mage.Sets/src/mage/sets/antiquities/GateToPhyrexia.java @@ -91,11 +91,4 @@ class GateToPhyrexiaAbility extends LimitedTimesPerTurnActivatedAbility { } return super.canActivate(playerId, game); } - - @Override - public String getRule() { - StringBuilder sb = new StringBuilder(""); - sb.append(super.getRule()).append(" Activate this ability only during your upkeep."); - return sb.toString(); - } } diff --git a/Mage.Sets/src/mage/sets/darkascension/FalkenrathAristocrat.java b/Mage.Sets/src/mage/sets/darkascension/FalkenrathAristocrat.java index f31b0642508..75e242e0968 100644 --- a/Mage.Sets/src/mage/sets/darkascension/FalkenrathAristocrat.java +++ b/Mage.Sets/src/mage/sets/darkascension/FalkenrathAristocrat.java @@ -1,117 +1,117 @@ -/* - * 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.darkascension; - -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.SimpleActivatedAbility; -import mage.abilities.costs.Cost; -import mage.abilities.costs.common.SacrificeTargetCost; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.keyword.FlyingAbility; -import mage.abilities.keyword.HasteAbility; -import mage.abilities.keyword.IndestructibleAbility; -import mage.cards.CardImpl; -import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.target.common.TargetControlledCreaturePermanent; - -/** - * - * @author North - */ -public class FalkenrathAristocrat extends CardImpl { - - public FalkenrathAristocrat(UUID ownerId) { - super(ownerId, 138, "Falkenrath Aristocrat", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{B}{R}"); - this.expansionSetCode = "DKA"; - this.subtype.add("Vampire"); - - this.power = new MageInt(4); - this.toughness = new MageInt(1); - - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(HasteAbility.getInstance()); - // Sacrifice a creature: Falkenrath Aristocrat is indestructible this turn. - // If the sacrificed creature was a Human, put a +1/+1 counter on Falkenrath Aristocrat. - SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn), - new SacrificeTargetCost(new TargetControlledCreaturePermanent())); - ability.addEffect(new FalkenrathAristocratEffect()); - this.addAbility(ability); - } - - public FalkenrathAristocrat(final FalkenrathAristocrat card) { - super(card); - } - - @Override - public FalkenrathAristocrat copy() { - return new FalkenrathAristocrat(this); - } -} - -class FalkenrathAristocratEffect extends OneShotEffect { - - public FalkenrathAristocratEffect() { - super(Outcome.BoostCreature); - this.staticText = "If the sacrificed creature was a Human, put a +1/+1 counter on {this}"; - } - - public FalkenrathAristocratEffect(final FalkenrathAristocratEffect effect) { - super(effect); - } - - @Override - public FalkenrathAristocratEffect copy() { - return new FalkenrathAristocratEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - for (Cost cost : source.getCosts()) { - if (cost instanceof SacrificeTargetCost) { - Permanent sacrificedCreature = ((SacrificeTargetCost) cost).getPermanents().get(0); - Permanent sourceCreature = game.getPermanent(source.getSourceId()); - if (sacrificedCreature.hasSubtype("Human") && sourceCreature != null) { - sourceCreature.addCounters(CounterType.P1P1.createInstance(), game); - return true; - } - } - } - return false; - } -} +/* + * 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.darkascension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author North + */ +public class FalkenrathAristocrat extends CardImpl { + + public FalkenrathAristocrat(UUID ownerId) { + super(ownerId, 138, "Falkenrath Aristocrat", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{B}{R}"); + this.expansionSetCode = "DKA"; + this.subtype.add("Vampire"); + + this.power = new MageInt(4); + this.toughness = new MageInt(1); + + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(HasteAbility.getInstance()); + // Sacrifice a creature: Falkenrath Aristocrat is indestructible this turn. + // If the sacrificed creature was a Human, put a +1/+1 counter on Falkenrath Aristocrat. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn), + new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addEffect(new FalkenrathAristocratEffect()); + this.addAbility(ability); + } + + public FalkenrathAristocrat(final FalkenrathAristocrat card) { + super(card); + } + + @Override + public FalkenrathAristocrat copy() { + return new FalkenrathAristocrat(this); + } +} + +class FalkenrathAristocratEffect extends OneShotEffect { + + public FalkenrathAristocratEffect() { + super(Outcome.BoostCreature); + this.staticText = "If the sacrificed creature was a Human, put a +1/+1 counter on {this}"; + } + + public FalkenrathAristocratEffect(final FalkenrathAristocratEffect effect) { + super(effect); + } + + @Override + public FalkenrathAristocratEffect copy() { + return new FalkenrathAristocratEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (Cost cost : source.getCosts()) { + if (cost instanceof SacrificeTargetCost) { + Permanent sacrificedCreature = ((SacrificeTargetCost) cost).getPermanents().get(0); + Permanent sourceCreature = game.getPermanent(source.getSourceId()); + if (sacrificedCreature.hasSubtype("Human") && sourceCreature != null) { + sourceCreature.addCounters(CounterType.P1P1.createInstance(), game); + return true; + } + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Icequake.java b/Mage.Sets/src/mage/sets/iceage/Icequake.java index d2cfa144f78..378e27cbc21 100644 --- a/Mage.Sets/src/mage/sets/iceage/Icequake.java +++ b/Mage.Sets/src/mage/sets/iceage/Icequake.java @@ -1,103 +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.iceage; - -import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.common.TargetLandPermanent; - - -/** - * - * @author fireshoes - */ -public class Icequake extends CardImpl { - - public Icequake(UUID ownerId) { - super(ownerId, 22, "Icequake", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{B}{B}"); - this.expansionSetCode = "ICE"; - - // Destroy target land. - // If that land was a snow land, Icequake deals 1 damage to that land's controller. - this.getSpellAbility().addEffect(new IcequakeEffect()); - this.getSpellAbility().addTarget(new TargetLandPermanent()); - - - } - - public Icequake(final Icequake card) { - super(card); - } - - @Override - public Icequake copy() { - return new Icequake(this); - } -} - -class IcequakeEffect extends OneShotEffect { - - public IcequakeEffect() { - super(Outcome.Damage); - this.staticText = "Destroy target land.
If that land was a snow land, {this} deals 1 damage to that land's controller."; - } - - public IcequakeEffect(final IcequakeEffect effect) { - super(effect); - } - - @Override - public IcequakeEffect copy() { - return new IcequakeEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); - if (permanent != null && controller != null) { - permanent.destroy(source.getSourceId(), game, false); - if (permanent.getSupertype().contains("Snow")) { - Player player = game.getPlayer(permanent.getControllerId()); - if (player != null) { - player.damage(1, source.getSourceId(), game, false, true); - } - } - return true; - } - return false; - } -} +/* + * 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.iceage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetLandPermanent; + + +/** + * + * @author fireshoes + */ +public class Icequake extends CardImpl { + + public Icequake(UUID ownerId) { + super(ownerId, 22, "Icequake", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{B}{B}"); + this.expansionSetCode = "ICE"; + + // Destroy target land. + // If that land was a snow land, Icequake deals 1 damage to that land's controller. + this.getSpellAbility().addEffect(new IcequakeEffect()); + this.getSpellAbility().addTarget(new TargetLandPermanent()); + + + } + + public Icequake(final Icequake card) { + super(card); + } + + @Override + public Icequake copy() { + return new Icequake(this); + } +} + +class IcequakeEffect extends OneShotEffect { + + public IcequakeEffect() { + super(Outcome.Damage); + this.staticText = "Destroy target land.
If that land was a snow land, {this} deals 1 damage to that land's controller."; + } + + public IcequakeEffect(final IcequakeEffect effect) { + super(effect); + } + + @Override + public IcequakeEffect copy() { + return new IcequakeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (permanent != null && controller != null) { + permanent.destroy(source.getSourceId(), game, false); + if (permanent.getSupertype().contains("Snow")) { + controller.damage(1, source.getSourceId(), game, false, true); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Pyroblast.java b/Mage.Sets/src/mage/sets/iceage/Pyroblast.java index 04784cb21bf..3dc67daee7c 100644 --- a/Mage.Sets/src/mage/sets/iceage/Pyroblast.java +++ b/Mage.Sets/src/mage/sets/iceage/Pyroblast.java @@ -1,136 +1,138 @@ -/* - * 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.iceage; - -import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.Mode; -import mage.abilities.effects.OneShotEffect; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.target.TargetPermanent; -import mage.target.TargetSpell; - -/** - * - * @author Plopman - */ -public class Pyroblast extends CardImpl { - - public Pyroblast(UUID ownerId) { - super(ownerId, 213, "Pyroblast", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); - this.expansionSetCode = "ICE"; - - - // Choose one - Counter target spell if it's blue; or destroy target permanent if it's blue. - this.getSpellAbility().addEffect(new PyroblastCounterTargetEffect()); - this.getSpellAbility().addTarget(new TargetSpell()); - - Mode mode = new Mode(); - mode.getEffects().add(new DestroyTargetEffect()); - mode.getTargets().add(new TargetPermanent()); - - this.getSpellAbility().addMode(mode); - } - - public Pyroblast(final Pyroblast card) { - super(card); - } - - @Override - public Pyroblast copy() { - return new Pyroblast(this); - } -} - -class PyroblastCounterTargetEffect extends OneShotEffect { - - public PyroblastCounterTargetEffect() { - super(Outcome.Detriment); - } - - public PyroblastCounterTargetEffect(final PyroblastCounterTargetEffect effect) { - super(effect); - } - - @Override - public PyroblastCounterTargetEffect copy() { - return new PyroblastCounterTargetEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - if(game.getStack().getSpell(source.getFirstTarget()).getColor(game).isBlue()){ - game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); - } - return true; - } - - @Override - public String getText(Mode mode) { - return "Counter target spell if it's blue"; - } - -} - - -class DestroyTargetEffect extends OneShotEffect { - - - public DestroyTargetEffect() { - super(Outcome.DestroyPermanent); - } - - public DestroyTargetEffect(final DestroyTargetEffect effect) { - super(effect); - } - - @Override - public DestroyTargetEffect copy() { - return new DestroyTargetEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget()); - if (permanent != null && permanent.getColor(game).isBlue()) { - permanent.destroy(source.getSourceId(), game, false); - } - return true; - } - - @Override - public String getText(Mode mode) { - return "Destroy target permanent if it's blue"; - } - -} +/* + * 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.iceage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.target.TargetPermanent; +import mage.target.TargetSpell; + +/** + * + * @author Plopman + */ +public class Pyroblast extends CardImpl { + + public Pyroblast(UUID ownerId) { + super(ownerId, 213, "Pyroblast", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); + this.expansionSetCode = "ICE"; + + + // Choose one - Counter target spell if it's blue; or destroy target permanent if it's blue. + this.getSpellAbility().addEffect(new PyroblastCounterTargetEffect()); + this.getSpellAbility().addTarget(new TargetSpell()); + + Mode mode = new Mode(); + mode.getEffects().add(new DestroyTargetEffect()); + mode.getTargets().add(new TargetPermanent()); + + this.getSpellAbility().addMode(mode); + } + + public Pyroblast(final Pyroblast card) { + super(card); + } + + @Override + public Pyroblast copy() { + return new Pyroblast(this); + } +} + +class PyroblastCounterTargetEffect extends OneShotEffect { + + public PyroblastCounterTargetEffect() { + super(Outcome.Detriment); + } + + public PyroblastCounterTargetEffect(final PyroblastCounterTargetEffect effect) { + super(effect); + } + + @Override + public PyroblastCounterTargetEffect copy() { + return new PyroblastCounterTargetEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell targetSpell = game.getStack().getSpell(source.getFirstTarget()); + if(targetSpell != null && targetSpell.getColor(game).isBlue()){ + game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); + } + return true; + } + + @Override + public String getText(Mode mode) { + return "Counter target spell if it's blue"; + } + +} + + +class DestroyTargetEffect extends OneShotEffect { + + + public DestroyTargetEffect() { + super(Outcome.DestroyPermanent); + } + + public DestroyTargetEffect(final DestroyTargetEffect effect) { + super(effect); + } + + @Override + public DestroyTargetEffect copy() { + return new DestroyTargetEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget()); + if (permanent != null && permanent.getColor(game).isBlue()) { + permanent.destroy(source.getSourceId(), game, false); + } + return true; + } + + @Override + public String getText(Mode mode) { + return "Destroy target permanent if it's blue"; + } + +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/EbonPraetor.java b/Mage.Sets/src/mage/sets/masterseditionii/EbonPraetor.java index 4aac7c7bd1e..9b7905996ea 100644 --- a/Mage.Sets/src/mage/sets/masterseditionii/EbonPraetor.java +++ b/Mage.Sets/src/mage/sets/masterseditionii/EbonPraetor.java @@ -151,6 +151,6 @@ class EbonPraetorEffect extends OneShotEffect { } } } - return false; + return true; } } diff --git a/Mage.Sets/src/mage/sets/masterseditionii/Thermokarst.java b/Mage.Sets/src/mage/sets/masterseditionii/Thermokarst.java index 08305c042c1..b555221479c 100644 --- a/Mage.Sets/src/mage/sets/masterseditionii/Thermokarst.java +++ b/Mage.Sets/src/mage/sets/masterseditionii/Thermokarst.java @@ -87,10 +87,7 @@ class ThermokarstEffect extends OneShotEffect { if (permanent != null && controller != null) { permanent.destroy(source.getSourceId(), game, false); if (permanent.getSupertype().contains("Snow")) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.gainLife(1, game); - } + controller.gainLife(1, game); } return true; } diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/CaveSense.java b/Mage.Sets/src/mage/sets/mercadianmasques/CaveSense.java index e04760cb837..91bddccba45 100644 --- a/Mage.Sets/src/mage/sets/mercadianmasques/CaveSense.java +++ b/Mage.Sets/src/mage/sets/mercadianmasques/CaveSense.java @@ -30,6 +30,7 @@ package mage.sets.mercadianmasques; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; @@ -63,8 +64,11 @@ public class CaveSense extends CardImpl { this.addAbility(ability); // Enchanted creature gets +1/+1 and has mountainwalk. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new MountainwalkAbility(), AttachmentType.AURA))); + Effect effect = new GainAbilityAttachedEffect(new MountainwalkAbility(), AttachmentType.AURA); + effect.setText("and has mountainwalk"); + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1)); + ability.addEffect(effect); + this.addAbility(ability); } public CaveSense(final CaveSense card) { diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/HauntedCrossroads.java b/Mage.Sets/src/mage/sets/mercadianmasques/HauntedCrossroads.java index 47af6159d29..dbeedd47928 100644 --- a/Mage.Sets/src/mage/sets/mercadianmasques/HauntedCrossroads.java +++ b/Mage.Sets/src/mage/sets/mercadianmasques/HauntedCrossroads.java @@ -37,7 +37,7 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; -import mage.target.common.TargetCardInGraveyard; +import mage.target.common.TargetCardInYourGraveyard; /** * @@ -51,7 +51,7 @@ public class HauntedCrossroads extends CardImpl { // {B}: Put target creature card from your graveyard on top of your library. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutOnLibraryTargetEffect(true), new ManaCostsImpl("{B}")); - ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card from your graveyard"))); + ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard"))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/TigerClaws.java b/Mage.Sets/src/mage/sets/mercadianmasques/TigerClaws.java index f18c186b97c..1de3906ba4b 100644 --- a/Mage.Sets/src/mage/sets/mercadianmasques/TigerClaws.java +++ b/Mage.Sets/src/mage/sets/mercadianmasques/TigerClaws.java @@ -30,6 +30,7 @@ package mage.sets.mercadianmasques; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; @@ -67,8 +68,11 @@ public class TigerClaws extends CardImpl { this.addAbility(ability); // Enchanted creature gets +1/+1 and has trample. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.AURA))); + Effect effect = new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.AURA); + effect.setText("and has trample"); + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1)); + ability.addEffect(effect); + this.addAbility(ability); } public TigerClaws(final TigerClaws card) { diff --git a/Mage.Sets/src/mage/sets/thedark/ScarwoodHag.java b/Mage.Sets/src/mage/sets/thedark/ScarwoodHag.java index 28b56da4c86..823a74756b8 100644 --- a/Mage.Sets/src/mage/sets/thedark/ScarwoodHag.java +++ b/Mage.Sets/src/mage/sets/thedark/ScarwoodHag.java @@ -33,6 +33,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.effects.common.continuous.LoseAbilityTargetEffect; import mage.abilities.keyword.ForestwalkAbility; @@ -65,8 +66,10 @@ public class ScarwoodHag extends CardImpl { this.addAbility(ability); // {tap}: Target creature loses forestwalk until end of turn. + Effect effect = new LoseAbilityTargetEffect(new ForestwalkAbility(true), Duration.EndOfTurn); + effect.setText("Target creature loses forestwalk until end of turn"); ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new LoseAbilityTargetEffect(new ForestwalkAbility(false), Duration.EndOfTurn), + effect, new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability);