From c5bf01b3081eafc92777deb82b197e757e8fdf46 Mon Sep 17 00:00:00 2001 From: BetaSteward Date: Sun, 2 May 2010 15:16:50 +0000 Subject: [PATCH] ... --- Mage.Sets/src/mage/sets/Conflux.java | 1 + Mage.Sets/src/mage/sets/Worldwake.java | 1 + .../src/mage/sets/alarareborn/FinestHour.java | 4 +- .../src/mage/sets/conflux/FontOfMythos.java | 4 +- .../mage/sets/conflux/HellsparkElemental.java | 2 +- .../src/mage/sets/conflux/QuenchableFire.java | 133 ++++++++++++++++++ .../src/mage/sets/magic2010/HowlingMine.java | 4 +- .../src/mage/sets/planechase/SoulWarden.java | 7 +- .../mage/sets/shardsofalara/HellsThunder.java | 2 +- .../shardsofalara/KnightOfTheWhiteOrchid.java | 4 +- .../sets/shardsofalara/RafiqOfTheMany.java | 6 +- .../mage/sets/worldwake/LavaclawReaches.java | 79 +++++++++++ .../src/mage/sets/worldwake/SearingBlaze.java | 9 +- .../src/mage/sets/zendikar/ArchiveTrap.java | 6 +- .../src/mage/sets/zendikar/GoblinGuide.java | 4 + .../src/mage/sets/zendikar/ScuteMob.java | 4 +- 16 files changed, 254 insertions(+), 16 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/conflux/QuenchableFire.java create mode 100644 Mage.Sets/src/mage/sets/worldwake/LavaclawReaches.java diff --git a/Mage.Sets/src/mage/sets/Conflux.java b/Mage.Sets/src/mage/sets/Conflux.java index 2ca4ec7275..b528b92e0a 100644 --- a/Mage.Sets/src/mage/sets/Conflux.java +++ b/Mage.Sets/src/mage/sets/Conflux.java @@ -51,6 +51,7 @@ public class Conflux extends ExpansionSet { this.cards.add(MartialCoup.class); this.cards.add(NobleHierarch.class); this.cards.add(PathToExile.class); + this.cards.add(QuenchableFire.class); this.cards.add(Thornling.class); } diff --git a/Mage.Sets/src/mage/sets/Worldwake.java b/Mage.Sets/src/mage/sets/Worldwake.java index f13f2b66f9..3dbdd93c45 100644 --- a/Mage.Sets/src/mage/sets/Worldwake.java +++ b/Mage.Sets/src/mage/sets/Worldwake.java @@ -47,6 +47,7 @@ public class Worldwake extends ExpansionSet { this.name = "Worldwake"; this.cards.add(BasiliskCollar.class); this.cards.add(CelestialColonnade.class); + this.cards.add(LavaclawReaches.class); this.cards.add(RagingRavine.class); this.cards.add(SearingBlaze.class); this.cards.add(SejiriSteppe.class); diff --git a/Mage.Sets/src/mage/sets/alarareborn/FinestHour.java b/Mage.Sets/src/mage/sets/alarareborn/FinestHour.java index 341705e561..09c6245c4c 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/FinestHour.java +++ b/Mage.Sets/src/mage/sets/alarareborn/FinestHour.java @@ -71,16 +71,18 @@ class FinestHourAbility extends TriggeredAbilityImpl { } @Override - public void checkTrigger(GameEvent event, Game game) { + public boolean checkTrigger(GameEvent event, Game game) { if (checkIfClause(game) && game.getActivePlayerId().equals(this.controllerId)) { if (event.getType() == EventType.DECLARED_ATTACKERS) { if (game.getCombat().attacksAlone()) { this.targets.add(new TargetCreaturePermanent()); this.targets.get(0).getTargets().add(game.getCombat().getAttackers().get(0)); trigger(game, event.getPlayerId()); + return true; } } } + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/conflux/FontOfMythos.java b/Mage.Sets/src/mage/sets/conflux/FontOfMythos.java index 502726944a..6942b6a90d 100644 --- a/Mage.Sets/src/mage/sets/conflux/FontOfMythos.java +++ b/Mage.Sets/src/mage/sets/conflux/FontOfMythos.java @@ -62,12 +62,14 @@ class FontOfMythosAbility extends TriggeredAbilityImpl { } @Override - public void checkTrigger(GameEvent event, Game game) { + public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == EventType.DRAW_STEP_PRE) { this.targets.add(new TargetPlayer()); this.targets.get(0).getTargets().add(event.getPlayerId()); trigger(game, event.getPlayerId()); + return true; } + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/conflux/HellsparkElemental.java b/Mage.Sets/src/mage/sets/conflux/HellsparkElemental.java index 33f0d4eff6..8273c920e5 100644 --- a/Mage.Sets/src/mage/sets/conflux/HellsparkElemental.java +++ b/Mage.Sets/src/mage/sets/conflux/HellsparkElemental.java @@ -51,7 +51,7 @@ public class HellsparkElemental extends CardImpl { this.expansionSetId = Conflux.getInstance().getId(); this.subtype.add("Elemental"); this.color.setRed(true); - this.art = ""; + this.art = "118669_typ_reg_sty_010.jpg"; this.power = new MageInt(3); this.toughness = new MageInt(1); diff --git a/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java b/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java new file mode 100644 index 0000000000..2511f00384 --- /dev/null +++ b/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java @@ -0,0 +1,133 @@ +/* + * 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.conflux; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.SpecialAction; +import mage.abilities.costs.mana.ManaCosts; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.RemoveDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.RemoveSpecialActionEffect; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.sets.Conflux; +import mage.target.TargetPlayer; + +/** + * + * @author BetaSteward_at_googlemail.com + */ +public class QuenchableFire extends CardImpl { + + public QuenchableFire(UUID ownerId) { + super(ownerId, "Quenchable Fire", new CardType[]{CardType.SORCERY}, "{3}{R}"); + this.expansionSetId = Conflux.getInstance().getId(); + this.color.setRed(true); + this.art = "118698_typ_reg_sty_010.jpg"; + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new DamageTargetEffect(3)); + this.getSpellAbility().addEffect(new QuenchableFireEffect()); + } + +} + +class QuenchableFireEffect extends OneShotEffect { + + public QuenchableFireEffect() { + super(Outcome.Damage); + } + + @Override + public boolean apply(Game game) { + //create delayed triggereda ability + QuenchableFireDelayedTriggeredAbility delayedAbility = new QuenchableFireDelayedTriggeredAbility(); + delayedAbility.setSourceId(this.source.getSourceId()); + delayedAbility.setControllerId(this.source.getControllerId()); + delayedAbility.getTargets().addAll(this.source.getTargets()); + game.getState().addDelayedTriggeredAbility(delayedAbility); + //create special action + QuenchableFireSpecialAction newAction = new QuenchableFireSpecialAction(delayedAbility.getId()); + delayedAbility.setSpecialActionId(newAction.getId()); + newAction.setSourceId(this.source.getSourceId()); + newAction.setControllerId(this.source.getFirstTarget()); + newAction.getTargets().addAll(this.source.getTargets()); + game.getState().getSpecialActions().add(newAction); + return true; + } + +} + +class QuenchableFireDelayedTriggeredAbility extends DelayedTriggeredAbility { + + private UUID specialActionId; + + public QuenchableFireDelayedTriggeredAbility() { + super(new DamageTargetEffect(3)); + } + + public void setSpecialActionId(UUID specialActionId) { + this.specialActionId = specialActionId; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { + trigger(game, event.getPlayerId()); + for (SpecialAction action: game.getState().getSpecialActions()) { + if (action.getId().equals(specialActionId)) { + game.getState().getSpecialActions().remove(action); + break; + } + } + return true; + } + return false; + } + + @Override + public String getRule() { + return "{this} deals an additional 3 damage to that player at the beginning of your next upkeep step unless he or she pays {U} before that step"; + } + +} + +class QuenchableFireSpecialAction extends SpecialAction { + + public QuenchableFireSpecialAction(UUID effectId) { + this.addCost(new ManaCosts("{U}")); + this.addEffect(new RemoveDelayedTriggeredAbilityEffect(effectId)); + this.addEffect(new RemoveSpecialActionEffect(this.getId())); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java b/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java index 5c5197d17d..3a2ba09cbf 100644 --- a/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java +++ b/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java @@ -62,12 +62,14 @@ class HowlingMineAbility extends TriggeredAbilityImpl { } @Override - public void checkTrigger(GameEvent event, Game game) { + public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == EventType.DRAW_STEP_PRE) { this.targets.add(new TargetPlayer()); this.targets.get(0).getTargets().add(event.getPlayerId()); trigger(game, event.getPlayerId()); + return true; } + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/planechase/SoulWarden.java b/Mage.Sets/src/mage/sets/planechase/SoulWarden.java index b56aa05c82..6472de8065 100644 --- a/Mage.Sets/src/mage/sets/planechase/SoulWarden.java +++ b/Mage.Sets/src/mage/sets/planechase/SoulWarden.java @@ -69,12 +69,15 @@ class SoulWardenAbility extends TriggeredAbilityImpl { } @Override - public void checkTrigger(GameEvent event, Game game) { + public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).getToZone() == Zone.BATTLEFIELD) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent.getCardType().contains(CardType.CREATURE) && !permanent.getId().equals(this.getSourceId())) + if (permanent.getCardType().contains(CardType.CREATURE) && !permanent.getId().equals(this.getSourceId())) { trigger(game, this.controllerId); + return true; + } } + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/shardsofalara/HellsThunder.java b/Mage.Sets/src/mage/sets/shardsofalara/HellsThunder.java index e05cad7c09..2039b3582b 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/HellsThunder.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/HellsThunder.java @@ -52,7 +52,7 @@ public class HellsThunder extends CardImpl { this.expansionSetId = ShardsOfAlara.getInstance().getId(); this.subtype.add("Elemental"); this.color.setRed(true); - this.art = ""; + this.art = "115234_typ_reg_sty_010.jpg"; this.power = new MageInt(4); this.toughness = new MageInt(4); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/KnightOfTheWhiteOrchid.java b/Mage.Sets/src/mage/sets/shardsofalara/KnightOfTheWhiteOrchid.java index b6ccaffc7b..5cdd4e1c52 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/KnightOfTheWhiteOrchid.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/KnightOfTheWhiteOrchid.java @@ -79,13 +79,15 @@ class KnightOfTheWhiteOrchidAbility extends EntersBattlefieldTriggeredAbility { } @Override - public void checkTrigger(GameEvent event, Game game) { + public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId()) ) { ZoneChangeEvent zEvent = (ZoneChangeEvent)event; if (zEvent.getToZone() == Zone.BATTLEFIELD) { trigger(game, this.controllerId); + return true; } } + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/shardsofalara/RafiqOfTheMany.java b/Mage.Sets/src/mage/sets/shardsofalara/RafiqOfTheMany.java index c6b2ba5f2e..432d0cac9c 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/RafiqOfTheMany.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/RafiqOfTheMany.java @@ -75,14 +75,16 @@ class RafiqOfTheManyAbility extends TriggeredAbilityImpl { } @Override - public void checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DECLARED_ATTACKERS ) { + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.DECLARED_ATTACKERS && game.getActivePlayerId().equals(this.controllerId) ) { if (game.getCombat().attacksAlone()) { this.targets.add(new TargetCreaturePermanent()); this.targets.get(0).getTargets().add(game.getCombat().getAttackers().get(0)); trigger(game, event.getPlayerId()); + return true; } } + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/worldwake/LavaclawReaches.java b/Mage.Sets/src/mage/sets/worldwake/LavaclawReaches.java new file mode 100644 index 0000000000..b27926dfe7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/worldwake/LavaclawReaches.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.sets.worldwake; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldStaticAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCosts; +import mage.abilities.effects.common.BecomesCreatureSourceEOTEffect; +import mage.abilities.effects.common.BoostPowerSourceVariableEffect; +import mage.abilities.effects.common.EntersBattlefieldTappedEffect; +import mage.abilities.mana.BlackManaAbility; +import mage.abilities.mana.RedManaAbility; +import mage.cards.CardImpl; +import mage.game.permanent.token.Token; +import mage.sets.Worldwake; + +/** + * + * @author BetaSteward_at_googlemail.com + */ +public class LavaclawReaches extends CardImpl { + + public LavaclawReaches(UUID ownerId) { + super(ownerId, "Lavaclaw Reaches", new CardType[]{CardType.LAND}, null); + this.expansionSetId = Worldwake.getInstance().getId(); + this.art = "126532_typ_reg_sty_010.jpg"; + this.addAbility(new EntersBattlefieldStaticAbility(new EntersBattlefieldTappedEffect())); + this.addAbility(new BlackManaAbility()); + this.addAbility(new RedManaAbility()); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEOTEffect(new LavaclawReachesToken()), new ManaCosts("{1}{B}{R}"))); + } + +} + +class LavaclawReachesToken extends Token { + + public LavaclawReachesToken() { + super("", "2/2 black and red Elemental creature with \"{X}: This creature gets +X/+0 until end of turn.\""); + cardType.add(CardType.CREATURE); + subtype.add("Elemental"); + color.setRed(true); + color.setBlack(true); + power = new MageInt(2); + toughness = new MageInt(2); + addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostPowerSourceVariableEffect(Duration.EndOfTurn), new ManaCosts("{X}"))); + } + +} diff --git a/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java b/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java index 39d6343878..f80e77fb05 100644 --- a/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java +++ b/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java @@ -54,10 +54,11 @@ public class SearingBlaze extends CardImpl { super(ownerId, "Searing Blaze", new CardType[]{CardType.INSTANT}, "{R}{R}"); this.expansionSetId = Worldwake.getInstance().getId(); this.color.setRed(true); - this.art = ""; + this.art = "126476_typ_reg_sty_010.jpg"; this.getSpellAbility().addTarget(new TargetPlayer()); //TODO: change this to only allow creatures controlled by first target this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new SearingBlazeEffect()); this.watchers.add(new SearingBlazeWatcher(ownerId)); } @@ -66,7 +67,7 @@ public class SearingBlaze extends CardImpl { class SearingBlazeWatcher extends WatcherImpl { public SearingBlazeWatcher(UUID controllerId) { - super(controllerId, "LandPlayed"); + super("LandPlayed"); } @Override @@ -107,4 +108,8 @@ class SearingBlazeEffect extends OneShotEffect { return true; } + @Override + public String getText() { + return "{this} deals 1 damage to target player and 1 damage to target creature that player controls. \nLandfall — If you had a land enter the battlefield under your control this turn, {this} deals 3 damage to that player and 3 damage to that creature instead."; + } } diff --git a/Mage.Sets/src/mage/sets/zendikar/ArchiveTrap.java b/Mage.Sets/src/mage/sets/zendikar/ArchiveTrap.java index 69143ff9dc..a947a11373 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ArchiveTrap.java +++ b/Mage.Sets/src/mage/sets/zendikar/ArchiveTrap.java @@ -56,15 +56,15 @@ public class ArchiveTrap extends CardImpl { this.getSpellAbility().addTarget(new TargetOpponent()); this.getSpellAbility().addEffect(new PutLibraryIntoGraveTargetEffect(13)); this.getSpellAbility().addAlternativeCost(new ArchiveTrapAlternativeCost()); - this.watchers.add(new ArchiveTrapWatcher(ownerId)); + this.watchers.add(new ArchiveTrapWatcher()); } } class ArchiveTrapWatcher extends WatcherImpl { - public ArchiveTrapWatcher(UUID controllerId) { - super(controllerId, "LibrarySearched"); + public ArchiveTrapWatcher() { + super("LibrarySearched"); } @Override diff --git a/Mage.Sets/src/mage/sets/zendikar/GoblinGuide.java b/Mage.Sets/src/mage/sets/zendikar/GoblinGuide.java index 34193179f7..512dc55687 100644 --- a/Mage.Sets/src/mage/sets/zendikar/GoblinGuide.java +++ b/Mage.Sets/src/mage/sets/zendikar/GoblinGuide.java @@ -96,4 +96,8 @@ class GoblinGuideEffect extends OneShotEffect { return false; } + @Override + public String getText() { + return "defending player reveals the top card of his or her library. If it's a land card, that player puts it into his or her hand"; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/ScuteMob.java b/Mage.Sets/src/mage/sets/zendikar/ScuteMob.java index 5a235c7ff7..afbcc1bd9f 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ScuteMob.java +++ b/Mage.Sets/src/mage/sets/zendikar/ScuteMob.java @@ -69,10 +69,12 @@ class ScuteMobAbility extends TriggeredAbilityImpl { } @Override - public void checkTrigger(GameEvent event, Game game) { + public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { trigger(game, this.controllerId); + return true; } + return false; } @Override