In a Multiplayer game there is a Problem with
Angel of Serenity.
If there is 3 players.
PlayerA plays
Angel of Serenity and exiles cards from one or both other players.
Now Player B takes over
Angel of Serenity.
Player A concedes.
Now the Trigger to bring the creatures back into the Hands of their owners, since
Angel of Serenity is controlled by an other player how I understand it the trigger should resolve and return them to the hands of their owners.
However in XMage this does not happen because in ReturnFromExileForSourceEffect.apply there is no sourceObject and also you can't get the Permanent (I guess because it was already removed from the game at this point). So the code can't get the exile UUID any more. I have no idea how to go about correcting that.
Test would be sth like this:
- Code: Select all
// Player order: A -> D -> C -> B
addCard(Zone.BATTLEFIELD, playerA, "Island", 7); // add mana to cast card to take over Angel
addCard(Zone.HAND, playerA, "Agent of Treachery");
addCard(Zone.BATTLEFIELD, playerB, "Plains", 3);
addCard(Zone.BATTLEFIELD, playerB, "Dromoka Dunecaster", 3);
addCard(Zone.BATTLEFIELD, playerC, "Plains", 7);
addCard(Zone.HAND, playerC, "Angel of Serenity"); // {4}{W}{W}{W}
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerC, "Angel of Serenity");
addTarget(playerC, "Dromoka Dunecaster^Dromoka Dunecaster^Dromoka Dunecaster");
castSpell(5, PhaseStep.PRECOMBAT_MAIN, playerA, "Agent of Treachery");
addTarget(playerA, "Angel of Serenity");
concede(6, PhaseStep.POSTCOMBAT_MAIN, playerC);
setStopAt(7, PhaseStep.UPKEEP);
execute();
assertAllCommandsUsed();
Assert.assertFalse("Player of Angel of Serenity did not leave the game", playerC.isInGame());
assertPermanentCount(playerA, 8);
assertPermanentCount(playerB, 3);
assertHandCount(playerB, 3);
Also for what ever reason when I tried this test my playerB always has a
Mountain in his hand and I can't understand why. So instead of trying to fix this and pullrequest on github I decided to just post here, because apparently I am missing something important about how the whole testing works