mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 11:02:00 -08:00
implement [FIN] Vivi Ornitier ; limit mana computation for "only once per turn" abilities (#13639)
fixes #10930
This commit is contained in:
parent
fa20361e2e
commit
a9af84f533
9 changed files with 272 additions and 10 deletions
|
|
@ -0,0 +1,72 @@
|
|||
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;
|
||||
|
||||
public class LimitPerTurnTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* {@link mage.cards.s.ShireScarecrow Shire Scarecrow} {2}
|
||||
* Artifact Creature — Scarecrow
|
||||
* Defender
|
||||
* {1}: Add one mana of any color. Activate only once each turn.
|
||||
* 0/3
|
||||
*/
|
||||
private static final String scarecrow = "Shire Scarecrow";
|
||||
|
||||
|
||||
@Test
|
||||
public void test_LimitOncePerTurn() {
|
||||
String vanguard = "Elite Vanguard"; // {W} 2/1
|
||||
String goblin = "Raging Goblin"; // {R} 1/1
|
||||
addCard(Zone.BATTLEFIELD, playerA, scarecrow, 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
|
||||
addCard(Zone.HAND, playerA, vanguard, 1);
|
||||
addCard(Zone.HAND, playerA, goblin, 1);
|
||||
|
||||
checkPlayableAbility("1: Vanguard can be cast", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast " + vanguard, true);
|
||||
checkPlayableAbility("1: goblin can be cast", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast " + goblin, true);
|
||||
|
||||
setChoice(playerA, "White"); // choice for Scarecrow mana
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, vanguard);
|
||||
|
||||
checkPlayableAbility("2: goblin can not be cast", 1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Cast " + goblin, false);
|
||||
|
||||
checkPlayableAbility("3: goblin can be cast on turn 3", 3, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast " + goblin, true);
|
||||
|
||||
setChoice(playerA, "Red"); // choice for Scarecrow mana
|
||||
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, goblin);
|
||||
|
||||
setStopAt(3, PhaseStep.END_TURN);
|
||||
setStrictChooseMode(true);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, 5);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_MultipleScarecrows() {
|
||||
String deus = "Deus of Calamity"; // {R/G}{R/G}{R/G}{R/G}{R/G}
|
||||
String boggart = "Boggart Ram-Gang"; // {R/G}{R/G}{R/G}
|
||||
addCard(Zone.BATTLEFIELD, playerA, scarecrow, 3);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5);
|
||||
addCard(Zone.HAND, playerA, deus, 1);
|
||||
addCard(Zone.HAND, playerA, boggart, 1);
|
||||
|
||||
checkPlayableAbility("1: boggart can be cast", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast " + boggart, true);
|
||||
checkPlayableAbility("1: deus can not be cast", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast " + deus, false);
|
||||
|
||||
setChoice(playerA, "Red"); // choice for Scarecrow mana
|
||||
setChoice(playerA, "Red"); // choice for Scarecrow mana
|
||||
setChoice(playerA, "Green"); // choice for Scarecrow mana
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, boggart);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
setStrictChooseMode(true);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, boggart, 1);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package org.mage.test.cards.single.fin;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
* @author Susucr
|
||||
*/
|
||||
public class ViviOrnitierTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* {@link mage.cards.v.ViviOrnitier Vivi Ornitier} {1}{U}{R}
|
||||
* Legendary Creature — Wizard
|
||||
* {0}: Add X mana in any combination of {U} and/or {R}, where X is Vivi Ornitier’s power. Activate only during your turn and only once each turn.
|
||||
* Whenever you cast a noncreature spell, put a +1/+1 counter on Vivi Ornitier and it deals 1 damage to each opponent.
|
||||
* 0/3
|
||||
*/
|
||||
private static final String vivi = "Vivi Ornitier";
|
||||
|
||||
/**
|
||||
* Creatures you control get +2/+2.
|
||||
*/
|
||||
private static final String dictate = "Dictate of Heliod";
|
||||
|
||||
private static final String bolt = "Lightning Bolt";
|
||||
private static final String incinerate = "Incinerate";
|
||||
|
||||
@Test
|
||||
public void test_NoPower() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, vivi, 1);
|
||||
addCard(Zone.HAND, playerA, bolt);
|
||||
|
||||
checkPlayableAbility("bolt can not be cast", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast " + bolt, false);
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
setStrictChooseMode(true);
|
||||
execute();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_2Power() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, vivi, 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, dictate, 1);
|
||||
addCard(Zone.HAND, playerA, bolt);
|
||||
addCard(Zone.HAND, playerA, incinerate);
|
||||
|
||||
checkPlayableAbility("1: bolt can be cast", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast " + bolt, true);
|
||||
checkPlayableAbility("1: incinerate can be cast", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast " + incinerate, true);
|
||||
|
||||
setChoice(playerA, "X=0"); // choose {U} color distribution for vivi on 2 power
|
||||
setChoice(playerA, "X=2"); // choose {R} color distribution for vivi on 2 power
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, incinerate, playerB);
|
||||
|
||||
checkPlayableAbility("2: bolt can not be cast", 1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Cast " + bolt, false);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
setStrictChooseMode(true);
|
||||
execute();
|
||||
|
||||
assertLife(playerB, 20 - 3 - 1);
|
||||
assertPowerToughness(playerA, vivi, 3, 6);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue