Skip to content

Commit

Permalink
[WHO] Implement An Unearthly Child
Browse files Browse the repository at this point in the history
  • Loading branch information
theelk801 committed Oct 10, 2023
1 parent 227519f commit a497042
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
58 changes: 58 additions & 0 deletions Mage.Sets/src/mage/cards/a/AnUnearthlyChild.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package mage.cards.a;

import mage.abilities.common.SagaAbility;
import mage.abilities.effects.common.RevealCardsFromLibraryUntilEffect;
import mage.abilities.keyword.DoctorsCompanionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.PutCards;
import mage.constants.SagaChapter;
import mage.constants.SubType;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.AbilityPredicate;

import java.util.UUID;

/**
* @author TheElk801
*/
public final class AnUnearthlyChild extends CardImpl {

private static final FilterCard filter = new FilterCard("a Doctor card, a card with doctor's companion, or a Vehicle card");

static {
filter.add(Predicates.or(
SubType.DOCTOR.getPredicate(),
new AbilityPredicate(DoctorsCompanionAbility.class),
SubType.VEHICLE.getPredicate()
));
}

public AnUnearthlyChild(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}{U}");

this.subtype.add(SubType.SAGA);

// (As this Saga enters and after your draw step, add a lore counter. Sacrifice after III.)
SagaAbility sagaAbility = new SagaAbility(this);

// I, II, III -- Reveal cards from the top of your library until you reveal a Doctor card, a card with doctor's companion, or a Vehicle card. Put that card into your hand and the rest on the bottom of your library in a random order.
sagaAbility.addChapterEffect(
this, SagaChapter.CHAPTER_I, SagaChapter.CHAPTER_III,
new RevealCardsFromLibraryUntilEffect(filter, PutCards.HAND, PutCards.BOTTOM_RANDOM)
);

this.addAbility(sagaAbility);
}

private AnUnearthlyChild(final AnUnearthlyChild card) {
super(card);
}

@Override
public AnUnearthlyChild copy() {
return new AnUnearthlyChild(this);
}
}
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/DoctorWho.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ private DoctorWho() {
cards.add(new SetCardInfo("Ace, Fearless Rebel", 98, Rarity.RARE, mage.cards.a.AceFearlessRebel.class));
cards.add(new SetCardInfo("Adric, Mathematical Genius", 33, Rarity.RARE, mage.cards.a.AdricMathematicalGenius.class));
cards.add(new SetCardInfo("Alistair, the Brigadier", 112, Rarity.RARE, mage.cards.a.AlistairTheBrigadier.class));
cards.add(new SetCardInfo("An Unearthly Child", 35, Rarity.RARE, mage.cards.a.AnUnearthlyChild.class));
cards.add(new SetCardInfo("Arcane Signet", 239, Rarity.COMMON, mage.cards.a.ArcaneSignet.class));
cards.add(new SetCardInfo("As Foretold", 214, Rarity.RARE, mage.cards.a.AsForetold.class));
cards.add(new SetCardInfo("Ash Barrens", 257, Rarity.UNCOMMON, mage.cards.a.AshBarrens.class));
Expand Down

0 comments on commit a497042

Please sign in to comment.