From ee9f9c1d77a1e99fa7ae6ba7aac3b5e0bfba33c9 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 1 Jun 2022 08:45:18 -0400 Subject: [PATCH] [CLB] Implemented Solemn Doomguide --- .../src/mage/cards/s/SolemnDoomguide.java | 88 +++++++++++++++++++ .../CommanderLegendsBattleForBaldursGate.java | 1 + 2 files changed, 89 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SolemnDoomguide.java diff --git a/Mage.Sets/src/mage/cards/s/SolemnDoomguide.java b/Mage.Sets/src/mage/cards/s/SolemnDoomguide.java new file mode 100644 index 0000000000..89d6c9987d --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SolemnDoomguide.java @@ -0,0 +1,88 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.UnearthAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.game.Game; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SolemnDoomguide extends CardImpl { + + public SolemnDoomguide(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + + this.subtype.add(SubType.TIEFLING); + this.subtype.add(SubType.CLERIC); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Each creature card in your graveyard that's a Cleric, Rogue, Warrior, and/or Wizard has unearth {1}{B} + this.addAbility(new SimpleStaticAbility(new SolemnDoomguideEffect())); + } + + private SolemnDoomguide(final SolemnDoomguide card) { + super(card); + } + + @Override + public SolemnDoomguide copy() { + return new SolemnDoomguide(this); + } +} + +class SolemnDoomguideEffect extends ContinuousEffectImpl { + + SolemnDoomguideEffect() { + super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); + staticText = "each creature card in your graveyard that's " + + "a Cleric, Rogue, Warrior, and/or Wizard has unearth {1}{B}"; + } + + private SolemnDoomguideEffect(final SolemnDoomguideEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return false; + } + for (UUID cardId : controller.getGraveyard()) { + Card card = game.getCard(cardId); + if (card == null || !card.isCreature(game) + || !(card.hasSubtype(SubType.CLERIC, game) + || card.hasSubtype(SubType.ROGUE, game) + || card.hasSubtype(SubType.WARRIOR, game) + || card.hasSubtype(SubType.WIZARD, game))) { + continue; + } + UnearthAbility ability = new UnearthAbility(new ManaCostsImpl<>("{1}{B}")); + ability.setSourceId(cardId); + ability.setControllerId(card.getOwnerId()); + game.getState().addOtherAbility(card, ability); + } + return true; + } + + @Override + public SolemnDoomguideEffect copy() { + return new SolemnDoomguideEffect(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java index 10b8c402dc..525881c554 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java +++ b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java @@ -270,6 +270,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet { cards.add(new SetCardInfo("Skullwinder", 256, Rarity.UNCOMMON, mage.cards.s.Skullwinder.class)); cards.add(new SetCardInfo("Sky Diamond", 337, Rarity.COMMON, mage.cards.s.SkyDiamond.class)); cards.add(new SetCardInfo("Slaughter the Strong", 43, Rarity.UNCOMMON, mage.cards.s.SlaughterTheStrong.class)); + cards.add(new SetCardInfo("Solemn Doomguide", 672, Rarity.RARE, mage.cards.s.SolemnDoomguide.class)); cards.add(new SetCardInfo("Spectacular Showdown", 679, Rarity.RARE, mage.cards.s.SpectacularShowdown.class)); cards.add(new SetCardInfo("Spire Garden", 361, Rarity.RARE, mage.cards.s.SpireGarden.class)); cards.add(new SetCardInfo("Steadfast Unicorn", 44, Rarity.COMMON, mage.cards.s.SteadfastUnicorn.class));