forked from External/mage
* Emrakul, the Promised End - Fix that extra turn is not giving when Emrakul is cast during an opponent's turn (fixes #2492).
This commit is contained in:
parent
43581cafa3
commit
0dcc2a85b8
4 changed files with 95 additions and 8 deletions
|
|
@ -86,11 +86,11 @@ public class TurnMods extends ArrayList<TurnMod> {
|
|||
|
||||
public UUID controlsTurn(UUID playerId) {
|
||||
ListIterator<TurnMod> it = this.listIterator(this.size());
|
||||
UUID newControllerId = null;
|
||||
TurnMod controlPlayerTurnMod = null;
|
||||
while (it.hasPrevious()) {
|
||||
TurnMod turnMod = it.previous();
|
||||
if (turnMod.getNewControllerId() != null && turnMod.getPlayerId().equals(playerId)) {
|
||||
newControllerId = turnMod.getNewControllerId();
|
||||
controlPlayerTurnMod = turnMod;
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
|
|
@ -102,7 +102,11 @@ public class TurnMods extends ArrayList<TurnMod> {
|
|||
it.remove();
|
||||
}
|
||||
}
|
||||
return newControllerId;
|
||||
// apply subsequent turn mod
|
||||
if (controlPlayerTurnMod != null && controlPlayerTurnMod.getSubsequentTurnMod() != null) {
|
||||
this.add(controlPlayerTurnMod.getSubsequentTurnMod());
|
||||
}
|
||||
return controlPlayerTurnMod != null ? controlPlayerTurnMod.getNewControllerId() : null;
|
||||
}
|
||||
|
||||
public Step extraStep(UUID playerId, PhaseStep afterStep) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue