From ba47fee11e71e9a3f818f6a7138aa77739b7b4eb Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 31 May 2019 08:17:32 -0400 Subject: [PATCH] Implemented Rotwidow Pack --- Mage.Sets/src/mage/cards/r/RotwidowPack.java | 66 +++++++++++++++++++ Mage.Sets/src/mage/sets/ModernHorizons.java | 1 + .../common/FilterControlledPermanent.java | 16 ++++- 3 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/r/RotwidowPack.java diff --git a/Mage.Sets/src/mage/cards/r/RotwidowPack.java b/Mage.Sets/src/mage/cards/r/RotwidowPack.java new file mode 100644 index 0000000000..721d5ac8c1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RotwidowPack.java @@ -0,0 +1,66 @@ +package mage.cards.r; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ExileFromGraveCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.LoseLifeOpponentsEffect; +import mage.abilities.keyword.ReachAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; +import mage.filter.common.FilterControlledPermanent; +import mage.game.permanent.token.SpiderToken; +import mage.target.common.TargetCardInYourGraveyard; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class RotwidowPack extends CardImpl { + + private static final FilterPermanent filter = new FilterControlledPermanent(SubType.SPIDER); + private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(filter); + + public RotwidowPack(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{G}"); + + this.subtype.add(SubType.SPIDER); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Reach + this.addAbility(ReachAbility.getInstance()); + + // {3}{B}{G}, Exile a creature card from your graveyard: Create a 1/2 green Spider creature token with reach, then each opponent loses 1 life for each Spider you control. + Ability ability = new SimpleActivatedAbility( + new CreateTokenEffect(new SpiderToken()) + .setText("create a 1/2 green Spider creature token with reach, then"), + new ManaCostsImpl("{3}{B}{G}") + ); + ability.addEffect(new LoseLifeOpponentsEffect(xValue) + .setText("each opponent loses 1 life for each Spider you control.") + ); + ability.addCost(new ExileFromGraveCost( + new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD) + )); + this.addAbility(ability); + } + + private RotwidowPack(final RotwidowPack card) { + super(card); + } + + @Override + public RotwidowPack copy() { + return new RotwidowPack(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ModernHorizons.java b/Mage.Sets/src/mage/sets/ModernHorizons.java index 92a5a7e889..42c8e07172 100644 --- a/Mage.Sets/src/mage/sets/ModernHorizons.java +++ b/Mage.Sets/src/mage/sets/ModernHorizons.java @@ -151,6 +151,7 @@ public final class ModernHorizons extends ExpansionSet { cards.add(new SetCardInfo("Rebuild", 66, Rarity.UNCOMMON, mage.cards.r.Rebuild.class)); cards.add(new SetCardInfo("Reckless Charge", 144, Rarity.COMMON, mage.cards.r.RecklessCharge.class)); cards.add(new SetCardInfo("Regrowth", 175, Rarity.UNCOMMON, mage.cards.r.Regrowth.class)); + cards.add(new SetCardInfo("Rotwidow Pack", 212, Rarity.UNCOMMON, mage.cards.r.RotwidowPack.class)); cards.add(new SetCardInfo("Ruination Rioter", 213, Rarity.UNCOMMON, mage.cards.r.RuinationRioter.class)); cards.add(new SetCardInfo("Savage Swipe", 178, Rarity.COMMON, mage.cards.s.SavageSwipe.class)); cards.add(new SetCardInfo("Scale Up", 179, Rarity.UNCOMMON, mage.cards.s.ScaleUp.class)); diff --git a/Mage/src/main/java/mage/filter/common/FilterControlledPermanent.java b/Mage/src/main/java/mage/filter/common/FilterControlledPermanent.java index 84de0ad65f..f2c2fdbf1b 100644 --- a/Mage/src/main/java/mage/filter/common/FilterControlledPermanent.java +++ b/Mage/src/main/java/mage/filter/common/FilterControlledPermanent.java @@ -1,13 +1,12 @@ - - package mage.filter.common; +import mage.constants.SubType; import mage.constants.TargetController; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.ControllerPredicate; /** - * * @author BetaSteward_at_googlemail.com */ public class FilterControlledPermanent extends FilterPermanent { @@ -17,8 +16,19 @@ public class FilterControlledPermanent extends FilterPermanent { } public FilterControlledPermanent(String name) { + this(null, name); + } + + public FilterControlledPermanent(SubType subtype) { + this(subtype, subtype.toString() + " you control"); + } + + public FilterControlledPermanent(SubType subtype, String name) { super(name); this.add(new ControllerPredicate(TargetController.YOU)); + if (subtype != null) { + this.add(new SubtypePredicate(subtype)); + } } public FilterControlledPermanent(final FilterControlledPermanent filter) {