From a20035119053d08a9468c04ff1d77d52bbd9b0ea Mon Sep 17 00:00:00 2001 From: Grath <1895280+Grath@users.noreply.github.com> Date: Mon, 30 Sep 2024 13:19:33 -0400 Subject: [PATCH] Rename fields for 'until the beginning of the next end step' duration; update comment to reflect that 'until the next end step' happens before the cleanup step and 514.2 does not apply. --- .../effects/ContinuousEffectImpl.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Mage/src/main/java/mage/abilities/effects/ContinuousEffectImpl.java b/Mage/src/main/java/mage/abilities/effects/ContinuousEffectImpl.java index 901dc44d102a..d09810fd2b9a 100644 --- a/Mage/src/main/java/mage/abilities/effects/ContinuousEffectImpl.java +++ b/Mage/src/main/java/mage/abilities/effects/ContinuousEffectImpl.java @@ -56,11 +56,11 @@ A Characteristic Defining Ability (CDA) is an ability that defines a characteris // until your next turn or until end of your next turn private UUID startingControllerId; // player to check for turn duration (can't different with real controller ability) - private UUID activePlayerId; // Player whose turn the effect started on + private UUID startingActivePlayerId; // Player whose turn the effect started on private boolean startingTurnWasActive; // effect started during related players turn and related players turn was already active private int effectStartingOnTurn = 0; // turn the effect started - private int effectControllerStartingEndStep = 0; - private int effectActivePlayerStartingEndStep = 0; + private int effectStartingControllerEndStep = 0; + private int effectStartingActivePlayerEndStep = 0; private int nextTurnNumber = Integer.MAX_VALUE; // effect is waiting for a step during your next turn, we store it if found. // set to the turn number on your next turn. private int effectStartingStepNum = 0; // Some continuous are waiting for the next step of a kind. @@ -93,9 +93,11 @@ protected ContinuousEffectImpl(final ContinuousEffectImpl effect) { this.affectedObjectList.addAll(effect.affectedObjectList); this.temporary = effect.temporary; this.startingControllerId = effect.startingControllerId; + this.startingActivePlayerId = effect.startingActivePlayerId; this.startingTurnWasActive = effect.startingTurnWasActive; this.effectStartingOnTurn = effect.effectStartingOnTurn; - this.effectControllerStartingEndStep = effect.effectControllerStartingEndStep; + this.effectStartingControllerEndStep = effect.effectStartingControllerEndStep; + this.effectStartingActivePlayerEndStep = effect.effectStartingActivePlayerEndStep; this.dependencyTypes = effect.dependencyTypes; this.dependendToTypes = effect.dependendToTypes; this.characterDefining = effect.characterDefining; @@ -253,12 +255,12 @@ public UUID getStartingController() { @Override public void setStartingControllerAndTurnNum(Game game, UUID startingController, UUID activePlayerId) { this.startingControllerId = startingController; - this.activePlayerId = activePlayerId; + this.startingActivePlayerId = activePlayerId; this.startingTurnWasActive = activePlayerId != null && activePlayerId.equals(startingController); // you can't use "game" for active player cause it's called from tests/cheat too this.effectStartingOnTurn = game.getTurnNum(); - this.effectControllerStartingEndStep = EndStepCountWatcher.getCount(startingController, game); - this.effectActivePlayerStartingEndStep = EndStepCountWatcher.getCount(activePlayerId, game); + this.effectStartingControllerEndStep = EndStepCountWatcher.getCount(startingController, game); + this.effectStartingActivePlayerEndStep = EndStepCountWatcher.getCount(activePlayerId, game); this.effectStartingStepNum = game.getState().getStepNum(); } @@ -270,12 +272,12 @@ public boolean isYourNextTurn(Game game) { @Override public boolean isYourNextEndStep(Game game) { - return EndStepCountWatcher.getCount(startingControllerId, game) > effectControllerStartingEndStep; + return EndStepCountWatcher.getCount(startingControllerId, game) > effectStartingControllerEndStep; } @Override public boolean isTheNextEndStep(Game game) { - return EndStepCountWatcher.getCount(activePlayerId, game) > effectActivePlayerStartingEndStep; + return EndStepCountWatcher.getCount(startingActivePlayerId, game) > effectStartingActivePlayerEndStep; } public boolean isEndCombatOfYourNextTurn(Game game) { @@ -300,7 +302,7 @@ public boolean isYourNextUpkeepStep(Game game) { @Override public boolean isInactive(Ability source, Game game) { - // YOUR turn checks + // YOUR turn checks, players who left the game, and the next end step // until end of turn - must be checked on cleanup step, see rules 514.2 // other must checked here (active and leave players), see rules 800.4 switch (duration) {