mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
handle delayed triggers not using the stack
This commit is contained in:
parent
a2344ea781
commit
a4eb963838
1 changed files with 8 additions and 3 deletions
|
|
@ -65,11 +65,16 @@ public abstract class DelayedTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInactive(Game game) {
|
public boolean isInactive(Game game) {
|
||||||
// discard as soon as possible for leaved player
|
// discard on stack
|
||||||
// 800.4d. If an object that would be owned by a player who has left the game would be created in any zone, it isn't created.
|
// 800.4d. If an object that would be owned by a player who has left the game would be created in any zone, it isn't created.
|
||||||
// If a triggered ability that would be controlled by a player who has left the game would be put onto the stack, it isn't put on the stack.
|
// If a triggered ability that would be controlled by a player who has left the game would be put onto the stack, it isn't put on the stack.
|
||||||
Player player = game.getPlayer(getControllerId());
|
Player player = game.getPlayer(getControllerId());
|
||||||
boolean canDelete = player == null || !player.isInGame();
|
if (player != null && player.isInGame()) {
|
||||||
return canDelete;
|
return false;
|
||||||
|
}
|
||||||
|
// If using the stack, discard as soon as possible for leaved player
|
||||||
|
// If not using the stack (for instance return of "exile target player until {this} leaves the battlefield"),
|
||||||
|
// we wait till the player would have played a next turn to make sure they are debounced after the player leaves.
|
||||||
|
return usesStack || player.hasReachedNextTurnAfterLeaving();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue