From e1ffef81bab406ad50787f0a1e7774825d38412e Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 29 Jan 2022 19:07:37 -0500 Subject: [PATCH] [NEO] Implemented Covert Tactician --- .../src/mage/cards/c/CovertTechnician.java | 78 +++++++++++++++++++ .../src/mage/sets/KamigawaNeonDynasty.java | 1 + 2 files changed, 79 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/CovertTechnician.java diff --git a/Mage.Sets/src/mage/cards/c/CovertTechnician.java b/Mage.Sets/src/mage/cards/c/CovertTechnician.java new file mode 100644 index 0000000000..95e3adf0d9 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CovertTechnician.java @@ -0,0 +1,78 @@ +package mage.cards.c; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.PutCardFromHandOntoBattlefieldEffect; +import mage.abilities.keyword.NinjutsuAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.filter.FilterCard; +import mage.filter.common.FilterArtifactCard; +import mage.filter.predicate.mageobject.ManaValuePredicate; +import mage.game.Game; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class CovertTechnician extends CardImpl { + + public CovertTechnician(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}{U}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.NINJA); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Ninjutsu {1}{U} + this.addAbility(new NinjutsuAbility("{1}{U}")); + + // Whenever Covert Technician deals combat damage to a player, you may put an artifact card with mana value less than or equal to that damage from your hand onto the battlefield. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility( + new CovertTechnicianEffect(), false, true, false + )); + } + + private CovertTechnician(final CovertTechnician card) { + super(card); + } + + @Override + public CovertTechnician copy() { + return new CovertTechnician(this); + } +} + +class CovertTechnicianEffect extends OneShotEffect { + + CovertTechnicianEffect() { + super(Outcome.Benefit); + staticText = "you may put an artifact card with mana value less than " + + "or equal to that damage from your hand onto the battlefield"; + } + + private CovertTechnicianEffect(final CovertTechnicianEffect effect) { + super(effect); + } + + @Override + public CovertTechnicianEffect copy() { + return new CovertTechnicianEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int damage = (Integer) getValue("damage"); + FilterCard filter = new FilterArtifactCard("artifact card with mana value " + damage + " or less"); + filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, damage + 1)); + return new PutCardFromHandOntoBattlefieldEffect(filter).apply(game, source); + } +} diff --git a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java index 7e2309d986..925d5a41f0 100644 --- a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java +++ b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java @@ -31,6 +31,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet { cards.add(new SetCardInfo("Atsushi, the Blazing Sky", 134, Rarity.MYTHIC, mage.cards.a.AtsushiTheBlazingSky.class)); cards.add(new SetCardInfo("Befriending the Moths", 4, Rarity.COMMON, mage.cards.b.BefriendingTheMoths.class)); cards.add(new SetCardInfo("Bronzeplate Boar", 135, Rarity.UNCOMMON, mage.cards.b.BronzeplateBoar.class)); + cards.add(new SetCardInfo("Covert Technician", 49, Rarity.UNCOMMON, mage.cards.c.CovertTechnician.class)); cards.add(new SetCardInfo("Dokuchi Shadow-Walker", 94, Rarity.COMMON, mage.cards.d.DokuchiShadowWalker.class)); cards.add(new SetCardInfo("Enthusiastic Mechanaut", 218, Rarity.UNCOMMON, mage.cards.e.EnthusiasticMechanaut.class)); cards.add(new SetCardInfo("Era of Enlightenment", 11, Rarity.COMMON, mage.cards.e.EraOfEnlightenment.class));