diff --git a/Mage.Sets/src/mage/cards/c/CompleatDevotion.java b/Mage.Sets/src/mage/cards/c/CompleatDevotion.java new file mode 100644 index 00000000000..9951430135b --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CompleatDevotion.java @@ -0,0 +1,70 @@ +package mage.cards.c; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.ToxicAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetControlledCreaturePermanent; + +import java.util.UUID; + +public class CompleatDevotion extends CardImpl { + public CompleatDevotion(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}"); + + //Target creature you control gets +2/+2 until end of turn. If that creature has toxic, draw a card. + this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); + this.getSpellAbility().addEffect(new CompleatDevotionEffect()); + this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn) + .setText("Target creature you control gets +2/+2 until end of turn. If that creature has toxic, draw a card.")); + } + + private CompleatDevotion(final CompleatDevotion card) { + super(card); + } + + @Override + public CompleatDevotion copy() { + return new CompleatDevotion(this); + } +} + +class CompleatDevotionEffect extends OneShotEffect { + + public CompleatDevotionEffect() { + super(Outcome.Benefit); + staticText = ""; + } + + public CompleatDevotionEffect(final CompleatDevotionEffect effect) { + super(effect); + } + + @Override + public CompleatDevotionEffect copy() { + return new CompleatDevotionEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (permanent != null) { + if (permanent.getAbilities().stream().anyMatch(ability -> (ability instanceof ToxicAbility))) { + Player controller = game.getPlayer(permanent.getControllerId()); + if (controller != null) { + controller.drawCards(1, source, game); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/PhyrexiaAllWillBeOne.java b/Mage.Sets/src/mage/sets/PhyrexiaAllWillBeOne.java index 6d7644d9c5d..b9da9aebb97 100644 --- a/Mage.Sets/src/mage/sets/PhyrexiaAllWillBeOne.java +++ b/Mage.Sets/src/mage/sets/PhyrexiaAllWillBeOne.java @@ -54,6 +54,7 @@ public final class PhyrexiaAllWillBeOne extends ExpansionSet { cards.add(new SetCardInfo("Chimney Rabble", 126, Rarity.COMMON, mage.cards.c.ChimneyRabble.class)); cards.add(new SetCardInfo("Chittering Skitterling", 87, Rarity.UNCOMMON, mage.cards.c.ChitteringSkitterling.class)); cards.add(new SetCardInfo("Chrome Prowler", 45, Rarity.COMMON, mage.cards.c.ChromeProwler.class)); + cards.add(new SetCardInfo("Compleat Devotion", 7, Rarity.COMMON, mage.cards.c.CompleatDevotion.class)); cards.add(new SetCardInfo("Copper Longlegs", 165, Rarity.COMMON, mage.cards.c.CopperLonglegs.class)); cards.add(new SetCardInfo("Copperline Gorge", 249, Rarity.RARE, mage.cards.c.CopperlineGorge.class)); cards.add(new SetCardInfo("Crawling Chorus", 8, Rarity.COMMON, mage.cards.c.CrawlingChorus.class));