From 4d3d76e8e90d35bb08536c2b1fedbb9b55f49d99 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 22 Jun 2013 19:36:16 +0200 Subject: [PATCH] Changed some modal spells to the new handling of modal spells. --- .../src/mage/sets/gatecrash/ClanDefiance.java | 33 +++--------- .../src/mage/sets/lorwyn/CrypticCommand.java | 53 +++++++------------ .../sets/shardsofalara/BranchingBolt.java | 11 ++-- .../abilities/enters/DearlyDepartedTest.java | 10 ++++ 4 files changed, 38 insertions(+), 69 deletions(-) diff --git a/Mage.Sets/src/mage/sets/gatecrash/ClanDefiance.java b/Mage.Sets/src/mage/sets/gatecrash/ClanDefiance.java index 70cbf444f9..41739f433f 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/ClanDefiance.java +++ b/Mage.Sets/src/mage/sets/gatecrash/ClanDefiance.java @@ -64,44 +64,23 @@ public class ClanDefiance extends CardImpl { this.color.setRed(true); this.color.setGreen(true); - // Choose one or more - Clan Defiance deals X damage to target creature with flying; Clan Defiance deals X damage to target creature without flying; and/or Clan Defiance deals X damage to target player. + // Choose one or more - + this.getSpellAbility().getModes().setMinModes(1); + this.getSpellAbility().getModes().setMaxModes(3); + // Clan Defiance deals X damage to target creature with flying; this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); - + // Clan Defiance deals X damage to target creature without flying; Mode mode1 = new Mode(); mode1.getEffects().add(new DamageTargetEffect(new ManacostVariableValue())); mode1.getTargets().add(new TargetCreaturePermanent(filter2)); this.getSpellAbility().addMode(mode1); - + // and/or Clan Defiance deals X damage to target player. Mode mode2 = new Mode(); mode2.getEffects().add(new DamageTargetEffect(new ManacostVariableValue())); mode2.getTargets().add(new TargetPlayer()); this.getSpellAbility().addMode(mode2); - - Mode mode3 = new Mode(); - mode3.getEffects().add(new DamageTargetEffect(new ManacostVariableValue(), true, "target creature with flying, then deals X damage to target creature without flying")); - mode3.getTargets().add(new TargetCreaturePermanent(filter)); - mode3.getTargets().add(new TargetCreaturePermanent(filter2)); - this.getSpellAbility().addMode(mode3); - - Mode mode4 = new Mode(); - mode4.getEffects().add(new DamageTargetEffect(new ManacostVariableValue(), true, "target creature with flying, then deals X damage to target player")); - mode4.getTargets().add(new TargetCreaturePermanent(filter)); - mode4.getTargets().add(new TargetPlayer()); - this.getSpellAbility().addMode(mode4); - - Mode mode5 = new Mode(); - mode5.getEffects().add(new DamageTargetEffect(new ManacostVariableValue(), true, "target creature without flying, then deals X damage to target player")); - mode5.getTargets().add(new TargetCreaturePermanent(filter2)); - mode5.getTargets().add(new TargetPlayer()); - this.getSpellAbility().addMode(mode5); - Mode mode6 = new Mode(); - mode6.getEffects().add(new DamageTargetEffect(new ManacostVariableValue(), true, "target creature with flying, then deals X damage to target creature without flying, then deals X damage to target player")); - mode6.getTargets().add(new TargetCreaturePermanent(filter)); - mode6.getTargets().add(new TargetCreaturePermanent(filter2)); - mode6.getTargets().add(new TargetPlayer()); - this.getSpellAbility().addMode(mode6); } public ClanDefiance(final ClanDefiance card) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/CrypticCommand.java b/Mage.Sets/src/mage/sets/lorwyn/CrypticCommand.java index eee8f86cac..abef367a04 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/CrypticCommand.java +++ b/Mage.Sets/src/mage/sets/lorwyn/CrypticCommand.java @@ -45,7 +45,6 @@ import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; -import mage.target.TargetPlayer; import mage.target.TargetSpell; import mage.target.common.TargetCreaturePermanent; @@ -61,41 +60,25 @@ public class CrypticCommand extends CardImpl { this.color.setBlue(true); - // Choose two - Counter target spell; or return target permanent to its owner's hand; or tap all creatures your opponents control; or draw a card. - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + // Choose two - + this.getSpellAbility().getModes().setMinModes(2); + this.getSpellAbility().getModes().setMaxModes(2); + // Counter target spell; + this.getSpellAbility().addEffect(new CounterTargetEffect()); this.getSpellAbility().addTarget(new TargetSpell()); - this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); - this.getSpellAbility().addEffect(new CounterSecondTargetEffect()); - - Mode mode1 = new Mode(); - mode1.getTargets().add(new TargetSpell()); - mode1.getEffects().add(new CounterTargetEffect()); - mode1.getEffects().add(new CrypticCommandEffect()); - this.getSpellAbility().addMode(mode1); - - Mode mode2 = new Mode(); - mode2.getTargets().add(new TargetSpell()); - mode2.getEffects().add(new CounterTargetEffect()); - mode2.getEffects().add(new DrawCardControllerEffect(1)); - this.getSpellAbility().addMode(mode2); - - Mode mode3 = new Mode(); - mode3.getTargets().add(new TargetCreaturePermanent()); - mode3.getEffects().add(new ReturnToHandTargetEffect()); - mode3.getEffects().add(new CrypticCommandEffect()); - this.getSpellAbility().addMode(mode3); - - Mode mode4 = new Mode(); - mode4.getTargets().add(new TargetCreaturePermanent()); - mode4.getEffects().add(new ReturnToHandTargetEffect()); - mode4.getEffects().add(new DrawCardControllerEffect(1)); - this.getSpellAbility().addMode(mode4); - - Mode mode5 = new Mode(); - mode5.getTargets().add(new TargetPlayer()); - mode5.getEffects().add(new CrypticCommandEffect()); - mode5.getEffects().add(new DrawCardControllerEffect(1)); - this.getSpellAbility().addMode(mode5); + // or return target permanent to its owner's hand; + Mode mode = new Mode(); + mode.getEffects().add(new ReturnToHandTargetEffect()); + mode.getTargets().add(new TargetCreaturePermanent()); + this.getSpellAbility().getModes().addMode(mode); + // or tap all creatures your opponents control; + mode = new Mode(); + mode.getEffects().add(new CrypticCommandEffect()); + this.getSpellAbility().getModes().addMode(mode); + // or draw a card. + mode = new Mode(); + mode.getEffects().add(new DrawCardControllerEffect(1)); + this.getSpellAbility().getModes().addMode(mode); } public CrypticCommand(final CrypticCommand card) { diff --git a/Mage.Sets/src/mage/sets/shardsofalara/BranchingBolt.java b/Mage.Sets/src/mage/sets/shardsofalara/BranchingBolt.java index 78275104c5..49d3b61504 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/BranchingBolt.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/BranchingBolt.java @@ -65,7 +65,10 @@ public class BranchingBolt extends CardImpl { this.color.setRed(true); this.color.setGreen(true); - // Choose one or both - Branching Bolt deals 3 damage to target creature with flying; + // Choose one or both - + this.getSpellAbility().getModes().setMinModes(1); + this.getSpellAbility().getModes().setMaxModes(2); + // Branching Bolt deals 3 damage to target creature with flying; this.getSpellAbility().addEffect(new DamageTargetEffect(3)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filterFlying)); // or Branching Bolt deals 3 damage to target creature without flying. @@ -73,12 +76,6 @@ public class BranchingBolt extends CardImpl { mode.getEffects().add(new DamageTargetEffect(3)); mode.getTargets().add(new TargetCreaturePermanent(filterNotFlying)); this.getSpellAbility().addMode(mode); - // both - mode = new Mode(); - mode.getEffects().add(new DamageTargetEffect(3)); - mode.getTargets().add(new TargetCreaturePermanent(filterFlying)); - mode.getTargets().add(new TargetCreaturePermanent(filterNotFlying)); - this.getSpellAbility().addMode(mode); } public BranchingBolt(final BranchingBolt card) { diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/DearlyDepartedTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/DearlyDepartedTest.java index c8b1ce05da..d6ae457813 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/DearlyDepartedTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/DearlyDepartedTest.java @@ -16,7 +16,17 @@ public class DearlyDepartedTest extends CardTestPlayerBase { @Test public void testEnteringWithCounters() { addCard(Zone.BATTLEFIELD, playerA, "Plains", 5); + // Dearly Departed + // Creature — Spirit 5/5, 4WW (6) + // Flying + // As long as Dearly Departed is in your graveyard, each Human creature you control enters the battlefield with an additional +1/+1 counter on it. addCard(Zone.GRAVEYARD, playerA, "Dearly Departed"); + /** + * Thraben Doomsayer + * Creature — Human Cleric 2/2, 1WW (3) + * {T}: Put a 1/1 white Human creature token onto the battlefield. + * Fateful hour — As long as you have 5 or less life, other creatures you control get +2/+2. + */ addCard(Zone.BATTLEFIELD, playerA, "Thraben Doomsayer"); activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Put a 1/1 white Human creature token onto the battlefield.");