mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 19:11:59 -08:00
Test and fix for Soulbound with ExileAndReturnBack effect
This commit is contained in:
parent
06a185a3a5
commit
def0260b9d
3 changed files with 29 additions and 4 deletions
|
|
@ -5,6 +5,8 @@ import mage.abilities.Abilities;
|
|||
import mage.abilities.AbilitiesImpl;
|
||||
import mage.abilities.keyword.LifelinkAbility;
|
||||
import mage.filter.Filter;
|
||||
import mage.game.permanent.Permanent;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
|
|
@ -352,17 +354,25 @@ public class SoulbondKeywordTest extends CardTestPlayerBase {
|
|||
@Test
|
||||
public void testExileAndReturnBack() {
|
||||
addCard(Constants.Zone.HAND, playerA, "Elite Vanguard");
|
||||
addCard(Constants.Zone.HAND, playerA, "Cloudshift");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Trusted Forcemage");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 2);
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Elite Vanguard");
|
||||
setChoice(playerA, "Yes");
|
||||
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Cloudshift", "Trusted Forcemage");
|
||||
setChoice(playerA, "No");
|
||||
|
||||
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
|
||||
setStopAt(1, Constants.PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Trusted Forcemage", 1);
|
||||
assertPowerToughness(playerA, "Trusted Forcemage", 3, 3);
|
||||
assertPowerToughness(playerA, "Elite Vanguard", 3, 2);
|
||||
assertPowerToughness(playerA, "Trusted Forcemage", 2, 2);
|
||||
assertPowerToughness(playerA, "Elite Vanguard", 2, 1);
|
||||
|
||||
Permanent trustedForcemange = getPermanent("Trusted Forcemage", playerA.getId());
|
||||
Permanent eliteVanguard = getPermanent("Elite Vanguard", playerA.getId());
|
||||
Assert.assertTrue(trustedForcemange.getPairedCard() == null);
|
||||
Assert.assertTrue(eliteVanguard.getPairedCard() == null);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,6 +202,21 @@ public class TestPlayer extends ComputerPlayer<TestPlayer> {
|
|||
}
|
||||
return super.choose(outcome, target, sourceId, game, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean chooseUse(Constants.Outcome outcome, String message, Game game) {
|
||||
if (!choices.isEmpty()) {
|
||||
if (choices.get(0).equals("No")) {
|
||||
choices.remove(0);
|
||||
return false;
|
||||
}
|
||||
if (choices.get(0).equals("Yes")) {
|
||||
choices.remove(0);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected Permanent findPermanent(FilterPermanent filter, UUID controllerId, Game game) {
|
||||
List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(filter, controllerId, game);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue