diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/GodoBanditWarlord.java b/Mage.Sets/src/mage/sets/championsofkamigawa/GodoBanditWarlord.java index c81c26932c..a5be0217c5 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/GodoBanditWarlord.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/GodoBanditWarlord.java @@ -33,14 +33,12 @@ import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AdditionalCombatPhaseEffect; import mage.abilities.effects.common.UntapAllControllerEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.TurnPhase; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.common.FilterControlledCreaturePermanent; @@ -51,7 +49,6 @@ import mage.filter.predicate.permanent.PermanentIdPredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; -import mage.game.turn.TurnMod; import mage.target.common.TargetCardInLibrary; import mage.util.CardUtil; @@ -145,25 +142,3 @@ class GodoBanditWarlordAttacksTriggeredAbility extends TriggeredAbilityImpl { } } -class AdditionalCombatPhaseEffect extends OneShotEffect { - - public AdditionalCombatPhaseEffect() { - super(Outcome.Benefit); - staticText = "After this phase, there is an additional combat phase"; - } - - public AdditionalCombatPhaseEffect(final AdditionalCombatPhaseEffect effect) { - super(effect); - } - - @Override - public AdditionalCombatPhaseEffect copy() { - return new AdditionalCombatPhaseEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false)); - return true; - } -} diff --git a/Mage.Sets/src/mage/sets/darksteel/SavageBeating.java b/Mage.Sets/src/mage/sets/darksteel/SavageBeating.java index a9aaec8f90..e9af0aca35 100644 --- a/Mage.Sets/src/mage/sets/darksteel/SavageBeating.java +++ b/Mage.Sets/src/mage/sets/darksteel/SavageBeating.java @@ -27,12 +27,10 @@ */ package mage.sets.darksteel; -import java.util.UUID; -import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.common.CastOnlyDuringPhaseStepSourceAbility; import mage.abilities.condition.common.MyTurnCondition; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AdditionalCombatPhaseEffect; import mage.abilities.effects.common.UntapAllControllerEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; import mage.abilities.keyword.DoubleStrikeAbility; @@ -40,13 +38,12 @@ import mage.abilities.keyword.EntwineAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TurnPhase; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreaturePermanent; -import mage.game.Game; -import mage.game.turn.TurnMod; + +import java.util.UUID; /** * @@ -68,7 +65,7 @@ public class SavageBeating extends CardImpl { // or untap all creatures you control and after this phase, there is an additional combat phase. Mode mode = new Mode(); mode.getEffects().add(new UntapAllControllerEffect(new FilterControlledCreaturePermanent(), "untap all creatures you control")); - mode.getEffects().add(new AdditionalCombatPhaseEffect()); + mode.getEffects().add(new AdditionalCombatPhaseEffect("and after this phase, there is an additional combat phase")); this.getSpellAbility().getModes().addMode(mode); // Entwine {1}{R} @@ -84,26 +81,3 @@ public class SavageBeating extends CardImpl { return new SavageBeating(this); } } - -class AdditionalCombatPhaseEffect extends OneShotEffect { - - AdditionalCombatPhaseEffect() { - super(Outcome.Benefit); - staticText = "and after this phase, there is an additional combat phase"; - } - - AdditionalCombatPhaseEffect(final AdditionalCombatPhaseEffect effect) { - super(effect); - } - - @Override - public AdditionalCombatPhaseEffect copy() { - return new AdditionalCombatPhaseEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false)); - return true; - } -} diff --git a/Mage.Sets/src/mage/sets/gatecrash/AureliaTheWarleader.java b/Mage.Sets/src/mage/sets/gatecrash/AureliaTheWarleader.java index 4f319993a0..50a948204f 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/AureliaTheWarleader.java +++ b/Mage.Sets/src/mage/sets/gatecrash/AureliaTheWarleader.java @@ -27,12 +27,11 @@ */ package mage.sets.gatecrash; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AdditionalCombatPhaseEffect; import mage.abilities.effects.common.UntapAllControllerEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.HasteAbility; @@ -40,15 +39,14 @@ import mage.abilities.keyword.VigilanceAbility; import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.TurnPhase; import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; -import mage.game.turn.TurnMod; + +import java.util.UUID; /** * @@ -156,26 +154,3 @@ class AureliaAttacksTriggeredAbility extends TriggeredAbilityImpl { return new AureliaAttacksTriggeredAbility(this); } } - -class AdditionalCombatPhaseEffect extends OneShotEffect { - - public AdditionalCombatPhaseEffect() { - super(Outcome.Benefit); - staticText = "After this phase, there is an additional combat phase"; - } - - public AdditionalCombatPhaseEffect(final AdditionalCombatPhaseEffect effect) { - super(effect); - } - - @Override - public AdditionalCombatPhaseEffect copy() { - return new AdditionalCombatPhaseEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false)); - return true; - } -} diff --git a/Mage.Sets/src/mage/sets/onslaught/AggravatedAssault.java b/Mage.Sets/src/mage/sets/onslaught/AggravatedAssault.java index 484b3ca33c..eac57de257 100644 --- a/Mage.Sets/src/mage/sets/onslaught/AggravatedAssault.java +++ b/Mage.Sets/src/mage/sets/onslaught/AggravatedAssault.java @@ -27,21 +27,18 @@ */ package mage.sets.onslaught; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.ActivateAsSorceryActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AddCombatAndMainPhaseEffect; import mage.abilities.effects.common.UntapAllControllerEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.TurnPhase; import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; -import mage.game.Game; -import mage.game.turn.TurnMod; + +import java.util.UUID; /** * @@ -56,7 +53,7 @@ public class AggravatedAssault extends CardImpl { // {3}{R}{R}: Untap all creatures you control. After this main phase, there is an additional combat phase followed by an additional main phase. Activate this ability only any time you could cast a sorcery. Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new UntapAllControllerEffect(new FilterControlledCreaturePermanent(), "Untap all creatures you control"), new ManaCostsImpl<>("{3}{R}{R}")); - ability.addEffect(new AdditionalCombatPhaseEffect()); + ability.addEffect(new AddCombatAndMainPhaseEffect()); this.addAbility(ability); } @@ -69,27 +66,3 @@ public class AggravatedAssault extends CardImpl { return new AggravatedAssault(this); } } - -class AdditionalCombatPhaseEffect extends OneShotEffect { - - AdditionalCombatPhaseEffect() { - super(Outcome.Benefit); - staticText = "After this main phase, there is an additional combat phase followed by an additional main phase"; - } - - AdditionalCombatPhaseEffect(final AdditionalCombatPhaseEffect effect) { - super(effect); - } - - @Override - public AdditionalCombatPhaseEffect copy() { - return new AdditionalCombatPhaseEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.POSTCOMBAT_MAIN, null, false)); - game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false)); - return true; - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/vintagemasters/ScourgeOfTheThrone.java b/Mage.Sets/src/mage/sets/vintagemasters/ScourgeOfTheThrone.java index fd0ac3ad98..9dc8b82f77 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/ScourgeOfTheThrone.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/ScourgeOfTheThrone.java @@ -27,29 +27,27 @@ */ package mage.sets.vintagemasters; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AdditionalCombatPhaseEffect; import mage.abilities.effects.common.UntapAllControllerEffect; import mage.abilities.keyword.DethroneAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.TurnPhase; import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; -import mage.game.turn.TurnMod; import mage.players.Player; import mage.util.CardUtil; +import java.util.UUID; + /** * * @author LevelX2 @@ -153,26 +151,3 @@ class ScourgeOfTheThroneAttacksTriggeredAbility extends TriggeredAbilityImpl { return new ScourgeOfTheThroneAttacksTriggeredAbility(this); } } - -class AdditionalCombatPhaseEffect extends OneShotEffect { - - public AdditionalCombatPhaseEffect() { - super(Outcome.Benefit); - staticText = "After this phase, there is an additional combat phase"; - } - - public AdditionalCombatPhaseEffect(final AdditionalCombatPhaseEffect effect) { - super(effect); - } - - @Override - public AdditionalCombatPhaseEffect copy() { - return new AdditionalCombatPhaseEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false)); - return true; - } -} diff --git a/Mage/src/main/java/mage/abilities/effects/common/AdditionalCombatPhaseEffect.java b/Mage/src/main/java/mage/abilities/effects/common/AdditionalCombatPhaseEffect.java new file mode 100644 index 0000000000..26f30dd7ac --- /dev/null +++ b/Mage/src/main/java/mage/abilities/effects/common/AdditionalCombatPhaseEffect.java @@ -0,0 +1,36 @@ +package mage.abilities.effects.common; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; +import mage.constants.TurnPhase; +import mage.game.Game; +import mage.game.turn.TurnMod; + +public class AdditionalCombatPhaseEffect extends OneShotEffect { + + public AdditionalCombatPhaseEffect() { + super(Outcome.Benefit); + staticText = "After this phase, there is an additional combat phase"; + } + + public AdditionalCombatPhaseEffect(String staticText) { + this(); + this.staticText = staticText; + } + + public AdditionalCombatPhaseEffect(final AdditionalCombatPhaseEffect effect) { + super(effect); + } + + @Override + public AdditionalCombatPhaseEffect copy() { + return new AdditionalCombatPhaseEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false)); + return true; + } +}