From 8874675b47407a4a6faf7b4346d991195413d032 Mon Sep 17 00:00:00 2001 From: Steven Knipe Date: Mon, 13 Oct 2025 04:47:43 -0700 Subject: [PATCH] Convert Overload cards A-D --- Mage.Sets/src/mage/cards/b/Blustersquall.java | 38 +------------- Mage.Sets/src/mage/cards/b/BreakTheIce.java | 7 +-- .../src/mage/cards/c/ChemistersTrick.java | 47 ++--------------- .../src/mage/cards/c/CorporealProjection.java | 15 +----- Mage.Sets/src/mage/cards/c/Counterflux.java | 50 ++----------------- Mage.Sets/src/mage/cards/c/CyclonicRift.java | 10 +--- Mage.Sets/src/mage/cards/d/Damn.java | 14 ++---- Mage.Sets/src/mage/cards/d/Downsize.java | 10 +--- Mage.Sets/src/mage/cards/d/Dragonshift.java | 18 ++----- Mage.Sets/src/mage/cards/d/Dynacharge.java | 12 ++--- 10 files changed, 28 insertions(+), 193 deletions(-) diff --git a/Mage.Sets/src/mage/cards/b/Blustersquall.java b/Mage.Sets/src/mage/cards/b/Blustersquall.java index 0bfe1d44ba7..435cb595872 100644 --- a/Mage.Sets/src/mage/cards/b/Blustersquall.java +++ b/Mage.Sets/src/mage/cards/b/Blustersquall.java @@ -1,20 +1,12 @@ package mage.cards.b; -import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.TapTargetEffect; import mage.abilities.keyword.OverloadAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Outcome; -import mage.filter.StaticFilters; -import mage.filter.common.FilterCreaturePermanent; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.target.TargetPermanent; -import mage.target.common.TargetCreaturePermanent; import java.util.UUID; @@ -29,11 +21,10 @@ public final class Blustersquall extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}"); // Tap target creature you don't control. - this.getSpellAbility().addTarget(new TargetPermanent(FILTER_CREATURE_YOU_DONT_CONTROL)); - this.getSpellAbility().addEffect(new TapTargetEffect()); // Overload {3}{U} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.") - this.addAbility(new OverloadAbility(this, new BlustersqallTapAllEffect(), new ManaCostsImpl<>("{3}{U}"))); + OverloadAbility.ImplementOverloadAbility(this, new ManaCostsImpl<>("{3}{U}"), + new TargetPermanent(FILTER_CREATURE_YOU_DONT_CONTROL), new TapTargetEffect()); } private Blustersquall(final Blustersquall card) { @@ -45,28 +36,3 @@ public final class Blustersquall extends CardImpl { return new Blustersquall(this); } } - -class BlustersqallTapAllEffect extends OneShotEffect { - - BlustersqallTapAllEffect() { - super(Outcome.Tap); - staticText = "Tap each creature you don't control"; - } - - private BlustersqallTapAllEffect(final BlustersqallTapAllEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, source.getControllerId(), source, game)) { - creature.tap(source, game); - } - return true; - } - - @Override - public BlustersqallTapAllEffect copy() { - return new BlustersqallTapAllEffect(this); - } -} diff --git a/Mage.Sets/src/mage/cards/b/BreakTheIce.java b/Mage.Sets/src/mage/cards/b/BreakTheIce.java index 1339b17b491..fbc8d239877 100644 --- a/Mage.Sets/src/mage/cards/b/BreakTheIce.java +++ b/Mage.Sets/src/mage/cards/b/BreakTheIce.java @@ -1,7 +1,6 @@ package mage.cards.b; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.DestroyAllEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.OverloadAbility; import mage.cards.CardImpl; @@ -34,11 +33,9 @@ public final class BreakTheIce extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}{B}"); // Destroy target land that is snow or could produce {C}. - this.getSpellAbility().addEffect(new DestroyTargetEffect()); - this.getSpellAbility().addTarget(new TargetPermanent(filter)); - // Overload {4}{B}{B} - this.addAbility(new OverloadAbility(this, new DestroyAllEffect(filter), new ManaCostsImpl<>("{4}{B}{B}"))); + OverloadAbility.ImplementOverloadAbility(this, new ManaCostsImpl<>("{4}{B}{B}"), + new TargetPermanent(filter), new DestroyTargetEffect()); } private BreakTheIce(final BreakTheIce card) { diff --git a/Mage.Sets/src/mage/cards/c/ChemistersTrick.java b/Mage.Sets/src/mage/cards/c/ChemistersTrick.java index 0b350b5185a..5b1bd778b82 100644 --- a/Mage.Sets/src/mage/cards/c/ChemistersTrick.java +++ b/Mage.Sets/src/mage/cards/c/ChemistersTrick.java @@ -1,23 +1,14 @@ package mage.cards.c; -import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.combat.AttacksIfAbleTargetEffect; -import mage.abilities.effects.common.continuous.BoostAllEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.keyword.OverloadAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.Outcome; -import mage.filter.StaticFilters; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.target.TargetPermanent; -import mage.target.common.TargetCreaturePermanent; -import mage.target.targetpointer.FixedTarget; import java.util.UUID; @@ -33,14 +24,10 @@ public final class ChemistersTrick extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}{R}"); // Target creature you don't control gets -2/-0 until end of turn and attacks this turn if able. - this.getSpellAbility().addTarget(new TargetPermanent(FILTER_CREATURE_YOU_DONT_CONTROL)); - this.getSpellAbility().addEffect(new BoostTargetEffect(-2, 0, Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new AttacksIfAbleTargetEffect(Duration.EndOfTurn).setText("and attacks this turn if able")); - // Overload {3}{U}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.") - OverloadAbility ability = new OverloadAbility(this, new BoostAllEffect(-2, 0, Duration.EndOfTurn, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, false), new ManaCostsImpl<>("{3}{U}{R}")); - ability.addEffect(new ChemistersTrickEffect()); - this.addAbility(ability); + OverloadAbility.ImplementOverloadAbility(this, new ManaCostsImpl<>("{3}{U}{R}"), + new TargetPermanent(FILTER_CREATURE_YOU_DONT_CONTROL), new BoostTargetEffect(-2, 0, Duration.EndOfTurn), + new AttacksIfAbleTargetEffect(Duration.EndOfTurn).setText("and attacks this turn if able")); } private ChemistersTrick(final ChemistersTrick card) { @@ -52,31 +39,3 @@ public final class ChemistersTrick extends CardImpl { return new ChemistersTrick(this); } } - -class ChemistersTrickEffect extends OneShotEffect { - - - ChemistersTrickEffect() { - super(Outcome.ReturnToHand); - staticText = "each creature you don't control attacks this turn if able"; - } - - private ChemistersTrickEffect(final ChemistersTrickEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, source.getControllerId(), source, game)) { - AttacksIfAbleTargetEffect effect = new AttacksIfAbleTargetEffect(Duration.EndOfTurn); - effect.setTargetPointer(new FixedTarget(creature.getId(), game)); - game.addEffect(effect, source); - } - return true; - } - - @Override - public ChemistersTrickEffect copy() { - return new ChemistersTrickEffect(this); - } -} diff --git a/Mage.Sets/src/mage/cards/c/CorporealProjection.java b/Mage.Sets/src/mage/cards/c/CorporealProjection.java index e91c44cbe31..161d8bc201d 100644 --- a/Mage.Sets/src/mage/cards/c/CorporealProjection.java +++ b/Mage.Sets/src/mage/cards/c/CorporealProjection.java @@ -1,15 +1,12 @@ package mage.cards.c; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.continuous.GainAbilityAllEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.keyword.MyriadAbility; import mage.abilities.keyword.OverloadAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Duration; -import mage.filter.StaticFilters; import mage.target.common.TargetControlledCreaturePermanent; import java.util.UUID; @@ -23,17 +20,9 @@ public final class CorporealProjection extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{U}{R}"); // Target creature you control gains myriad until end of turn. - this.getSpellAbility().addEffect(new GainAbilityTargetEffect(new MyriadAbility(false))); - this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); - // Overload {3}{U}{U}{R}{R} - this.addAbility(new OverloadAbility( - this, - new GainAbilityAllEffect( - new MyriadAbility(false), Duration.EndOfTurn, - StaticFilters.FILTER_CONTROLLED_CREATURE - ), new ManaCostsImpl<>("{3}{U}{U}{R}{R}") - )); + OverloadAbility.ImplementOverloadAbility(this, new ManaCostsImpl<>("{3}{U}{U}{R}{R}"), + new TargetControlledCreaturePermanent(), new GainAbilityTargetEffect(new MyriadAbility(false))); } private CorporealProjection(final CorporealProjection card) { diff --git a/Mage.Sets/src/mage/cards/c/Counterflux.java b/Mage.Sets/src/mage/cards/c/Counterflux.java index cad1aa3ac11..e4b74893e8b 100644 --- a/Mage.Sets/src/mage/cards/c/Counterflux.java +++ b/Mage.Sets/src/mage/cards/c/Counterflux.java @@ -1,29 +1,23 @@ package mage.cards.c; -import java.util.LinkedList; -import java.util.List; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CantBeCounteredSourceEffect; import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.keyword.OverloadAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.FilterSpell; -import mage.game.Game; -import mage.game.stack.Spell; -import mage.game.stack.StackObject; import mage.target.TargetSpell; +import java.util.UUID; + /** * @@ -49,11 +43,9 @@ public final class Counterflux extends CardImpl { this.addAbility(ability); // Counter target spell you don't control. - this.getSpellAbility().addTarget(new TargetSpell(filter)); - this.getSpellAbility().addEffect(new CounterTargetEffect()); - // Overload {1}{U}{U}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.") - this.addAbility(new OverloadAbility(this, new CounterfluxEffect(), new ManaCostsImpl<>("{1}{U}{U}{R}"))); + OverloadAbility.ImplementOverloadAbility(this, new ManaCostsImpl<>("{1}{U}{U}{R}"), + new TargetSpell(filter), new CounterTargetEffect()); } private Counterflux(final Counterflux card) { @@ -65,37 +57,3 @@ public final class Counterflux extends CardImpl { return new Counterflux(this); } } - -class CounterfluxEffect extends OneShotEffect { - - CounterfluxEffect() { - super(Outcome.Detriment); - staticText = "Counter each spell you don't control."; - - } - - private CounterfluxEffect(final CounterfluxEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - - List spellsToCounter = new LinkedList<>(); - for (StackObject stackObject : game.getStack()) { - if (stackObject instanceof Spell && !stackObject.isControlledBy(source.getControllerId())) { - spellsToCounter.add((Spell) stackObject); - } - } - for (Spell spell : spellsToCounter) { - game.getStack().counter(spell.getId(), source, game); - } - return true; - } - - @Override - public CounterfluxEffect copy() { - return new CounterfluxEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/cards/c/CyclonicRift.java b/Mage.Sets/src/mage/cards/c/CyclonicRift.java index 728c94209e3..ed1038ec360 100644 --- a/Mage.Sets/src/mage/cards/c/CyclonicRift.java +++ b/Mage.Sets/src/mage/cards/c/CyclonicRift.java @@ -1,8 +1,6 @@ package mage.cards.c; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.Effect; -import mage.abilities.effects.common.ReturnToHandFromBattlefieldAllEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.OverloadAbility; import mage.cards.CardImpl; @@ -29,13 +27,9 @@ public final class CyclonicRift extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}"); // Return target nonland permanent you don't control to its owner's hand. - this.getSpellAbility().addTarget(new TargetPermanent(filter)); - this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); - // Overload {6}{U} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.") - Effect effect = new ReturnToHandFromBattlefieldAllEffect(filter); - effect.setText("Return each nonland permanent you don't control to its owner's hand"); - this.addAbility(new OverloadAbility(this, effect, new ManaCostsImpl<>("{6}{U}"))); + OverloadAbility.ImplementOverloadAbility(this, new ManaCostsImpl<>("{6}{U}"), + new TargetPermanent(filter), new ReturnToHandTargetEffect()); } private CyclonicRift(final CyclonicRift card) { diff --git a/Mage.Sets/src/mage/cards/d/Damn.java b/Mage.Sets/src/mage/cards/d/Damn.java index 3f556e82b5e..9141a7c8355 100644 --- a/Mage.Sets/src/mage/cards/d/Damn.java +++ b/Mage.Sets/src/mage/cards/d/Damn.java @@ -1,13 +1,11 @@ package mage.cards.d; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.DestroyAllEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.OverloadAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.StaticFilters; import mage.target.common.TargetCreaturePermanent; import java.util.UUID; @@ -22,16 +20,10 @@ public final class Damn extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}{B}"); // Destroy target creature. A creature destroyed this way can’t be regenerated. - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new DestroyTargetEffect(true) - .setText("destroy target creature. A creature destroyed this way can't be regenerated")); - // Overload {2}{W}{W} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of “target” with “each.”) - this.addAbility(new OverloadAbility( - this, - new DestroyAllEffect(StaticFilters.FILTER_PERMANENT_CREATURES, true), - new ManaCostsImpl<>("{2}{W}{W}") - )); + OverloadAbility.ImplementOverloadAbility(this, new ManaCostsImpl<>("{2}{W}{W}"), + new TargetCreaturePermanent(), new DestroyTargetEffect(true) + .setText("destroy target creature. A creature destroyed this way can't be regenerated")); } private Damn(final Damn card) { diff --git a/Mage.Sets/src/mage/cards/d/Downsize.java b/Mage.Sets/src/mage/cards/d/Downsize.java index 96c802234f5..59334f5d077 100644 --- a/Mage.Sets/src/mage/cards/d/Downsize.java +++ b/Mage.Sets/src/mage/cards/d/Downsize.java @@ -1,16 +1,13 @@ package mage.cards.d; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.continuous.BoostAllEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.keyword.OverloadAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.filter.StaticFilters; import mage.target.TargetPermanent; -import mage.target.common.TargetCreaturePermanent; import java.util.UUID; @@ -25,12 +22,9 @@ public final class Downsize extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}"); // Target creature you don't control gets -4/-0 until end of turn. - this.getSpellAbility().addTarget(new TargetPermanent(FILTER_CREATURE_YOU_DONT_CONTROL)); - this.getSpellAbility().addEffect(new BoostTargetEffect(-4, 0, Duration.EndOfTurn)); - // Overload {2}{U} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.") - this.addAbility(new OverloadAbility(this, new BoostAllEffect(-4, 0, Duration.EndOfTurn, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, false), new ManaCostsImpl<>("{2}{U}"))); - + OverloadAbility.ImplementOverloadAbility(this, new ManaCostsImpl<>("{2}{U}"), + new TargetPermanent(FILTER_CREATURE_YOU_DONT_CONTROL), new BoostTargetEffect(-4, 0, Duration.EndOfTurn)); } private Downsize(final Downsize card) { diff --git a/Mage.Sets/src/mage/cards/d/Dragonshift.java b/Mage.Sets/src/mage/cards/d/Dragonshift.java index 625fde9b54f..dae90bfe725 100644 --- a/Mage.Sets/src/mage/cards/d/Dragonshift.java +++ b/Mage.Sets/src/mage/cards/d/Dragonshift.java @@ -1,11 +1,8 @@ package mage.cards.d; -import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.BecomesCreatureAllEffect; import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; -import mage.abilities.effects.common.continuous.LoseAllAbilitiesAllEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.OverloadAbility; import mage.cards.CardImpl; @@ -39,18 +36,9 @@ public final class Dragonshift extends CardImpl { true, false, Duration.EndOfTurn) .withDurationRuleAtStart(true); effect.setText("Until end of turn, target creature you control becomes a blue and red Dragon with base power and toughness 4/4, loses all abilities, and gains flying."); - this.getSpellAbility().addEffect(effect); - this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); - // Overload {3}{U}{U}{R}{R} - Ability ability = new OverloadAbility(this, new LoseAllAbilitiesAllEffect(new FilterControlledCreaturePermanent(""), Duration.EndOfTurn), new ManaCostsImpl<>("{3}{U}{U}{R}{R}")); - ability.addEffect(new BecomesCreatureAllEffect( - new CreatureToken(4, 4, "blue and red Dragon with base power and toughness 4/4 and with flying") - .withColor("UR") - .withSubType(SubType.DRAGON) - .withAbility(FlyingAbility.getInstance()), - null, filter, Duration.EndOfTurn, true, false, true)); - this.addAbility(ability); + OverloadAbility.ImplementOverloadAbility(this, new ManaCostsImpl<>("{2}{U}"), + new TargetControlledCreaturePermanent(), effect); } private Dragonshift(final Dragonshift card) { @@ -61,4 +49,4 @@ public final class Dragonshift extends CardImpl { public Dragonshift copy() { return new Dragonshift(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/d/Dynacharge.java b/Mage.Sets/src/mage/cards/d/Dynacharge.java index 4541d62a809..54d6c15c294 100644 --- a/Mage.Sets/src/mage/cards/d/Dynacharge.java +++ b/Mage.Sets/src/mage/cards/d/Dynacharge.java @@ -1,9 +1,7 @@ package mage.cards.d; -import java.util.UUID; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.keyword.OverloadAbility; import mage.cards.CardImpl; @@ -12,6 +10,8 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.target.common.TargetControlledCreaturePermanent; +import java.util.UUID; + /** * * @author LevelX2 @@ -23,11 +23,9 @@ public final class Dynacharge extends CardImpl { // Target creature you control gets +2/+0 until end of turn. - this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); - this.getSpellAbility().addEffect(new BoostTargetEffect(2,0, Duration.EndOfTurn)); - // Overload {2}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.") - this.addAbility(new OverloadAbility(this, new BoostControlledEffect(2,0, Duration.EndOfTurn), new ManaCostsImpl<>("{2}{R}"))); + OverloadAbility.ImplementOverloadAbility(this, new ManaCostsImpl<>("{2}{R}"), + new TargetControlledCreaturePermanent(), new BoostTargetEffect(2,0, Duration.EndOfTurn)); } private Dynacharge(final Dynacharge card) { @@ -38,4 +36,4 @@ public final class Dynacharge extends CardImpl { public Dynacharge copy() { return new Dynacharge(this); } -} \ No newline at end of file +}