-
Notifications
You must be signed in to change notification settings - Fork 745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support until your next turn delayed trigger as shared class with proper Duration #12233
support until your next turn delayed trigger as shared class with proper Duration #12233
Conversation
@@ -539,6 +539,7 @@ public Counters getCounters() { | |||
public void beginTurn(Game game) { | |||
resetLandsPlayed(); | |||
updateRange(game); | |||
game.getState().removeTurnStartEffect(game); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine to call it here. But make sure it will support leaving players too:
800.4m. When a player leaves the game, any continuous effects with durations that last until that player's next turn or until a specific point in that turn will last until that turn would have begun. They neither expire immediately nor last indefinitely.
Looks like current code will be never called for leaved player and will keep trigger forever in game state. If it's true then player.hasReachedNextTurnAfterLeaving()
will help with it:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks I did miss that.
I'll make test for it, and fix it asap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So after testing, the DelayedTriggers get cleared once the player leave/concede.
Which is incorrect, but less annoying, as the trigger expires just not at the right time.
By the way, If there are delayed triggers of a left player to stack, who decides stacking order? I need to read more on that in the CR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
So triggers (which delayed triggers are) for leaving player don't trigger. So current no trigger after player left is correct behavior. I'll add proper cleanup though to not keep DelayedTriggerAbility the whole game.
eb9e91f
to
dff6f30
Compare
This is a way bigger scope, and need careful consideration to apply continuous effects during new turn logic to reapply continuous effects after the removal of the |
This makes
DelayedTriggeredAbility
withDuration.UntilYourNextTurn
function as expected. (Before they would never expire).A new shared class
UntilYourNextTurnDelayedTriggeredAbility
has been added to make it easy to set up in cards' code. Similarly toConditionalInterveningIfTriggeredAbility
, it is a meta-trigger class that contains an inner trigger (hence the many Overriden methods).Once this is merged, cards in this search could be rewritten using the new class.
Related to #2078 (Tamiyo still need to be reworked, but wanted to mention it)
Close #11634