* Kicker - added support of X and mana cost interactions like Rosheen Meanderer + Verdeloth the Ancient combo (#3538);

* Rosheen Meanderer - fixed that mana can be payed for mana cost with X instead any cost with X (#3538);
This commit is contained in:
Oleg Agafonov 2019-06-18 11:28:41 +04:00
parent 49fc094546
commit cc54a92daa
7 changed files with 216 additions and 147 deletions

View file

@ -0,0 +1,96 @@
package org.mage.test.cards.mana;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author JayDi85
*/
public class RosheenMeandererManaXTest extends CardTestPlayerBase {
// https://github.com/magefree/mage/issues/3538
// Rosheen Meanderer {3}{R/G}
// {T}: Add {C}{C}{C}{C}. Spend this mana only on costs that contain {X}.
// Verdeloth the Ancient {4}{G}{G}
// Kicker {X} (You may pay an additional {X} as you cast this spell.)
// Saproling creatures and other Treefolk creatures get +1/+1.
// When Verdeloth the Ancient enters the battlefield, if it was kicked, create X 1/1 green Saproling creature tokens.
@Test
public void test_SimpleKicker() {
addCard(Zone.BATTLEFIELD, playerA, "Forest", 6 + 2);
addCard(Zone.HAND, playerA, "Verdeloth the Ancient");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Verdeloth the Ancient");
setChoice(playerA, "Yes"); // use kicker
setChoice(playerA, "X=2");
checkPermanentCount("after", 1, PhaseStep.END_TURN, playerA, "Verdeloth the Ancient", 1);
checkPermanentCount("after", 1, PhaseStep.END_TURN, playerA, "Saproling", 2);
setStopAt(1, PhaseStep.END_TURN);
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
}
@Test
public void test_KickerWithXMana() {
addCard(Zone.BATTLEFIELD, playerA, "Forest", 6 + 2 - 4);
addCard(Zone.HAND, playerA, "Verdeloth the Ancient");
//
addCard(Zone.BATTLEFIELD, playerA, "Rosheen Meanderer");
// make 4 mana for X pay
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {C}");
checkManaPool("mana", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "C", 4);
// cast kicker X and use extra 4 mana
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Verdeloth the Ancient");
setChoice(playerA, "Yes"); // use kicker
setChoice(playerA, "X=2");
checkPermanentCount("after", 1, PhaseStep.END_TURN, playerA, "Verdeloth the Ancient", 1);
checkPermanentCount("after", 1, PhaseStep.END_TURN, playerA, "Saproling", 2);
setStopAt(1, PhaseStep.END_TURN);
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
}
@Test
public void test_KickerWithXZero() {
// You can spend mana generated by Rosheen on a cost that includes {X} even if youve chosen an X of 0,
// or if the card specifies that you can spend only colored mana on X. (Youll have to spend Rosheens mana on
// a different part of that cost, of course.) (2017-11-17)
addCard(Zone.BATTLEFIELD, playerA, "Forest", 6 - 4);
addCard(Zone.HAND, playerA, "Verdeloth the Ancient");
//
addCard(Zone.BATTLEFIELD, playerA, "Rosheen Meanderer");
// make 4 mana for X pay
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {C}");
checkManaPool("mana", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "C", 4);
// cast kicker X and use extra 4 mana
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Verdeloth the Ancient");
setChoice(playerA, "Yes"); // use kicker
setChoice(playerA, "X=0");
checkPermanentCount("after", 1, PhaseStep.END_TURN, playerA, "Verdeloth the Ancient", 1);
checkPermanentCount("after", 1, PhaseStep.END_TURN, playerA, "Saproling", 0);
setStopAt(1, PhaseStep.END_TURN);
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
}
}

View file

@ -1129,7 +1129,9 @@ public class TestPlayer implements Player {
}
private void assertManaPoolInner(PlayerAction action, Player player, ManaType manaType, Integer amount) {
Integer current = player.getManaPool().get(manaType);
Integer normal = player.getManaPool().getMana().get(manaType);
Integer conditional = player.getManaPool().getConditionalMana().stream().mapToInt(a -> a.get(manaType)).sum(); // calcs FULL conditional mana, not real conditions
Integer current = normal + conditional;
Assert.assertEquals(action.getActionName() + " - mana pool must contain [" + amount.toString() + " " + manaType.toString() + "], but found [" + current.toString() + "]", amount, current);
}