From 4a67507e2b50449b56cc31b6e831ba35fcd2fb4c Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sat, 5 Aug 2023 22:16:01 -0400 Subject: [PATCH] [WHO] Implement The Eleventh Hour --- .../src/mage/cards/t/TheEleventhHour.java | 79 +++++++++++++++++++ Mage.Sets/src/mage/sets/DoctorWho.java | 1 + .../src/main/java/mage/constants/SubType.java | 1 + .../permanent/token/TheEleventhHourToken.java | 40 ++++++++++ 4 files changed, 121 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/t/TheEleventhHour.java create mode 100644 Mage/src/main/java/mage/game/permanent/token/TheEleventhHourToken.java diff --git a/Mage.Sets/src/mage/cards/t/TheEleventhHour.java b/Mage.Sets/src/mage/cards/t/TheEleventhHour.java new file mode 100644 index 00000000000..75503ad6f0b --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TheEleventhHour.java @@ -0,0 +1,79 @@ +package mage.cards.t; + +import mage.abilities.common.SagaAbility; +import mage.abilities.effects.common.CreateTokenCopyTargetEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SagaChapter; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.FilterCard; +import mage.game.permanent.token.FoodToken; +import mage.game.permanent.token.TheEleventhHourToken; +import mage.target.common.TargetCardInLibrary; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TheEleventhHour extends CardImpl { + + private static final FilterCard filter = new FilterCard("a Doctor card"); + + static { + filter.add(SubType.DOCTOR.getPredicate()); + } + + public TheEleventhHour(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{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 -- Search your library for a Doctor card, reveal it, put it into your hand, then shuffle. + sagaAbility.addChapterEffect( + this, SagaChapter.CHAPTER_I, + new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true) + ); + + // II -- Create a Food token and a 1/1 white Human creature token with "Doctor spells you cast cost 1 less to cast." + sagaAbility.addChapterEffect( + this, SagaChapter.CHAPTER_II, + new CreateTokenEffect(new FoodToken()), + new CreateTokenEffect(new TheEleventhHourToken()) + .setText("and a 1/1 white Human creature token with " + + "\"Doctor spells you cast cost 1 less to cast.\"") + ); + + // III -- Create a token that's a copy of target creature, except it's a legendary Alien named Prisoner Zero. + sagaAbility.addChapterEffect( + this, SagaChapter.CHAPTER_III, SagaChapter.CHAPTER_III, + new CreateTokenCopyTargetEffect() + .setPermanentModifier(token -> { + token.addSuperType(SuperType.LEGENDARY); + token.removeAllCreatureTypes(); + token.addSubType(SubType.ALIEN); + token.setName("Prisoner Zero"); + }) + .setText("create a token that's a copy of target creature, " + + "except it's a legendary Alien named Prisoner Zero"), + new TargetCreaturePermanent() + ); + } + + private TheEleventhHour(final TheEleventhHour card) { + super(card); + } + + @Override + public TheEleventhHour copy() { + return new TheEleventhHour(this); + } +} diff --git a/Mage.Sets/src/mage/sets/DoctorWho.java b/Mage.Sets/src/mage/sets/DoctorWho.java index a800dcbe6bd..c302e6f2959 100644 --- a/Mage.Sets/src/mage/sets/DoctorWho.java +++ b/Mage.Sets/src/mage/sets/DoctorWho.java @@ -27,6 +27,7 @@ public final class DoctorWho extends ExpansionSet { cards.add(new SetCardInfo("Plains", 197, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Sarah Jane Smith", 6, Rarity.RARE, mage.cards.s.SarahJaneSmith.class)); cards.add(new SetCardInfo("Swamp", 201, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("The Eleventh Hour", 41, Rarity.RARE, mage.cards.t.TheEleventhHour.class)); cards.add(new SetCardInfo("The Flux", 86, Rarity.RARE, mage.cards.t.TheFlux.class)); cards.add(new SetCardInfo("The Thirteenth Doctor", 4, Rarity.MYTHIC, mage.cards.t.TheThirteenthDoctor.class)); cards.add(new SetCardInfo("Yasmin Khan", 7, Rarity.RARE, mage.cards.y.YasminKhan.class)); diff --git a/Mage/src/main/java/mage/constants/SubType.java b/Mage/src/main/java/mage/constants/SubType.java index 8256fca6474..a04eec7225c 100644 --- a/Mage/src/main/java/mage/constants/SubType.java +++ b/Mage/src/main/java/mage/constants/SubType.java @@ -60,6 +60,7 @@ public enum SubType { // A ADVISOR("Advisor", SubTypeSet.CreatureType), AETHERBORN("Aetherborn", SubTypeSet.CreatureType), + ALIEN("Alien", SubTypeSet.CreatureType), ALLY("Ally", SubTypeSet.CreatureType), ANGEL("Angel", SubTypeSet.CreatureType), ANTELOPE("Antelope", SubTypeSet.CreatureType), diff --git a/Mage/src/main/java/mage/game/permanent/token/TheEleventhHourToken.java b/Mage/src/main/java/mage/game/permanent/token/TheEleventhHourToken.java new file mode 100644 index 00000000000..10f523dee1a --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/TheEleventhHourToken.java @@ -0,0 +1,40 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.cost.SpellsCostReductionControllerEffect; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.filter.FilterCard; + +/** + * @author LoneFox + */ +public final class TheEleventhHourToken extends TokenImpl { + + private static final FilterCard filter = new FilterCard("Doctor spells you cast"); + + static { + filter.add(SubType.DOCTOR.getPredicate()); + } + + public TheEleventhHourToken() { + super("Human Token", "1/1 white Human creature token with \"Doctor spells you cast cost 1 less to cast.\""); + cardType.add(CardType.CREATURE); + color.setWhite(true); + subtype.add(SubType.HUMAN); + power = new MageInt(1); + toughness = new MageInt(1); + + addAbility(new SimpleStaticAbility(new SpellsCostReductionControllerEffect(filter, 1))); + } + + protected TheEleventhHourToken(final TheEleventhHourToken token) { + super(token); + } + + @Override + public TheEleventhHourToken copy() { + return new TheEleventhHourToken(this); + } +}