mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 11:02:00 -08:00
refactor: add new simpler technique for intervening if conditions on triggered abilities (#13037)
too many usages to fix all at once, plus condition text needs updating, but this will give a cleaner option for new implementations
This commit is contained in:
parent
fb71ce8c85
commit
8a8773971d
19 changed files with 153 additions and 122 deletions
|
|
@ -0,0 +1,51 @@
|
|||
package org.mage.test.cards.single.xln;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
* @author xenohedron
|
||||
*/
|
||||
public class DeadeyeTormentorTest extends CardTestPlayerBase {
|
||||
|
||||
private static final String tormentor = "Deadeye Tormentor"; // 2B 2/2
|
||||
// Raid — When Deadeye Tormentor enters, if you attacked this turn, target opponent discards a card.
|
||||
|
||||
@Test
|
||||
public void testConditionFalse() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
|
||||
addCard(Zone.HAND, playerA, tormentor);
|
||||
addCard(Zone.HAND, playerB, "Ornithopter");
|
||||
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, tormentor);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertHandCount(playerB, "Ornithopter", 1);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testConditionTrue() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
|
||||
addCard(Zone.HAND, playerA, tormentor);
|
||||
addCard(Zone.HAND, playerB, "Ornithopter");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Raging Goblin");
|
||||
|
||||
attack(1, playerA, "Raging Goblin", playerB);
|
||||
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, tormentor);
|
||||
addTarget(playerA, playerB);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertHandCount(playerB, "Ornithopter", 0);
|
||||
assertGraveyardCount(playerB, "Ornithopter", 1);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue