Implement Brazen Cannonade, and new UntilEndOfNextCombatStep duration (#10047)

This commit is contained in:
Sean Walsh 2023-04-10 19:36:21 -05:00 committed by GitHub
parent f1fdfc2c70
commit 7db278bdf1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 91 additions and 0 deletions

View file

@ -228,6 +228,12 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu
return EndStepCountWatcher.getCount(startingControllerId, game) > effectStartingEndStep;
}
public boolean isYourNextEndCombatStep(Game game) {
return effectStartingOnTurn < game.getTurnNum()
&& game.isActivePlayer(startingControllerId)
&& game.getPhase().getType() == TurnPhase.POSTCOMBAT_MAIN;
}
@Override
public boolean isInactive(Ability source, Game game) {
// YOUR turn checks
@ -237,6 +243,7 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu
case UntilYourNextTurn:
case UntilEndOfYourNextTurn:
case UntilYourNextEndStep:
case UntilYourNextEndCombatStep:
break;
default:
return false;
@ -278,6 +285,12 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu
if (player != null && player.isInGame()) {
return this.isYourNextEndStep(game);
}
break;
case UntilYourNextEndCombatStep:
if (player != null && player.isInGame()) {
return this.isYourNextEndCombatStep(game);
}
break;
}
return canDelete;

View file

@ -154,6 +154,7 @@ public class ContinuousEffectsList<T extends ContinuousEffect> extends ArrayList
case Custom:
case UntilYourNextTurn:
case UntilEndOfYourNextTurn:
case UntilYourNextEndCombatStep:
case UntilYourNextEndStep:
// until your turn effects continue until real turn reached, their used it's own inactive method
// 514.2 Second, the following actions happen simultaneously: all damage marked on permanents

View file

@ -13,6 +13,7 @@ public enum Duration {
EndOfTurn("until end of turn", true, true),
UntilYourNextTurn("until your next turn", true, true),
UntilYourNextEndStep("until your next end step", true, true),
UntilYourNextEndCombatStep("until your next end of combat step", false, true),
UntilEndOfYourNextTurn("until the end of your next turn", true, true),
UntilSourceLeavesBattlefield("until {this} leaves the battlefield", true, false), // supported for continuous layered effects
EndOfCombat("until end of combat", true, true),