Changed some modal spells to the new handling of modal spells.

This commit is contained in:
LevelX2 2013-06-22 19:36:16 +02:00
parent 853810ce45
commit 4d3d76e8e9
4 changed files with 38 additions and 69 deletions

View file

@ -64,44 +64,23 @@ public class ClanDefiance extends CardImpl<ClanDefiance> {
this.color.setRed(true); this.color.setRed(true);
this.color.setGreen(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().addEffect(new DamageTargetEffect(new ManacostVariableValue()));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
// Clan Defiance deals X damage to target creature without flying;
Mode mode1 = new Mode(); Mode mode1 = new Mode();
mode1.getEffects().add(new DamageTargetEffect(new ManacostVariableValue())); mode1.getEffects().add(new DamageTargetEffect(new ManacostVariableValue()));
mode1.getTargets().add(new TargetCreaturePermanent(filter2)); mode1.getTargets().add(new TargetCreaturePermanent(filter2));
this.getSpellAbility().addMode(mode1); this.getSpellAbility().addMode(mode1);
// and/or Clan Defiance deals X damage to target player.
Mode mode2 = new Mode(); Mode mode2 = new Mode();
mode2.getEffects().add(new DamageTargetEffect(new ManacostVariableValue())); mode2.getEffects().add(new DamageTargetEffect(new ManacostVariableValue()));
mode2.getTargets().add(new TargetPlayer()); mode2.getTargets().add(new TargetPlayer());
this.getSpellAbility().addMode(mode2); 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) { public ClanDefiance(final ClanDefiance card) {

View file

@ -45,7 +45,6 @@ import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import mage.target.TargetPlayer;
import mage.target.TargetSpell; import mage.target.TargetSpell;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -61,41 +60,25 @@ public class CrypticCommand extends CardImpl<CrypticCommand> {
this.color.setBlue(true); 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. // Choose two -
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); 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().addTarget(new TargetSpell());
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); // or return target permanent to its owner's hand;
this.getSpellAbility().addEffect(new CounterSecondTargetEffect()); Mode mode = new Mode();
mode.getEffects().add(new ReturnToHandTargetEffect());
Mode mode1 = new Mode(); mode.getTargets().add(new TargetCreaturePermanent());
mode1.getTargets().add(new TargetSpell()); this.getSpellAbility().getModes().addMode(mode);
mode1.getEffects().add(new CounterTargetEffect()); // or tap all creatures your opponents control;
mode1.getEffects().add(new CrypticCommandEffect()); mode = new Mode();
this.getSpellAbility().addMode(mode1); mode.getEffects().add(new CrypticCommandEffect());
this.getSpellAbility().getModes().addMode(mode);
Mode mode2 = new Mode(); // or draw a card.
mode2.getTargets().add(new TargetSpell()); mode = new Mode();
mode2.getEffects().add(new CounterTargetEffect()); mode.getEffects().add(new DrawCardControllerEffect(1));
mode2.getEffects().add(new DrawCardControllerEffect(1)); this.getSpellAbility().getModes().addMode(mode);
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);
} }
public CrypticCommand(final CrypticCommand card) { public CrypticCommand(final CrypticCommand card) {

View file

@ -65,7 +65,10 @@ public class BranchingBolt extends CardImpl<BranchingBolt> {
this.color.setRed(true); this.color.setRed(true);
this.color.setGreen(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().addEffect(new DamageTargetEffect(3));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filterFlying)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filterFlying));
// or Branching Bolt deals 3 damage to target creature without flying. // or Branching Bolt deals 3 damage to target creature without flying.
@ -73,12 +76,6 @@ public class BranchingBolt extends CardImpl<BranchingBolt> {
mode.getEffects().add(new DamageTargetEffect(3)); mode.getEffects().add(new DamageTargetEffect(3));
mode.getTargets().add(new TargetCreaturePermanent(filterNotFlying)); mode.getTargets().add(new TargetCreaturePermanent(filterNotFlying));
this.getSpellAbility().addMode(mode); 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) { public BranchingBolt(final BranchingBolt card) {

View file

@ -16,7 +16,17 @@ public class DearlyDepartedTest extends CardTestPlayerBase {
@Test @Test
public void testEnteringWithCounters() { public void testEnteringWithCounters() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 5); 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"); 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"); addCard(Zone.BATTLEFIELD, playerA, "Thraben Doomsayer");
activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Put a 1/1 white Human creature token onto the battlefield."); activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Put a 1/1 white Human creature token onto the battlefield.");