From 14bf2039609cd68bcfa4cbdf035b305d91e50ee6 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 16 Sep 2022 08:44:49 -0400 Subject: [PATCH] [40K] Implemented Lychguard --- Mage.Sets/src/mage/cards/l/Lychguard.java | 79 +++++++++++++++++++++ Mage.Sets/src/mage/sets/Warhammer40000.java | 1 + 2 files changed, 80 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/l/Lychguard.java diff --git a/Mage.Sets/src/mage/cards/l/Lychguard.java b/Mage.Sets/src/mage/cards/l/Lychguard.java new file mode 100644 index 0000000000..ed74aa698e --- /dev/null +++ b/Mage.Sets/src/mage/cards/l/Lychguard.java @@ -0,0 +1,79 @@ +package mage.cards.l; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.*; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class Lychguard extends CardImpl { + + public Lychguard(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}{B}"); + + this.subtype.add(SubType.NECRON); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Guardian Patrols -- {3}{B}, Sacrifice Lychguard: Return all legendary creature cards from your graveyard to your hand. + Ability ability = new SimpleActivatedAbility(new LychguardEffect(), new ManaCostsImpl<>("{3}{B}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + private Lychguard(final Lychguard card) { + super(card); + } + + @Override + public Lychguard copy() { + return new Lychguard(this); + } +} + +class LychguardEffect extends OneShotEffect { + + private static final FilterCard filter = new FilterCard(); + + static { + filter.add(SuperType.LEGENDARY.getPredicate()); + } + + LychguardEffect() { + super(Outcome.Benefit); + staticText = "return all legendary creature cards from your graveyard to your hand"; + } + + private LychguardEffect(final LychguardEffect effect) { + super(effect); + } + + @Override + public LychguardEffect copy() { + return new LychguardEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + Cards cards = new CardsImpl(player.getGraveyard().getCards(filter, game)); + return player.moveCards(cards, Zone.HAND, source, game); + } +} diff --git a/Mage.Sets/src/mage/sets/Warhammer40000.java b/Mage.Sets/src/mage/sets/Warhammer40000.java index f537f55fc8..8ca7204827 100644 --- a/Mage.Sets/src/mage/sets/Warhammer40000.java +++ b/Mage.Sets/src/mage/sets/Warhammer40000.java @@ -96,6 +96,7 @@ public final class Warhammer40000 extends ExpansionSet { cards.add(new SetCardInfo("Living Death", 202, Rarity.RARE, mage.cards.l.LivingDeath.class)); cards.add(new SetCardInfo("Lokhust Heavy Destroyer", 38, Rarity.RARE, mage.cards.l.LokhustHeavyDestroyer.class)); cards.add(new SetCardInfo("Lord of Change", 24, Rarity.RARE, mage.cards.l.LordOfChange.class)); + cards.add(new SetCardInfo("Lychguard", 39, Rarity.RARE, mage.cards.l.Lychguard.class)); cards.add(new SetCardInfo("Mind Stone", 245, Rarity.UNCOMMON, mage.cards.m.MindStone.class)); cards.add(new SetCardInfo("Molten Slagheap", 284, Rarity.UNCOMMON, mage.cards.m.MoltenSlagheap.class)); cards.add(new SetCardInfo("Mountain", 315, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));