From fc560d48533b513b89f2ed0079927f682a44b18e Mon Sep 17 00:00:00 2001 From: PurpleCrowbar <26198472+PurpleCrowbar@users.noreply.github.com> Date: Thu, 3 Nov 2022 02:10:26 +0000 Subject: [PATCH] Standardise use of CantBeCounteredSourceAbility for remaining cards not yet using it --- Mage.Sets/src/mage/cards/a/AbruptDecay.java | 14 +++----------- Mage.Sets/src/mage/cards/o/OverwhelmingDenial.java | 14 +++----------- Mage.Sets/src/mage/cards/r/RazeToTheGround.java | 11 ++--------- Mage.Sets/src/mage/cards/s/SlaughterGames.java | 13 +++---------- Mage.Sets/src/mage/cards/t/TearsOfValakut.java | 14 +++----------- Mage.Sets/src/mage/cards/u/UrzasRage.java | 14 +++----------- 6 files changed, 17 insertions(+), 63 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/AbruptDecay.java b/Mage.Sets/src/mage/cards/a/AbruptDecay.java index 5e10f06f22..18792c6d0c 100644 --- a/Mage.Sets/src/mage/cards/a/AbruptDecay.java +++ b/Mage.Sets/src/mage/cards/a/AbruptDecay.java @@ -2,16 +2,12 @@ package mage.cards.a; import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.Effect; -import mage.abilities.effects.common.CantBeCounteredSourceEffect; +import mage.abilities.common.CantBeCounteredSourceAbility; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.ComparisonType; -import mage.constants.Zone; import mage.filter.common.FilterNonlandPermanent; import mage.filter.predicate.mageobject.ManaValuePredicate; import mage.target.common.TargetNonlandPermanent; @@ -31,12 +27,8 @@ public final class AbruptDecay extends CardImpl { public AbruptDecay(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{B}{G}"); - // Abrupt Decay can't be countered. - Effect effect = new CantBeCounteredSourceEffect(); - effect.setText("this spell can't be countered"); - Ability ability = new SimpleStaticAbility(Zone.STACK, effect); - ability.setRuleAtTheTop(true); - this.addAbility(ability); + // This spell can't be countered. + this.addAbility(new CantBeCounteredSourceAbility()); // Destroy target nonland permanent with converted mana cost 3 or less. this.getSpellAbility().addEffect(new DestroyTargetEffect()); diff --git a/Mage.Sets/src/mage/cards/o/OverwhelmingDenial.java b/Mage.Sets/src/mage/cards/o/OverwhelmingDenial.java index 4e828b4eea..1571b1473e 100644 --- a/Mage.Sets/src/mage/cards/o/OverwhelmingDenial.java +++ b/Mage.Sets/src/mage/cards/o/OverwhelmingDenial.java @@ -2,16 +2,12 @@ package mage.cards.o; import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.Effect; -import mage.abilities.effects.common.CantBeCounteredSourceEffect; +import mage.abilities.common.CantBeCounteredSourceAbility; import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.keyword.SurgeAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Zone; import mage.target.TargetSpell; /** @@ -23,12 +19,8 @@ public final class OverwhelmingDenial extends CardImpl { public OverwhelmingDenial(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{U}{U}"); - // Overwhelming Denial can't be countered by spell or abilities. - Effect effect = new CantBeCounteredSourceEffect(); - effect.setText("this spell can't be countered"); - Ability ability = new SimpleStaticAbility(Zone.STACK, effect); - ability.setRuleAtTheTop(true); - this.addAbility(ability); + // This spell can't be countered. + this.addAbility(new CantBeCounteredSourceAbility()); // Counter target spell. this.getSpellAbility().addTarget(new TargetSpell()); diff --git a/Mage.Sets/src/mage/cards/r/RazeToTheGround.java b/Mage.Sets/src/mage/cards/r/RazeToTheGround.java index f3f7f6473b..fa17ed9243 100644 --- a/Mage.Sets/src/mage/cards/r/RazeToTheGround.java +++ b/Mage.Sets/src/mage/cards/r/RazeToTheGround.java @@ -1,15 +1,12 @@ package mage.cards.r; import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.Effect; +import mage.abilities.common.CantBeCounteredSourceAbility; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.CantBeCounteredSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; -import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -26,11 +23,7 @@ public final class RazeToTheGround extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}"); // This spell can't be countered. - Effect effect = new CantBeCounteredSourceEffect(); - effect.setText("this spell can't be countered"); - Ability ability = new SimpleStaticAbility(Zone.STACK, effect); - ability.setRuleAtTheTop(true); - this.addAbility(ability); + this.addAbility(new CantBeCounteredSourceAbility()); // Destroy target artifact. If its mana value was 1 or less, draw a card. this.getSpellAbility().addEffect(new RazeToTheGroundEffect()); diff --git a/Mage.Sets/src/mage/cards/s/SlaughterGames.java b/Mage.Sets/src/mage/cards/s/SlaughterGames.java index a78aead43c..810f8d53a6 100644 --- a/Mage.Sets/src/mage/cards/s/SlaughterGames.java +++ b/Mage.Sets/src/mage/cards/s/SlaughterGames.java @@ -1,15 +1,12 @@ package mage.cards.s; import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.Effect; -import mage.abilities.effects.common.CantBeCounteredSourceEffect; +import mage.abilities.common.CantBeCounteredSourceAbility; import mage.abilities.effects.common.ChooseACardNameEffect; import mage.abilities.effects.common.search.SearchTargetGraveyardHandLibraryForCardNameAndExileEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Zone; import mage.game.Game; import mage.target.common.TargetOpponent; @@ -23,12 +20,8 @@ public final class SlaughterGames extends CardImpl { public SlaughterGames(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}{R}"); - // Slaughter Games can't be countered. - Effect effect = new CantBeCounteredSourceEffect(); - effect.setText("this spell can't be countered"); - Ability ability = new SimpleStaticAbility(Zone.STACK, effect); - ability.setRuleAtTheTop(true); - this.addAbility(ability); + // This spell can't be countered. + this.addAbility(new CantBeCounteredSourceAbility()); // Name a nonland card. Search target opponent's graveyard, hand, and library for any number of cards with that name and exile them. Then that player shuffles their library. this.getSpellAbility().addEffect(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_NAME)); diff --git a/Mage.Sets/src/mage/cards/t/TearsOfValakut.java b/Mage.Sets/src/mage/cards/t/TearsOfValakut.java index bab112c632..ec8c711b7e 100644 --- a/Mage.Sets/src/mage/cards/t/TearsOfValakut.java +++ b/Mage.Sets/src/mage/cards/t/TearsOfValakut.java @@ -2,16 +2,12 @@ package mage.cards.t; import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.Effect; -import mage.abilities.effects.common.CantBeCounteredSourceEffect; +import mage.abilities.common.CantBeCounteredSourceAbility; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.AbilityPredicate; import mage.target.common.TargetCreaturePermanent; @@ -31,12 +27,8 @@ public final class TearsOfValakut extends CardImpl { public TearsOfValakut(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{R}"); - // Tears of Valakut can't be countered. - Effect effect = new CantBeCounteredSourceEffect(); - effect.setText("this spell can't be countered"); - Ability ability = new SimpleStaticAbility(Zone.STACK, effect); - ability.setRuleAtTheTop(true); - this.addAbility(ability); + // This spell can't be countered. + this.addAbility(new CantBeCounteredSourceAbility()); // Tears of Valakut deals 5 damage to target creature with flying. this.getSpellAbility().addEffect(new DamageTargetEffect(5)); diff --git a/Mage.Sets/src/mage/cards/u/UrzasRage.java b/Mage.Sets/src/mage/cards/u/UrzasRage.java index 681fc5fa84..78ef1ae873 100644 --- a/Mage.Sets/src/mage/cards/u/UrzasRage.java +++ b/Mage.Sets/src/mage/cards/u/UrzasRage.java @@ -1,17 +1,13 @@ package mage.cards.u; -import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.CantBeCounteredSourceAbility; import mage.abilities.condition.common.KickedCondition; import mage.abilities.decorator.ConditionalOneShotEffect; -import mage.abilities.effects.Effect; -import mage.abilities.effects.common.CantBeCounteredSourceEffect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.keyword.KickerAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Zone; import mage.target.common.TargetAnyTarget; import java.util.UUID; @@ -27,12 +23,8 @@ public final class UrzasRage extends CardImpl { // Kicker {8}{R} this.addAbility(new KickerAbility("{8}{R}")); - // Urza's Rage can't be countered. - Effect effect = new CantBeCounteredSourceEffect(); - effect.setText("this spell can't be countered"); - Ability ability = new SimpleStaticAbility(Zone.STACK, effect); - ability.setRuleAtTheTop(true); - this.addAbility(ability); + // This spell can't be countered. + this.addAbility(new CantBeCounteredSourceAbility()); // Urza's Rage deals 3 damage to any target. If Urza's Rage was kicked, instead it deals 10 damage to that creature or player and the damage can't be prevented. this.getSpellAbility().addEffect(new ConditionalOneShotEffect(