From d83cea800021988bccb912b6a140bcac0589458d Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 30 Aug 2022 20:36:10 -0400 Subject: [PATCH] [DMU] Compleated Weatherlight --- .../mage/cards/w/WeatherlightCompleated.java | 95 +++++++++++++++++++ Mage.Sets/src/mage/sets/DominariaUnited.java | 1 + .../main/java/mage/counters/CounterType.java | 1 + 3 files changed, 97 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/w/WeatherlightCompleated.java diff --git a/Mage.Sets/src/mage/cards/w/WeatherlightCompleated.java b/Mage.Sets/src/mage/cards/w/WeatherlightCompleated.java new file mode 100644 index 0000000000..22ab5e2955 --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WeatherlightCompleated.java @@ -0,0 +1,95 @@ +package mage.cards.w; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.SourceHasCounterCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.effects.keyword.ScryEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.Permanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class WeatherlightCompleated extends CardImpl { + + private static final Condition condition = new SourceHasCounterCondition(CounterType.PHYRESIS, 7); + + public WeatherlightCompleated(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.VEHICLE); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // As long as Weatherlight Compleated has four or more phyresis counters on it, it's a Phyrexian creature in addition to its other types. + this.addAbility(new SimpleStaticAbility(new WeatherlightCompleatedEffect())); + + // Whenever a creature you control dies, put a phyresis counter on Weatherlight Compleated. Then draw a card if it has seven or more phyresis counters on it. If it doesn't, scry 1. + Ability ability = new DiesCreatureTriggeredAbility( + new AddCountersSourceEffect(CounterType.PHYRESIS.createInstance()), + false, StaticFilters.FILTER_CONTROLLED_A_CREATURE + ); + ability.addEffect(new ConditionalOneShotEffect( + new DrawCardSourceControllerEffect(1), new ScryEffect(1), condition, + "Then draw a card if it has seven or more phyresis counters on it. If it doesn't, scry 1" + )); + this.addAbility(ability); + } + + private WeatherlightCompleated(final WeatherlightCompleated card) { + super(card); + } + + @Override + public WeatherlightCompleated copy() { + return new WeatherlightCompleated(this); + } +} + +class WeatherlightCompleatedEffect extends ContinuousEffectImpl { + + WeatherlightCompleatedEffect() { + super(Duration.WhileOnBattlefield, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit); + staticText = "as long as {this} has four or more phyresis counters on it, " + + "it's a Phyrexian creature in addition to its other types"; + } + + private WeatherlightCompleatedEffect(final WeatherlightCompleatedEffect effect) { + super(effect); + } + + @Override + public WeatherlightCompleatedEffect copy() { + return new WeatherlightCompleatedEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = source.getSourcePermanentIfItStillExists(game); + if (permanent == null || permanent.getCounters(game).getCount(CounterType.PHYRESIS) < 4) { + return false; + } + permanent.addCardType(game, CardType.CREATURE); + permanent.addSubType(game, SubType.PHYREXIAN); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/DominariaUnited.java b/Mage.Sets/src/mage/sets/DominariaUnited.java index 769113c7db..1fa2e22120 100644 --- a/Mage.Sets/src/mage/sets/DominariaUnited.java +++ b/Mage.Sets/src/mage/sets/DominariaUnited.java @@ -247,6 +247,7 @@ public final class DominariaUnited extends ExpansionSet { cards.add(new SetCardInfo("Volshe Tideturner", 77, Rarity.COMMON, mage.cards.v.VolsheTideturner.class)); cards.add(new SetCardInfo("Walking Bulwark", 241, Rarity.UNCOMMON, mage.cards.w.WalkingBulwark.class)); cards.add(new SetCardInfo("Warhost's Frenzy", 151, Rarity.UNCOMMON, mage.cards.w.WarhostsFrenzy.class)); + cards.add(new SetCardInfo("Weatherlight Compleated", 242, Rarity.MYTHIC, mage.cards.w.WeatherlightCompleated.class)); cards.add(new SetCardInfo("Wingmantle Chaplain", 39, Rarity.UNCOMMON, mage.cards.w.WingmantleChaplain.class)); cards.add(new SetCardInfo("Wooded Ridgeline", 260, Rarity.COMMON, mage.cards.w.WoodedRidgeline.class)); cards.add(new SetCardInfo("Writhing Necromass", 115, Rarity.COMMON, mage.cards.w.WrithingNecromass.class)); diff --git a/Mage/src/main/java/mage/counters/CounterType.java b/Mage/src/main/java/mage/counters/CounterType.java index b1182fbcb1..345f7d67d6 100644 --- a/Mage/src/main/java/mage/counters/CounterType.java +++ b/Mage/src/main/java/mage/counters/CounterType.java @@ -141,6 +141,7 @@ public enum CounterType { PETAL("petal"), PETRIFICATION("petrification"), PHYLACTERY("phylactery"), + PHYRESIS("phyresis"), PIN("pin"), PLAGUE("plague"), PLOT("plot"),