From 2f3328ce2002f5925f3756465eac2af0df6728cb Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 7 Jul 2021 20:26:32 -0400 Subject: [PATCH] [AFR] Implemented Skeletal Swarming --- .../src/mage/cards/s/SkeletalSwarming.java | 73 +++++++++++++++++++ .../sets/AdventuresInTheForgottenRealms.java | 1 + 2 files changed, 74 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SkeletalSwarming.java diff --git a/Mage.Sets/src/mage/cards/s/SkeletalSwarming.java b/Mage.Sets/src/mage/cards/s/SkeletalSwarming.java new file mode 100644 index 00000000000..1a7ff137ac9 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SkeletalSwarming.java @@ -0,0 +1,73 @@ +package mage.cards.s; + +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.MorbidCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.dynamicvalue.AdditiveDynamicValue; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.combat.AttacksIfAbleAllEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.hint.common.MorbidHint; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.permanent.token.SkeletonToken; +import mage.watchers.common.MorbidWatcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SkeletalSwarming extends CardImpl { + + private static final FilterPermanent filter = new FilterControlledPermanent(SubType.SKELETON); + private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent(SubType.SKELETON, ""); + private static final DynamicValue xValue = new AdditiveDynamicValue(new PermanentsOnBattlefieldCount(), StaticValue.get(-1)); + + public SkeletalSwarming(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{G}"); + + // Each Skeleton you control has trample, attacks each combat if able, and gets +X/+0, where X is the number of other Skeletons you control. + Ability ability = new SimpleStaticAbility(new GainAbilityControlledEffect( + TrampleAbility.getInstance(), Duration.WhileOnBattlefield, filter + ).setText("each Skeleton you control has trample")); + ability.addEffect(new AttacksIfAbleAllEffect(filter2).setText(", attacks each combat if able")); + ability.addEffect(new BoostControlledEffect( + xValue, xValue, Duration.WhileOnBattlefield, filter2, false + ).setText(", and gets +X/+0, where X is the number of other Skeletons you control")); + this.addAbility(ability); + + // At the beginning of your end step, create a tapped 1/1 black Skeleton creature token. If a creature died this turn, create two of those tokens instead. + this.addAbility(new BeginningOfEndStepTriggeredAbility( + new ConditionalOneShotEffect( + new CreateTokenEffect(new SkeletonToken(), 2, true, false), + new CreateTokenEffect(new SkeletonToken(), 1, true, false), + MorbidCondition.instance, "create a tapped 1/1 black Skeleton creature token. " + + "If a creature died this turn, create two of those tokens instead" + ), TargetController.YOU, false + ).addHint(MorbidHint.instance), new MorbidWatcher()); + } + + private SkeletalSwarming(final SkeletalSwarming card) { + super(card); + } + + @Override + public SkeletalSwarming copy() { + return new SkeletalSwarming(this); + } +} diff --git a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java index 4c137e90588..03c322492f3 100644 --- a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java +++ b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java @@ -186,6 +186,7 @@ public final class AdventuresInTheForgottenRealms extends ExpansionSet { cards.add(new SetCardInfo("Shocking Grasp", 72, Rarity.COMMON, mage.cards.s.ShockingGrasp.class)); cards.add(new SetCardInfo("Shortcut Seeker", 73, Rarity.COMMON, mage.cards.s.ShortcutSeeker.class)); cards.add(new SetCardInfo("Silver Raven", 74, Rarity.COMMON, mage.cards.s.SilverRaven.class)); + cards.add(new SetCardInfo("Skeletal Swarming", 232, Rarity.RARE, mage.cards.s.SkeletalSwarming.class)); cards.add(new SetCardInfo("Skullport Merchant", 120, Rarity.UNCOMMON, mage.cards.s.SkullportMerchant.class)); cards.add(new SetCardInfo("Soulknife Spy", 75, Rarity.COMMON, mage.cards.s.SoulknifeSpy.class)); cards.add(new SetCardInfo("Spike Pit Trap", 251, Rarity.COMMON, mage.cards.s.SpikePitTrap.class));