From e66637c8653de71d2a63ca304c2fe665e0fbe07f Mon Sep 17 00:00:00 2001 From: AhmadYProjects <104733598+AhmadYProjects@users.noreply.github.com> Date: Tue, 17 Jan 2023 08:58:41 -0500 Subject: [PATCH] [ONE] Implement Thrun, Breaker of Silence (#9882) * Adding Thrun to PhyrexiaAllWillBeOne * Adding Thrun to PhyrexiaAllWillBeOne Co-authored-by: AhmadYProjects --- .../mage/cards/t/ThrunBreakerOfSilence.java | 59 +++++++++++++++++++ .../src/mage/sets/PhyrexiaAllWillBeOne.java | 1 + .../main/java/mage/filter/StaticFilters.java | 9 +++ 3 files changed, 69 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/t/ThrunBreakerOfSilence.java diff --git a/Mage.Sets/src/mage/cards/t/ThrunBreakerOfSilence.java b/Mage.Sets/src/mage/cards/t/ThrunBreakerOfSilence.java new file mode 100644 index 0000000000..610037d964 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/ThrunBreakerOfSilence.java @@ -0,0 +1,59 @@ +package mage.cards.t; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.MyTurnCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.CantBeCounteredSourceEffect; +import mage.abilities.effects.common.CantBeTargetedSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.hint.common.MyTurnHint; +import mage.abilities.keyword.IndestructibleAbility; +import mage.constants.*; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.filter.StaticFilters; + +/** + * + * @author # -*- AhmadYProjects-*- + */ +public final class ThrunBreakerOfSilence extends CardImpl { + + + + public ThrunBreakerOfSilence(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.TROLL); + this.subtype.add(SubType.SHAMAN); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // This spell can't be countered. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new CantBeCounteredSourceEffect())); + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Thrun, Breaker of Silence can't be the target of nongreen spells your opponents control or abilities from nongreen sources your opponents control. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeTargetedSourceEffect(StaticFilters.FILTER_SPELL_OR_ABILITY_OPPONENTS_NON_GREEN,Duration.WhileOnBattlefield))); + // As long as it's your turn, Thrun has indestructible. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new ConditionalContinuousEffect(new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield), + MyTurnCondition.instance, + "As long as it's your turn, {this} has indestructible")) + .addHint(MyTurnHint.instance)); + } + + private ThrunBreakerOfSilence(final ThrunBreakerOfSilence card) { + super(card); + } + + @Override + public ThrunBreakerOfSilence copy() { + return new ThrunBreakerOfSilence(this); + } +} diff --git a/Mage.Sets/src/mage/sets/PhyrexiaAllWillBeOne.java b/Mage.Sets/src/mage/sets/PhyrexiaAllWillBeOne.java index 2edf10e78a..689640e06d 100644 --- a/Mage.Sets/src/mage/sets/PhyrexiaAllWillBeOne.java +++ b/Mage.Sets/src/mage/sets/PhyrexiaAllWillBeOne.java @@ -56,6 +56,7 @@ public final class PhyrexiaAllWillBeOne extends ExpansionSet { cards.add(new SetCardInfo("Swamp", 274, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Tablet of Compleation", 245, Rarity.RARE, mage.cards.t.TabletOfCompleation.class)); cards.add(new SetCardInfo("The Monumental Facade", 255, Rarity.RARE, mage.cards.t.TheMonumentalFacade.class)); + cards.add(new SetCardInfo("Thrun, Breaker of Silence", 186, Rarity.RARE, mage.cards.t.ThrunBreakerOfSilence.class)); cards.add(new SetCardInfo("Tyvar, Jubilant Brawler", 218, Rarity.RARE, mage.cards.t.TyvarJubilantBrawler.class)); cards.add(new SetCardInfo("Unctus Grand Metatect", 75, Rarity.RARE, mage.cards.u.UnctusGrandMetatect.class)); cards.add(new SetCardInfo("Urabrask's Forge", 153, Rarity.RARE, mage.cards.u.UrabrasksForge.class)); diff --git a/Mage/src/main/java/mage/filter/StaticFilters.java b/Mage/src/main/java/mage/filter/StaticFilters.java index 7780850f00..0c4a66681f 100644 --- a/Mage/src/main/java/mage/filter/StaticFilters.java +++ b/Mage/src/main/java/mage/filter/StaticFilters.java @@ -741,6 +741,15 @@ public final class StaticFilters { FILTER_SPELL_OR_ABILITY_OPPONENTS.setLockedFilter(true); } + public static final FilterStackObject FILTER_SPELL_OR_ABILITY_OPPONENTS_NON_GREEN = new FilterStackObject("a nongreen spell or ability an opponent controls"); + + static { + FILTER_SPELL_OR_ABILITY_OPPONENTS_NON_GREEN.add(Predicates.not(new ColorPredicate(ObjectColor.GREEN))); + FILTER_SPELL_OR_ABILITY_OPPONENTS_NON_GREEN.add(TargetController.OPPONENT.getControllerPredicate()); + FILTER_SPELL_OR_ABILITY_OPPONENTS_NON_GREEN.setLockedFilter(true); + + } + public static final FilterStackObject FILTER_SPELL_OR_ABILITY = new FilterStackObject(); static {