use of mage.abilities.effects.mana.AddConditionalManaEffect in project mage by magefree.
the class ManaPoolTest method test_ConditionalMana_OneXPart.
@Test
public void test_ConditionalMana_OneXPart() {
// {R}
addCard(Zone.HAND, playerA, "Lightning Bolt");
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
//
addCustomCardWithAbility("add 10", playerA, new SimpleManaAbility(Zone.ALL, new AddConditionalManaEffect(Mana.RedMana(10), new SimpleActivatedAbilityManaBuilder()), new ManaCostsImpl("")));
//
Ability ability = new SimpleActivatedAbility(Zone.ALL, new DamageTargetEffect(ManacostVariableValue.REGULAR), new ManaCostsImpl(""));
ability.addTarget(new TargetAnyTarget());
addCustomCardWithAbility("damage X", playerA, ability);
//
// {X}: Counter target spell
ability = new SimpleActivatedAbility(Zone.ALL, new CounterUnlessPaysEffect(ManacostVariableValue.REGULAR), new ManaCostsImpl("{X}"));
ability.addTarget(new TargetSpell());
addCustomCardWithAbility("counter until pay X", playerB, ability);
addCard(Zone.BATTLEFIELD, playerB, "Island", 3);
// make mana for spell
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}");
checkManaPool("mana spell", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "R", 1);
// cast spell
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
// make mana for pay X to prevent
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Add {R}");
checkManaPool("mana prevent", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "R", 10);
// counter by X=3
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "{X}: Counter");
setChoice(playerB, "X=3");
addTarget(playerB, "Lightning Bolt");
// pay to prevent
// pay 3 to prevent counter
setChoice(playerA, true);
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
checkManaPool("mana after", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "R", 10 + 1 - 1 - 3);
checkLife("after", 1, PhaseStep.END_TURN, playerB, 20 - 3);
setStopAt(1, PhaseStep.END_TURN);
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
}
use of mage.abilities.effects.mana.AddConditionalManaEffect in project mage by magefree.
the class ManaPoolTest method test_ConditionalMana_OneXSpell.
@Test
public void test_ConditionalMana_OneXSpell() {
addCustomCardWithAbility("add 10", playerA, new SimpleActivatedAbility(Zone.ALL, new AddConditionalManaEffect(Mana.RedMana(10), new InstantOrSorcerySpellManaBuilder()), new ManaCostsImpl("")));
// {X}{R}{R}
addCard(Zone.HAND, playerA, "Volcanic Geyser");
// make mana
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Add {R}");
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
checkManaPool("mana", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "R", 10);
// use for spell
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Volcanic Geyser", playerB);
setChoice(playerA, "X=1");
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
checkManaPool("mana", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "R", 10 - 3);
checkLife("after", 1, PhaseStep.END_TURN, playerB, 20 - 1);
setStopAt(1, PhaseStep.END_TURN);
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
}
use of mage.abilities.effects.mana.AddConditionalManaEffect in project mage by magefree.
the class ManaPoolTest method test_ConditionalMana_MultipleXSpell.
@Test
public void test_ConditionalMana_MultipleXSpell() {
addCustomCardWithAbility("add 10", playerA, new SimpleActivatedAbility(Zone.ALL, new AddConditionalManaEffect(Mana.RedMana(10), new InstantOrSorcerySpellManaBuilder()), new ManaCostsImpl("")));
// {X}{R}{R}
addCard(Zone.HAND, playerA, "Volcanic Geyser", 2);
// make mana
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Add {R}");
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
checkManaPool("mana", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "R", 10);
// use for spell 1
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Volcanic Geyser", playerB);
setChoice(playerA, "X=1");
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
checkManaPool("mana", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "R", 10 - 3);
// use for spell 2
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Volcanic Geyser", playerB);
setChoice(playerA, "X=1");
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
checkManaPool("mana", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "R", 10 - 3 * 2);
checkLife("after", 1, PhaseStep.END_TURN, playerB, 20 - 1 * 2);
setStopAt(1, PhaseStep.END_TURN);
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
}
use of mage.abilities.effects.mana.AddConditionalManaEffect in project mage by magefree.
the class ManaPoolTest method test_ConditionalMana_OneXAbility.
@Test
public void test_ConditionalMana_OneXAbility() {
addCustomCardWithAbility("add 10", playerA, new SimpleActivatedAbility(Zone.ALL, new AddConditionalManaEffect(Mana.RedMana(10), new SimpleActivatedAbilityManaBuilder()), new ManaCostsImpl("")));
//
Ability ability = new SimpleActivatedAbility(Zone.ALL, new DamageTargetEffect(ManacostVariableValue.REGULAR), new ManaCostsImpl("{X}"));
ability.addTarget(new TargetAnyTarget());
addCustomCardWithAbility("damage X", playerA, ability);
// make mana
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Add {R}");
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
checkManaPool("mana", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "R", 10);
// use for ability
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{X}:", playerB);
setChoice(playerA, "X=3");
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
checkManaPool("mana", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "R", 10 - 3);
checkLife("after", 1, PhaseStep.END_TURN, playerB, 20 - 3);
setStopAt(1, PhaseStep.END_TURN);
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
}
Aggregations