diff --git a/Mage.Sets/src/mage/cards/a/ArchivistOfOghma.java b/Mage.Sets/src/mage/cards/a/ArchivistOfOghma.java new file mode 100644 index 00000000000..81c05c065a8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/ArchivistOfOghma.java @@ -0,0 +1,79 @@ +package mage.cards.a; + +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ArchivistOfOghma extends CardImpl { + + public ArchivistOfOghma(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}"); + + this.subtype.add(SubType.HALFLING); + this.subtype.add(SubType.CLERIC); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flash + this.addAbility(FlashAbility.getInstance()); + + // Whenever an opponent searches their library, you gain 1 life and draw a card. + this.addAbility(new ArchivistOfOghmaTriggeredAbility()); + } + + private ArchivistOfOghma(final ArchivistOfOghma card) { + super(card); + } + + @Override + public ArchivistOfOghma copy() { + return new ArchivistOfOghma(this); + } +} + +class ArchivistOfOghmaTriggeredAbility extends TriggeredAbilityImpl { + + public ArchivistOfOghmaTriggeredAbility() { + super(Zone.BATTLEFIELD, new GainLifeEffect(1), false); + this.addEffect(new DrawCardSourceControllerEffect(1)); + } + + public ArchivistOfOghmaTriggeredAbility(final ArchivistOfOghmaTriggeredAbility ability) { + super(ability); + } + + @Override + public ArchivistOfOghmaTriggeredAbility copy() { + return new ArchivistOfOghmaTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.LIBRARY_SEARCHED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getTargetId().equals(event.getPlayerId()) + && game.getOpponents(getControllerId()).contains(event.getTargetId()); + } + + @Override + public String getRule() { + return "Whenever an opponent searches their library, you gain 1 life and draw a card."; + } +} \ 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 fbe2039735c..e77130c6694 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java +++ b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java @@ -29,6 +29,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet { cards.add(new SetCardInfo("Ancient Brass Dragon", 111, Rarity.MYTHIC, mage.cards.a.AncientBrassDragon.class)); cards.add(new SetCardInfo("Arcane Encyclopedia", 297, Rarity.UNCOMMON, mage.cards.a.ArcaneEncyclopedia.class)); cards.add(new SetCardInfo("Arcane Signet", 298, Rarity.UNCOMMON, mage.cards.a.ArcaneSignet.class)); + cards.add(new SetCardInfo("Archivist of Oghma", 4, Rarity.RARE, mage.cards.a.ArchivistOfOghma.class)); cards.add(new SetCardInfo("Ascend from Avernus", 5, Rarity.RARE, mage.cards.a.AscendFromAvernus.class)); cards.add(new SetCardInfo("Astarion, the Decadent", 265, Rarity.RARE, mage.cards.a.AstarionTheDecadent.class)); cards.add(new SetCardInfo("Astral Confrontation", 6, Rarity.COMMON, mage.cards.a.AstralConfrontation.class));