forked from External/mage
- Reworked SourceOnBattlefieldControlUnchangedCondition checking now the LOST_CONTROL event which solves the problem with the old code to not be able to detect all controller changes of layered changeController effects when applied later.
- Simplified and fixed some problems of the handling of the "Until end of your next turn" duration.
- Fixed that some continous effects changed controller but shouldn't dependant from their duration type. Controller chnage will now done duration type dependant.
(that change fixes #6581 in a more general way undoing the effect specific changes of 2e8ece1dbd).
This commit is contained in:
parent
25802dc105
commit
1e36b39434
30 changed files with 534 additions and 469 deletions
|
|
@ -4,25 +4,27 @@ package mage.constants;
|
|||
* @author North
|
||||
*/
|
||||
public enum Duration {
|
||||
OneUse("", true),
|
||||
EndOfGame("for the rest of the game", false),
|
||||
WhileOnBattlefield("", false),
|
||||
WhileOnStack("", false),
|
||||
WhileInGraveyard("", false),
|
||||
EndOfTurn("until end of turn", true),
|
||||
UntilYourNextTurn("until your next turn", true),
|
||||
UntilEndOfYourNextTurn("until the end of your next turn", true),
|
||||
UntilSourceLeavesBattlefield("until {source} leaves the battlefield", true), // supported for continuous layered effects
|
||||
EndOfCombat("until end of combat", true),
|
||||
EndOfStep("until end of phase step", true),
|
||||
Custom("", true);
|
||||
OneUse("", true, true),
|
||||
EndOfGame("for the rest of the game", false, false),
|
||||
WhileOnBattlefield("", false, false),
|
||||
WhileOnStack("", false, true),
|
||||
WhileInGraveyard("", false, false),
|
||||
EndOfTurn("until end of turn", true, true),
|
||||
UntilYourNextTurn("until your next turn", true, true),
|
||||
UntilEndOfYourNextTurn("until the end of your next turn", true, true),
|
||||
UntilSourceLeavesBattlefield("until {source} leaves the battlefield", true, false), // supported for continuous layered effects
|
||||
EndOfCombat("until end of combat", true, true),
|
||||
EndOfStep("until end of phase step", true, true),
|
||||
Custom("", true, true);
|
||||
|
||||
private final String text;
|
||||
private final boolean onlyValidIfNoZoneChange; // defines if an effect lasts only if the source has not chnaged zone since init of the effect
|
||||
private final boolean onlyValidIfNoZoneChange; // defines if an effect lasts only if the source has not changed zone since init of the effect
|
||||
private final boolean fixedController; // has the controller of the effect to change, if the controller of the source changes
|
||||
|
||||
Duration(String text, boolean onlyValidIfNoZoneChange) {
|
||||
Duration(String text, boolean onlyValidIfNoZoneChange, boolean fixedController) {
|
||||
this.text = text;
|
||||
this.onlyValidIfNoZoneChange = onlyValidIfNoZoneChange;
|
||||
this.fixedController = fixedController;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -34,4 +36,7 @@ public enum Duration {
|
|||
return onlyValidIfNoZoneChange;
|
||||
}
|
||||
|
||||
public boolean isFixedController() {
|
||||
return fixedController;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue