From f0d1cff7b999ec06fc65950aebc32a1b101f467d Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 10 Apr 2020 21:25:45 -0400 Subject: [PATCH] Implemented Blitz Leech --- Mage.Sets/src/mage/cards/b/BlitzLeech.java | 84 +++++++++++++++++++ .../src/mage/sets/IkoriaLairOfBehemoths.java | 1 + 2 files changed, 85 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BlitzLeech.java diff --git a/Mage.Sets/src/mage/cards/b/BlitzLeech.java b/Mage.Sets/src/mage/cards/b/BlitzLeech.java new file mode 100644 index 00000000000..55336f12e67 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BlitzLeech.java @@ -0,0 +1,84 @@ +package mage.cards.b; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetOpponentsCreaturePermanent; + +import java.util.Set; +import java.util.UUID; +import java.util.stream.Collectors; + +/** + * @author TheElk801 + */ +public final class BlitzLeech extends CardImpl { + + public BlitzLeech(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{B}"); + + this.subtype.add(SubType.LEECH); + this.power = new MageInt(5); + this.toughness = new MageInt(2); + + // Flash + this.addAbility(FlashAbility.getInstance()); + + // When Blitz Leech enters the battlefield, target creature an opponent controls gets -2/-2 until end of turn. Remove all counters from that creature. + Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(-2, -2)); + ability.addEffect(new BlitzLeechEffect()); + ability.addTarget(new TargetOpponentsCreaturePermanent()); + this.addAbility(ability); + } + + private BlitzLeech(final BlitzLeech card) { + super(card); + } + + @Override + public BlitzLeech copy() { + return new BlitzLeech(this); + } +} + +class BlitzLeechEffect extends OneShotEffect { + + BlitzLeechEffect() { + super(Outcome.Benefit); + staticText = "Remove all counters from that creature."; + } + + private BlitzLeechEffect(final BlitzLeechEffect effect) { + super(effect); + } + + @Override + public BlitzLeechEffect copy() { + return new BlitzLeechEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent == null) { + return false; + } + Set counterTypes = permanent + .getCounters(game) + .keySet() + .stream() + .collect(Collectors.toSet()); + counterTypes.forEach(permanent.getCounters(game)::removeAllCounters); + return true; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java b/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java index 76ac418d52a..924c51b69b0 100644 --- a/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java +++ b/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java @@ -75,6 +75,7 @@ public final class IkoriaLairOfBehemoths extends ExpansionSet { cards.add(new SetCardInfo("Blade Banish", 4, Rarity.COMMON, mage.cards.b.BladeBanish.class)); cards.add(new SetCardInfo("Blazing Volley", 107, Rarity.COMMON, mage.cards.b.BlazingVolley.class)); cards.add(new SetCardInfo("Blisterspit Gremlin", 108, Rarity.COMMON, mage.cards.b.BlisterspitGremlin.class)); + cards.add(new SetCardInfo("Blitz Leech", 74, Rarity.COMMON, mage.cards.b.BlitzLeech.class)); cards.add(new SetCardInfo("Blitz of the Thunder-Raptor", 109, Rarity.UNCOMMON, mage.cards.b.BlitzOfTheThunderRaptor.class)); cards.add(new SetCardInfo("Blood Curdle", 75, Rarity.COMMON, mage.cards.b.BloodCurdle.class)); cards.add(new SetCardInfo("Bloodfell Caves", 243, Rarity.COMMON, mage.cards.b.BloodfellCaves.class));