From 651f63e9f28f4420147f8dd412a9ecf426ffc931 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 7 Jul 2021 20:50:54 -0400 Subject: [PATCH] [AFR] Implemented Circle of the Moon Druid --- .../mage/cards/c/CircleOfTheMoonDruid.java | 89 +++++++++++++++++++ .../sets/AdventuresInTheForgottenRealms.java | 1 + 2 files changed, 90 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/CircleOfTheMoonDruid.java diff --git a/Mage.Sets/src/mage/cards/c/CircleOfTheMoonDruid.java b/Mage.Sets/src/mage/cards/c/CircleOfTheMoonDruid.java new file mode 100644 index 00000000000..0ace4b1d231 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CircleOfTheMoonDruid.java @@ -0,0 +1,89 @@ +package mage.cards.c; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.game.Game; +import mage.game.permanent.Permanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class CircleOfTheMoonDruid extends CardImpl { + + public CircleOfTheMoonDruid(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.DRUID); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Bear Form — As long as its your turn, Circle of the Moon Druid is a Bear with base power and toughness 4/2. + this.addAbility(new SimpleStaticAbility(new WerewolfPackLeaderEffect()).withFlavorWord("Bear Form")); + } + + private CircleOfTheMoonDruid(final CircleOfTheMoonDruid card) { + super(card); + } + + @Override + public CircleOfTheMoonDruid copy() { + return new CircleOfTheMoonDruid(this); + } +} + +class WerewolfPackLeaderEffect extends ContinuousEffectImpl { + + WerewolfPackLeaderEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "as long as it's your turn, {this} is a Bear with base power and toughness 4/2"; + } + + private WerewolfPackLeaderEffect(final WerewolfPackLeaderEffect effect) { + super(effect); + } + + @Override + public WerewolfPackLeaderEffect copy() { + return new WerewolfPackLeaderEffect(this); + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent permanent = source.getSourcePermanentIfItStillExists(game); + if (permanent == null || !game.isActivePlayer(source.getControllerId())) { + return false; + } + switch (layer) { + case TypeChangingEffects_4: + permanent.removeAllCreatureTypes(game); + permanent.addSubType(game, SubType.BEAR); + return true; + case PTChangingEffects_7: + if (sublayer == SubLayer.SetPT_7b) { + permanent.getPower().setValue(4); + permanent.getToughness().setValue(2); + return true; + } + } + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.TypeChangingEffects_4 || layer == Layer.PTChangingEffects_7; + } +} diff --git a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java index f56701775bf..510e10105ef 100644 --- a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java +++ b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java @@ -52,6 +52,7 @@ public final class AdventuresInTheForgottenRealms extends ExpansionSet { cards.add(new SetCardInfo("Check for Traps", 92, Rarity.UNCOMMON, mage.cards.c.CheckForTraps.class)); cards.add(new SetCardInfo("Choose Your Weapon", 175, Rarity.UNCOMMON, mage.cards.c.ChooseYourWeapon.class)); cards.add(new SetCardInfo("Circle of Dreams Druid", 176, Rarity.RARE, mage.cards.c.CircleOfDreamsDruid.class)); + cards.add(new SetCardInfo("Circle of the Moon Druid", 177, Rarity.COMMON, mage.cards.c.CircleOfTheMoonDruid.class)); cards.add(new SetCardInfo("Clattering Skeletons", 93, Rarity.COMMON, mage.cards.c.ClatteringSkeletons.class)); cards.add(new SetCardInfo("Clever Conjurer", 51, Rarity.COMMON, mage.cards.c.CleverConjurer.class)); cards.add(new SetCardInfo("Cloister Gargoyle", 7, Rarity.UNCOMMON, mage.cards.c.CloisterGargoyle.class));