Fixed LKI and change controller interaction. +1 test passed.

This commit is contained in:
magenoxx 2012-06-03 17:33:04 +04:00
parent cf8fa2b773
commit 27d4997545
4 changed files with 15 additions and 4 deletions

View file

@ -57,7 +57,10 @@ public class SorinLordOfInnistradTest extends CardTestPlayerBase {
activateAbility(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "-6: ", "Craw Wurm^Angel of Mercy");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Craw Wurm", 1);
assertPermanentCount(playerA, "Angel of Mercy", 1);
assertLife(playerA, 23);
assertLife(playerB, 20);
assertPermanentCount(playerA, "Sorin, Lord of Innistrad", 0);

View file

@ -256,6 +256,9 @@ public class TestPlayer extends ComputerPlayer<TestPlayer> {
for (UUID id: ability.getTargets().get(0).possibleTargets(ability.getSourceId(), ability.getControllerId(), game)) {
MageObject object = game.getObject(id);
if (object != null && object.getName().equals(t)) {
if (index >= ability.getTargets().size()) {
index--;
}
if (ability.getTargets().get(index).getNumberOfTargets() == 1) {
ability.getTargets().get(index).clearChosen();
}