forked from External/mage
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.
This commit is contained in:
parent
4a432b61f9
commit
a200351190
1 changed files with 12 additions and 10 deletions
|
|
@ -56,11 +56,11 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu
|
|||
|
||||
// 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 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu
|
|||
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 abstract class ContinuousEffectImpl extends EffectImpl implements Continu
|
|||
@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 abstract class ContinuousEffectImpl extends EffectImpl implements Continu
|
|||
|
||||
@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 abstract class ContinuousEffectImpl extends EffectImpl implements Continu
|
|||
|
||||
@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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue