diff --git a/Mage.Sets/src/mage/cards/a/AggravatedAssault.java b/Mage.Sets/src/mage/cards/a/AggravatedAssault.java index db32fbfd80a..5b014bbdd97 100644 --- a/Mage.Sets/src/mage/cards/a/AggravatedAssault.java +++ b/Mage.Sets/src/mage/cards/a/AggravatedAssault.java @@ -1,6 +1,7 @@ package mage.cards.a; import java.util.UUID; + import mage.abilities.Ability; import mage.abilities.common.ActivateAsSorceryActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; @@ -19,7 +20,7 @@ import mage.filter.StaticFilters; public final class AggravatedAssault extends CardImpl { public AggravatedAssault(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); // {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(StaticFilters.FILTER_CONTROLLED_CREATURES, "Untap all creatures you control"), new ManaCostsImpl<>("{3}{R}{R}")); diff --git a/Mage.Sets/src/mage/cards/a/AllOutAssault.java b/Mage.Sets/src/mage/cards/a/AllOutAssault.java new file mode 100644 index 00000000000..1e25977cabb --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AllOutAssault.java @@ -0,0 +1,57 @@ +package mage.cards.a; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.delayed.WhenYouAttackDelayedTriggeredAbility; +import mage.abilities.condition.common.IsMainPhaseCondition; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AddCombatAndMainPhaseEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.UntapAllControllerEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.StaticFilters; + +/** + * + * @author androosss + */ +public final class AllOutAssault extends CardImpl { + + public AllOutAssault(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}{W}{B}"); + + // Creatures you control get +1/+1 and have deathtouch. + Ability anthemAbility = new SimpleStaticAbility(new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield)); + Effect effect = new GainAbilityControlledEffect(DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES); + effect.setText("and have deathtouch"); + anthemAbility.addEffect(effect); + this.addAbility(anthemAbility); + + // When this enchantment enters, if it's your main phase, there is an additional combat phase after this phase followed by an additional main phase. When you next attack this turn, untap each creature you control. + TriggeredAbility extraCombatAbility = new EntersBattlefieldTriggeredAbility(new AddCombatAndMainPhaseEffect().setText("there is an additional combat phase after this phase followed by an additional main phase")).setTriggerPhrase("When this enchantment enters, "); + extraCombatAbility.addEffect(new CreateDelayedTriggeredAbilityEffect(new WhenYouAttackDelayedTriggeredAbility( + new UntapAllControllerEffect( + StaticFilters.FILTER_CONTROLLED_CREATURE, "untap each creature you control"), Duration.EndOfTurn, true))); + this.addAbility(extraCombatAbility.withInterveningIf(IsMainPhaseCondition.YOUR)); + + } + + private AllOutAssault(final AllOutAssault card) { + super(card); + } + + @Override + public AllOutAssault copy() { + return new AllOutAssault(this); + } +} diff --git a/Mage.Sets/src/mage/cards/d/DovinsAcuity.java b/Mage.Sets/src/mage/cards/d/DovinsAcuity.java index ea8560753ea..d9f2fedf31f 100644 --- a/Mage.Sets/src/mage/cards/d/DovinsAcuity.java +++ b/Mage.Sets/src/mage/cards/d/DovinsAcuity.java @@ -3,7 +3,7 @@ package mage.cards.d; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility; -import mage.abilities.condition.Condition; +import mage.abilities.condition.common.IsMainPhaseCondition; import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.GainLifeEffect; @@ -11,12 +11,8 @@ import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.TurnPhase; import mage.filter.FilterSpell; -import mage.game.Game; -import java.util.EnumSet; -import java.util.Set; import java.util.UUID; /** @@ -42,7 +38,7 @@ public final class DovinsAcuity extends CardImpl { this.addAbility(new ConditionalTriggeredAbility( new SpellCastControllerTriggeredAbility( new ReturnToHandSourceEffect(true), filter, true - ), DovinsAcuityCondition.instance, + ), IsMainPhaseCondition.YOUR, "Whenever you cast an instant spell during your main phase, " + "you may return {this} to its owner's hand." )); @@ -56,16 +52,4 @@ public final class DovinsAcuity extends CardImpl { public DovinsAcuity copy() { return new DovinsAcuity(this); } -} - -enum DovinsAcuityCondition implements Condition { - - instance; - private static final Set turnPhases = EnumSet.of(TurnPhase.PRECOMBAT_MAIN, TurnPhase.POSTCOMBAT_MAIN); - - @Override - public boolean apply(Game game, Ability source) { - return game.isActivePlayer(source.getControllerId()) - && turnPhases.contains(game.getTurn().getPhase().getType()); - } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/f/FullThrottle.java b/Mage.Sets/src/mage/cards/f/FullThrottle.java index 99feea84526..740867674f2 100644 --- a/Mage.Sets/src/mage/cards/f/FullThrottle.java +++ b/Mage.Sets/src/mage/cards/f/FullThrottle.java @@ -3,8 +3,7 @@ package mage.cards.f; import java.util.UUID; import mage.abilities.DelayedTriggeredAbility; -import mage.abilities.condition.OrCondition; -import mage.abilities.condition.common.IsPhaseCondition; +import mage.abilities.condition.common.IsMainPhaseCondition; import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.common.*; import mage.cards.CardImpl; @@ -29,7 +28,7 @@ public final class FullThrottle extends CardImpl { // After this main phase, there are two additional combat phases. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new AdditionalCombatPhaseEffect(2), - new OrCondition(new IsPhaseCondition(TurnPhase.PRECOMBAT_MAIN), new IsPhaseCondition(TurnPhase.POSTCOMBAT_MAIN)), + IsMainPhaseCondition.ANY, "After this main phase, there are two additional combat phases." )); // At the beginning of each combat this turn, untap all creatures that attacked this turn. diff --git a/Mage.Sets/src/mage/cards/f/FuryOfTheHorde.java b/Mage.Sets/src/mage/cards/f/FuryOfTheHorde.java index 3679df4841b..e9953b771c7 100644 --- a/Mage.Sets/src/mage/cards/f/FuryOfTheHorde.java +++ b/Mage.Sets/src/mage/cards/f/FuryOfTheHorde.java @@ -2,6 +2,7 @@ package mage.cards.f; import java.util.UUID; + import mage.ObjectColor; import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.common.ExileFromHandCost; @@ -31,7 +32,7 @@ public final class FuryOfTheHorde extends CardImpl { } public FuryOfTheHorde(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{5}{R}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{R}{R}"); // You may exile two red cards from your hand rather than pay Fury of the Horde's mana cost. this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(2, filter)))); @@ -39,7 +40,6 @@ public final class FuryOfTheHorde extends CardImpl { // Untap all creatures that attacked this turn. After this main phase, there is an additional combat phase followed by an additional main phase. this.getSpellAbility().addEffect(new UntapAllEffect(filter2)); this.getSpellAbility().addEffect(new AddCombatAndMainPhaseEffect()); - } private FuryOfTheHorde(final FuryOfTheHorde card) { diff --git a/Mage.Sets/src/mage/cards/g/GrimReapersSprint.java b/Mage.Sets/src/mage/cards/g/GrimReapersSprint.java index 987de512f41..10efdaf4a85 100644 --- a/Mage.Sets/src/mage/cards/g/GrimReapersSprint.java +++ b/Mage.Sets/src/mage/cards/g/GrimReapersSprint.java @@ -4,9 +4,10 @@ import mage.abilities.Ability; import mage.abilities.SpellAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.IsMainPhaseCondition; import mage.abilities.condition.common.MorbidCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.AdditionalCombatPhaseEffect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.UntapAllControllerEffect; @@ -21,7 +22,6 @@ import mage.cards.CardSetInfo; import mage.constants.*; import mage.filter.StaticFilters; import mage.game.Game; -import mage.players.Player; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; import mage.util.CardUtil; @@ -59,7 +59,7 @@ public final class GrimReapersSprint extends CardImpl { "untap each creature you control" ), false ); - triggeredAbility.addEffect(new GrimReapersSprintEffect()); + triggeredAbility.addEffect(new ConditionalOneShotEffect(new AdditionalCombatPhaseEffect(), IsMainPhaseCondition.YOUR, "If it's your main phase, there is an additional combat phase after this phase.")); this.addAbility(triggeredAbility); // Enchanted creature gets +2/+2 and has haste. @@ -110,32 +110,4 @@ class GrimReapersSprintCostModificationEffect extends CostModificationEffectImpl public GrimReapersSprintCostModificationEffect copy() { return new GrimReapersSprintCostModificationEffect(this); } -} - -class GrimReapersSprintEffect extends OneShotEffect { - - GrimReapersSprintEffect() { - super(Outcome.Benefit); - this.staticText = "If it's your main phase, there is an additional combat phase after this phase"; - } - - private GrimReapersSprintEffect(final GrimReapersSprintEffect effect) { - super(effect); - } - - @Override - public GrimReapersSprintEffect copy() { - return new GrimReapersSprintEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null - && game.isActivePlayer(source.getControllerId()) - && game.getTurnPhaseType().isMain()) { - return new AdditionalCombatPhaseEffect().apply(game, source); - } - return false; - } -} +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/j/JayaFieryNegotiator.java b/Mage.Sets/src/mage/cards/j/JayaFieryNegotiator.java index ded7c8c9f7c..054c69698e7 100644 --- a/Mage.Sets/src/mage/cards/j/JayaFieryNegotiator.java +++ b/Mage.Sets/src/mage/cards/j/JayaFieryNegotiator.java @@ -1,9 +1,8 @@ package mage.cards.j; import mage.abilities.Ability; -import mage.abilities.DelayedTriggeredAbility; import mage.abilities.LoyaltyAbility; -import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.common.delayed.WhenYouAttackDelayedTriggeredAbility; import mage.abilities.dynamicvalue.common.AttackingCreatureCount; import mage.abilities.effects.common.*; import mage.cards.CardImpl; @@ -12,14 +11,10 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; import mage.constants.SuperType; -import mage.game.Controllable; -import mage.game.Game; import mage.game.command.emblems.JayaFieryNegotiatorEmblem; -import mage.game.events.GameEvent; import mage.game.permanent.token.MonkRedToken; import mage.target.common.TargetOpponentsCreaturePermanent; -import java.util.Objects; import java.util.UUID; /** @@ -42,7 +37,7 @@ public final class JayaFieryNegotiator extends CardImpl { // −2: Choose target creature an opponent controls. Whenever you attack this turn, Jaya, Fiery Negotiator deals damage equal to the number of attacking creatures to that creature. Ability ability = new LoyaltyAbility(new CreateDelayedTriggeredAbilityEffect( - new JayaFieryNegotiatorTriggeredAbility() + new WhenYouAttackDelayedTriggeredAbility(new DamageTargetEffect(new AttackingCreatureCount())) ).setText("choose target creature an opponent controls. Whenever you attack this turn, " + "{this} deals damage equal to the number of attacking creatures to that creature"), -2); ability.addTarget(new TargetOpponentsCreaturePermanent()); @@ -60,45 +55,4 @@ public final class JayaFieryNegotiator extends CardImpl { public JayaFieryNegotiator copy() { return new JayaFieryNegotiator(this); } -} - -class JayaFieryNegotiatorTriggeredAbility extends DelayedTriggeredAbility { - - private static final DynamicValue xValue = new AttackingCreatureCount(); - - JayaFieryNegotiatorTriggeredAbility() { - super(new DamageTargetEffect(xValue), Duration.EndOfTurn, false, false); - } - - private JayaFieryNegotiatorTriggeredAbility(final JayaFieryNegotiatorTriggeredAbility ability) { - super(ability); - } - - @Override - public JayaFieryNegotiatorTriggeredAbility copy() { - return new JayaFieryNegotiatorTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.DECLARED_ATTACKERS; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - return isControlledBy(game.getCombat().getAttackingPlayerId()) - && game - .getCombat() - .getAttackers() - .stream() - .map(game::getPermanent) - .filter(Objects::nonNull) - .map(Controllable::getControllerId) - .anyMatch(this::isControlledBy); - } - - @Override - public String getRule() { - return "Whenever you attack this turn, {this} deals damage equal to the number of attacking creatures to that creature."; - } -} +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/l/LastNightTogether.java b/Mage.Sets/src/mage/cards/l/LastNightTogether.java index 1988c97d5c3..3b804fc0b31 100644 --- a/Mage.Sets/src/mage/cards/l/LastNightTogether.java +++ b/Mage.Sets/src/mage/cards/l/LastNightTogether.java @@ -82,7 +82,7 @@ class LastNightTogetherEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { // 15.07.2006 If it's somehow not a main phase when Fury of the Horde resolves, all it does is untap all creatures that attacked that turn. No new phases are created. // Same ruling applies here - if (game.getTurnPhaseType() == TurnPhase.PRECOMBAT_MAIN || game.getTurnPhaseType() == TurnPhase.POSTCOMBAT_MAIN) { + if (game.getTurnPhaseType().isMain()) { // At the start of that combat, add a restriction effect preventing other creatures from attacking. TurnMod combat = new TurnMod(game.getState().getActivePlayerId()).withExtraPhase(TurnPhase.COMBAT); game.getState().getTurnMods().add(combat); diff --git a/Mage.Sets/src/mage/cards/m/MoraugFuryOfAkoum.java b/Mage.Sets/src/mage/cards/m/MoraugFuryOfAkoum.java index f446bd4c580..3843f45540f 100644 --- a/Mage.Sets/src/mage/cards/m/MoraugFuryOfAkoum.java +++ b/Mage.Sets/src/mage/cards/m/MoraugFuryOfAkoum.java @@ -6,7 +6,7 @@ import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.LandfallAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.condition.Condition; +import mage.abilities.condition.common.IsMainPhaseCondition; import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.OneShotEffect; @@ -41,7 +41,7 @@ public final class MoraugFuryOfAkoum extends CardImpl { // Landfall — Whenever a land you control enters, if it's your main phase, there's an additional combat phase after this phase. At the beginning of that combat, untap all creatures you control. this.addAbility(new ConditionalInterveningIfTriggeredAbility( - new LandfallAbility(new MoraugFuryOfAkoumCombatEffect()), MoraugFuryOfAkoumCondition.instance, + new LandfallAbility(new MoraugFuryOfAkoumCombatEffect()), IsMainPhaseCondition.YOUR, "Landfall — Whenever a land you control enters, " + "if it's your main phase, there's an additional combat phase after this phase. " + "At the beginning of that combat, untap all creatures you control." @@ -58,15 +58,6 @@ public final class MoraugFuryOfAkoum extends CardImpl { } } -enum MoraugFuryOfAkoumCondition implements Condition { - instance; - - @Override - public boolean apply(Game game, Ability source) { - return game.isActivePlayer(source.getControllerId()) && game.getTurnPhaseType().isMain(); - } -} - class MoraugFuryOfAkoumBoostEffect extends ContinuousEffectImpl { MoraugFuryOfAkoumBoostEffect() { @@ -198,4 +189,4 @@ class MoraugFuryOfAkoumWatcher extends Watcher { } } } -} +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/o/OverpoweringAttack.java b/Mage.Sets/src/mage/cards/o/OverpoweringAttack.java index a5e8544e9b1..6be46cd93da 100644 --- a/Mage.Sets/src/mage/cards/o/OverpoweringAttack.java +++ b/Mage.Sets/src/mage/cards/o/OverpoweringAttack.java @@ -2,8 +2,6 @@ package mage.cards.o; import java.util.UUID; -import mage.abilities.condition.common.MyTurnCondition; -import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.common.AddCombatAndMainPhaseEffect; import mage.abilities.effects.common.UntapAllControllerEffect; import mage.abilities.keyword.FreerunningAbility; @@ -27,14 +25,13 @@ public final class OverpoweringAttack extends CardImpl { public OverpoweringAttack(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); - // Freerunning {2}{R} this.addAbility(new FreerunningAbility("{2}{R}")); // Untap all creatures you control that attacked this turn. If it's your main phase, there is an additional combat phase after this phase, followed by an additional main phase. - this.getSpellAbility().addEffect(new UntapAllControllerEffect(filter, "untap all creatures you control that attacked this turn")); - this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new AddCombatAndMainPhaseEffect(), MyTurnCondition.instance, "If it's your main phase, there is an additional combat phase after this phase, followed by an additional main phase.")); + this.getSpellAbility().addEffect(new UntapAllControllerEffect(filter, "Untap all creatures you control that attacked this turn")); + this.getSpellAbility().addEffect(new AddCombatAndMainPhaseEffect().setText("If it's your main phase, there is an additional combat phase after this phase, followed by an additional main phase")); } private OverpoweringAttack(final OverpoweringAttack card) { diff --git a/Mage.Sets/src/mage/cards/r/RelentlessAssault.java b/Mage.Sets/src/mage/cards/r/RelentlessAssault.java index 3653960e528..8d79c295b4d 100644 --- a/Mage.Sets/src/mage/cards/r/RelentlessAssault.java +++ b/Mage.Sets/src/mage/cards/r/RelentlessAssault.java @@ -2,6 +2,7 @@ package mage.cards.r; import java.util.UUID; + import mage.abilities.effects.common.AddCombatAndMainPhaseEffect; import mage.abilities.effects.common.UntapAllEffect; import mage.cards.CardImpl; @@ -23,7 +24,7 @@ public final class RelentlessAssault extends CardImpl { } public RelentlessAssault(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{R}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}{R}"); // Untap all creatures that attacked this turn. After this main phase, there is an additional combat phase followed by an additional main phase. this.getSpellAbility().addEffect(new UntapAllEffect(filter)); diff --git a/Mage.Sets/src/mage/cards/r/ResponseResurgence.java b/Mage.Sets/src/mage/cards/r/ResponseResurgence.java index 3d16a0a0bfa..afeb909dfef 100644 --- a/Mage.Sets/src/mage/cards/r/ResponseResurgence.java +++ b/Mage.Sets/src/mage/cards/r/ResponseResurgence.java @@ -1,6 +1,7 @@ package mage.cards.r; import java.util.UUID; + import mage.abilities.effects.common.AddCombatAndMainPhaseEffect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; diff --git a/Mage.Sets/src/mage/cards/s/SeizeTheDay.java b/Mage.Sets/src/mage/cards/s/SeizeTheDay.java index af935cf911d..bb1738dd632 100644 --- a/Mage.Sets/src/mage/cards/s/SeizeTheDay.java +++ b/Mage.Sets/src/mage/cards/s/SeizeTheDay.java @@ -2,6 +2,7 @@ package mage.cards.s; import java.util.UUID; + import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.AddCombatAndMainPhaseEffect; import mage.abilities.effects.common.UntapTargetEffect; @@ -9,7 +10,6 @@ import mage.abilities.keyword.FlashbackAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.TimingRule; import mage.target.common.TargetCreaturePermanent; /** @@ -19,7 +19,7 @@ import mage.target.common.TargetCreaturePermanent; public final class SeizeTheDay extends CardImpl { public SeizeTheDay(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R}"); // Untap target creature. After this main phase, there is an additional combat phase followed by an additional main phase. this.getSpellAbility().addEffect(new UntapTargetEffect()); diff --git a/Mage.Sets/src/mage/cards/w/WavesOfAggression.java b/Mage.Sets/src/mage/cards/w/WavesOfAggression.java index 42c836e8edd..1ee37490612 100644 --- a/Mage.Sets/src/mage/cards/w/WavesOfAggression.java +++ b/Mage.Sets/src/mage/cards/w/WavesOfAggression.java @@ -25,7 +25,7 @@ public final class WavesOfAggression extends CardImpl { } public WavesOfAggression(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{R/W}{R/W}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R/W}{R/W}"); // Untap all creatures that attacked this turn. After this main phase, there is an additional combat phase followed by an additional main phase. this.getSpellAbility().addEffect(new UntapAllEffect(filter)); diff --git a/Mage.Sets/src/mage/sets/TarkirDragonstorm.java b/Mage.Sets/src/mage/sets/TarkirDragonstorm.java index 866dfa8c84f..f7de48bf98c 100644 --- a/Mage.Sets/src/mage/sets/TarkirDragonstorm.java +++ b/Mage.Sets/src/mage/sets/TarkirDragonstorm.java @@ -1,5 +1,8 @@ package mage.sets; +import java.util.Arrays; +import java.util.List; + import mage.cards.ExpansionSet; import mage.constants.Rarity; import mage.constants.SetType; @@ -31,6 +34,10 @@ public final class TarkirDragonstorm extends ExpansionSet { cards.add(new SetCardInfo("Ainok Wayfarer", 134, Rarity.COMMON, mage.cards.a.AinokWayfarer.class)); cards.add(new SetCardInfo("Alchemist's Assistant", 71, Rarity.UNCOMMON, mage.cards.a.AlchemistsAssistant.class)); cards.add(new SetCardInfo("Alesha's Legacy", 72, Rarity.COMMON, mage.cards.a.AleshasLegacy.class)); + cards.add(new SetCardInfo("All-Out Assault", 167, Rarity.MYTHIC, mage.cards.a.AllOutAssault.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("All-Out Assault", 352, Rarity.MYTHIC, mage.cards.a.AllOutAssault.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("All-Out Assault", 405, Rarity.MYTHIC, mage.cards.a.AllOutAssault.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("All-Out Assault", 415, Rarity.MYTHIC, mage.cards.a.AllOutAssault.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Ambling Stormshell", 37, Rarity.RARE, mage.cards.a.AmblingStormshell.class)); cards.add(new SetCardInfo("Anafenza, Unyielding Lineage", 2, Rarity.RARE, mage.cards.a.AnafenzaUnyieldingLineage.class)); cards.add(new SetCardInfo("Arashin Sunshield", 3, Rarity.COMMON, mage.cards.a.ArashinSunshield.class)); diff --git a/Mage/src/main/java/mage/abilities/common/delayed/WhenYouAttackDelayedTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/delayed/WhenYouAttackDelayedTriggeredAbility.java new file mode 100644 index 00000000000..032828b701e --- /dev/null +++ b/Mage/src/main/java/mage/abilities/common/delayed/WhenYouAttackDelayedTriggeredAbility.java @@ -0,0 +1,49 @@ +package mage.abilities.common.delayed; + +import java.util.UUID; + +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.constants.Duration; +import mage.game.Game; +import mage.game.events.GameEvent; + +/** + * @author androosss + */ +public class WhenYouAttackDelayedTriggeredAbility extends DelayedTriggeredAbility { + + public WhenYouAttackDelayedTriggeredAbility(Effect effect) { + this(effect, Duration.EndOfTurn); + } + + public WhenYouAttackDelayedTriggeredAbility(Effect effect, Duration duration) { + this(effect, duration, false); + } + + public WhenYouAttackDelayedTriggeredAbility(Effect effect, Duration duration, boolean triggerOnlyOnce) { + super(effect, duration, triggerOnlyOnce); + setTriggerPhrase((triggerOnlyOnce ? "When you next" : "Whenever you") + " attack" + + (duration == Duration.EndOfTurn ? " this turn, " : ", ")); + } + + protected WhenYouAttackDelayedTriggeredAbility(final WhenYouAttackDelayedTriggeredAbility ability) { + super(ability); + } + + @Override + public WhenYouAttackDelayedTriggeredAbility copy() { + return new WhenYouAttackDelayedTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DECLARED_ATTACKERS; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + UUID attackerId = game.getCombat().getAttackingPlayerId(); + return attackerId != null && attackerId.equals(getControllerId()) && !game.getCombat().getAttackers().isEmpty(); + } +} diff --git a/Mage/src/main/java/mage/abilities/condition/common/IsMainPhaseCondition.java b/Mage/src/main/java/mage/abilities/condition/common/IsMainPhaseCondition.java new file mode 100644 index 00000000000..4d10747d907 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/condition/common/IsMainPhaseCondition.java @@ -0,0 +1,32 @@ + +package mage.abilities.condition.common; + +import mage.abilities.Ability; +import mage.abilities.condition.Condition; +import mage.game.Game; + +/** + * @author androosss + */ +public enum IsMainPhaseCondition implements Condition { + + YOUR(true), + ANY(false); + + private final boolean yourMainPhaseOnly; + + IsMainPhaseCondition(boolean yourMainPhaseOnly) { + this.yourMainPhaseOnly = yourMainPhaseOnly; + } + + @Override + public boolean apply(Game game, Ability source) { + return game.getTurnPhaseType().isMain() && + (!yourMainPhaseOnly || game.getActivePlayerId().equals(source.getControllerId())); + } + + @Override + public String toString() { + return "it's" + (yourMainPhaseOnly ? " your " : " ") + "main phase"; + } +} diff --git a/Mage/src/main/java/mage/abilities/effects/common/AddCombatAndMainPhaseEffect.java b/Mage/src/main/java/mage/abilities/effects/common/AddCombatAndMainPhaseEffect.java index 0caa4f4ec02..ddffc5830d6 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/AddCombatAndMainPhaseEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/AddCombatAndMainPhaseEffect.java @@ -35,8 +35,7 @@ public class AddCombatAndMainPhaseEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { // 15.07.2006 If it's somehow not a main phase when Fury of the Horde resolves, all it does is untap all creatures that attacked that turn. No new phases are created. - if (game.getTurnPhaseType() == TurnPhase.PRECOMBAT_MAIN - || game.getTurnPhaseType() == TurnPhase.POSTCOMBAT_MAIN) { + if (game.getTurnPhaseType().isMain()) { // we can't add two turn modes at once, will add additional post combat on delayed trigger resolution TurnMod combat = new TurnMod(source.getControllerId()).withExtraPhase(TurnPhase.COMBAT, TurnPhase.POSTCOMBAT_MAIN); game.getState().getTurnMods().add(combat);