From b81db2ba4885e7f2583a43c17aed62ace51b67fd Mon Sep 17 00:00:00 2001 From: Susucre <34709007+Susucre@users.noreply.github.com> Date: Mon, 25 Sep 2023 04:09:54 +0200 Subject: [PATCH] [WOC] Implement Shadow Puppeteers (#11183) --- .../src/mage/cards/s/ShadowPuppeteers.java | 117 ++++++++++++++++++ .../mage/sets/WildsOfEldraineCommander.java | 1 + 2 files changed, 118 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/ShadowPuppeteers.java diff --git a/Mage.Sets/src/mage/cards/s/ShadowPuppeteers.java b/Mage.Sets/src/mage/cards/s/ShadowPuppeteers.java new file mode 100644 index 00000000000..1d95a575374 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/ShadowPuppeteers.java @@ -0,0 +1,117 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksCreatureYouControlTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.WardAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.FaerieRogueToken; + +import java.util.UUID; + +/** + * + * @author Susucr + */ +public final class ShadowPuppeteers extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creature you control with flying"); + + static { + filter.add(new AbilityPredicate(FlyingAbility.class)); + } + + public ShadowPuppeteers(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{6}{U}"); + + this.subtype.add(SubType.FAERIE); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Ward {2} + this.addAbility(new WardAbility(new ManaCostsImpl<>("{2}"))); + + // When Shadow Puppeteers enters the battlefield, create two 1/1 black Faerie Rogue creature tokens with flying. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new FaerieRogueToken(), 2))); + + // Whenever a creature you control with flying attacks, you may have it become a red Dragon with base power and toughness 4/4 in addition to its other colors and types until end of turn. + this.addAbility(new AttacksCreatureYouControlTriggeredAbility( + Zone.BATTLEFIELD, new ShadowPuppeteersContinousEffect(), + true, filter, true + )); + } + + private ShadowPuppeteers(final ShadowPuppeteers card) { + super(card); + } + + @Override + public ShadowPuppeteers copy() { + return new ShadowPuppeteers(this); + } +} + +class ShadowPuppeteersContinousEffect extends ContinuousEffectImpl { + + ShadowPuppeteersContinousEffect() { + super(Duration.EndOfTurn, Outcome.Benefit); + staticText = "have it become a red Dragon with base power and toughness 4/4 " + + "in addition to its other colors and types until end of turn"; + } + + private ShadowPuppeteersContinousEffect(final ShadowPuppeteersContinousEffect effect) { + super(effect); + } + + @Override + public ShadowPuppeteersContinousEffect copy() { + return new ShadowPuppeteersContinousEffect(this); + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.PTChangingEffects_7 + || layer == Layer.ColorChangingEffects_5 + || layer == Layer.TypeChangingEffects_4; + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); + if (permanent == null) { + return false; + } + switch (layer) { + case TypeChangingEffects_4: + permanent.addSubType(game, SubType.DRAGON); + break; + case ColorChangingEffects_5: + permanent.getColor(game).setRed(true); + break; + case PTChangingEffects_7: + permanent.getToughness().setModifiedBaseValue(4); + permanent.getPower().setModifiedBaseValue(4); + } + return true; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/WildsOfEldraineCommander.java b/Mage.Sets/src/mage/sets/WildsOfEldraineCommander.java index d1b8638cc61..b87928ff12f 100644 --- a/Mage.Sets/src/mage/sets/WildsOfEldraineCommander.java +++ b/Mage.Sets/src/mage/sets/WildsOfEldraineCommander.java @@ -121,6 +121,7 @@ public final class WildsOfEldraineCommander extends ExpansionSet { cards.add(new SetCardInfo("Scion of Oona", 109, Rarity.RARE, mage.cards.s.ScionOfOona.class)); cards.add(new SetCardInfo("Secluded Glen", 166, Rarity.RARE, mage.cards.s.SecludedGlen.class)); cards.add(new SetCardInfo("Setessan Champion", 132, Rarity.RARE, mage.cards.s.SetessanChampion.class)); + cards.add(new SetCardInfo("Shadow Puppeteers", 12, Rarity.RARE, mage.cards.s.ShadowPuppeteers.class)); cards.add(new SetCardInfo("Shalai, Voice of Plenty", 74, Rarity.RARE, mage.cards.s.ShalaiVoiceOfPlenty.class)); cards.add(new SetCardInfo("Siona, Captain of the Pyleas", 144, Rarity.UNCOMMON, mage.cards.s.SionaCaptainOfThePyleas.class)); cards.add(new SetCardInfo("Snake Umbra", 133, Rarity.UNCOMMON, mage.cards.s.SnakeUmbra.class));