mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
[OTJ] add test for saddled this turn
This commit is contained in:
parent
f3887a54f3
commit
20865c4c3e
3 changed files with 69 additions and 0 deletions
|
|
@ -47,6 +47,7 @@ public class SaddleTest extends CardTestPlayerBase {
|
|||
|
||||
setChoice(playerA, bear);
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Saddle");
|
||||
|
||||
attack(1, playerA, charger, playerB);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
|
|
@ -64,4 +65,69 @@ public class SaddleTest extends CardTestPlayerBase {
|
|||
|
||||
assertSaddled(charger, false);
|
||||
}
|
||||
|
||||
private static final String possum = "Rambling Possum";
|
||||
private static final String lion = "Silvercoat Lion";
|
||||
|
||||
@Test
|
||||
public void testSaddledThisTurn() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, possum);
|
||||
addCard(Zone.BATTLEFIELD, playerA, bear);
|
||||
addCard(Zone.BATTLEFIELD, playerA, lion);
|
||||
|
||||
setChoice(playerA, bear);
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Saddle");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
attack(1, playerA, possum, playerB);
|
||||
setChoice(playerA, bear);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, bear, 0);
|
||||
assertHandCount(playerA, bear, 1);
|
||||
assertTapped(lion, false);
|
||||
assertTapped(possum, true);
|
||||
assertSaddled(possum, true);
|
||||
assertLife(playerB, 20 - 3 - 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSaddledThisTurnFail() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, possum);
|
||||
addCard(Zone.BATTLEFIELD, playerA, bear);
|
||||
addCard(Zone.BATTLEFIELD, playerA, lion);
|
||||
|
||||
setChoice(playerA, bear);
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Saddle");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
attack(1, playerA, possum, playerB);
|
||||
setChoice(playerA, lion);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
try {
|
||||
execute();
|
||||
} catch (AssertionError e) {
|
||||
Assert.assertEquals(
|
||||
"Lion can't be targeted",
|
||||
"Missing CHOICE def for turn 1, step DECLARE_ATTACKERS, PlayerA\n" +
|
||||
"Object: PermanentCard: Rambling Possum;\n" +
|
||||
"Target: TargetPermanent: Select creatures that saddled it this turn (selected 0)",
|
||||
e.getMessage()
|
||||
);
|
||||
}
|
||||
|
||||
assertTapped(bear, true);
|
||||
assertTapped(lion, false);
|
||||
assertTapped(possum, true);
|
||||
assertSaddled(possum, true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import mage.game.permanent.Permanent;
|
|||
import mage.watchers.common.SaddledMountWatcher;
|
||||
|
||||
/**
|
||||
* requires SaddledMountWatcher
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public enum SaddledSourceThisTurnPredicate implements ObjectSourcePlayerPredicate<Permanent> {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import java.util.*;
|
|||
*/
|
||||
public class SaddledMountWatcher extends Watcher {
|
||||
|
||||
// key: the mount, value: set of creatures which saddled
|
||||
private final Map<MageObjectReference, Set<MageObjectReference>> saddleMap = new HashMap<>();
|
||||
|
||||
public SaddledMountWatcher() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue