From 078fbe6eebbc7b594d70e98a2ea80a588ccacb59 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sun, 15 Oct 2023 18:08:39 -0400 Subject: [PATCH] [WHO] Implement The Fifth Doctor --- .../src/mage/cards/t/TheFifthDoctor.java | 75 +++++++++++++++++++ Mage.Sets/src/mage/sets/DoctorWho.java | 1 + 2 files changed, 76 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/t/TheFifthDoctor.java diff --git a/Mage.Sets/src/mage/cards/t/TheFifthDoctor.java b/Mage.Sets/src/mage/cards/t/TheFifthDoctor.java new file mode 100644 index 00000000000..4fe139b6d4c --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TheFifthDoctor.java @@ -0,0 +1,75 @@ +package mage.cards.t; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.effects.common.UntapAllEffect; +import mage.abilities.effects.common.counter.AddCountersAllEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.constants.TargetController; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicate; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.EnteredThisTurnPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.watchers.common.AttackedThisTurnWatcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TheFifthDoctor extends CardImpl { + + private static final FilterPermanent filter = new FilterControlledCreaturePermanent( + "creature you control that didn't attack or enter the battlefield this turn" + ); + + static { + filter.add(Predicates.not(EnteredThisTurnPredicate.instance)); + filter.add(TheFifthDoctorPredicate.instance); + } + + public TheFifthDoctor(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{U}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.TIME_LORD); + this.subtype.add(SubType.DOCTOR); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Peaceful Coexistence -- At the beginning of your end step, put a +1/+1 counter on each creature you control that didn't attack or enter the battlefield this turn. Untap those creatures. + Ability ability = new BeginningOfEndStepTriggeredAbility( + new AddCountersAllEffect(CounterType.P1P1.createInstance(), filter), + TargetController.YOU, false + ); + ability.addEffect(new UntapAllEffect(filter).setText("Untap those creatures")); + this.addAbility(ability.withFlavorWord("Peaceful Coexistence"), new AttackedThisTurnWatcher()); + } + + private TheFifthDoctor(final TheFifthDoctor card) { + super(card); + } + + @Override + public TheFifthDoctor copy() { + return new TheFifthDoctor(this); + } +} + +enum TheFifthDoctorPredicate implements Predicate { + instance; + + @Override + public boolean apply(Permanent input, Game game) { + return !game.getState().getWatcher(AttackedThisTurnWatcher.class).checkIfAttacked(input, game); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/DoctorWho.java b/Mage.Sets/src/mage/sets/DoctorWho.java index 523749c9c2c..9cae385b125 100644 --- a/Mage.Sets/src/mage/sets/DoctorWho.java +++ b/Mage.Sets/src/mage/sets/DoctorWho.java @@ -197,6 +197,7 @@ public final class DoctorWho extends ExpansionSet { cards.add(new SetCardInfo("Terramorphic Expanse", 322, Rarity.COMMON, mage.cards.t.TerramorphicExpanse.class)); cards.add(new SetCardInfo("The Dalek Emperor", 120, Rarity.RARE, mage.cards.t.TheDalekEmperor.class)); cards.add(new SetCardInfo("The Eleventh Hour", 41, Rarity.RARE, mage.cards.t.TheEleventhHour.class)); + cards.add(new SetCardInfo("The Fifth Doctor", 127, Rarity.RARE, mage.cards.t.TheFifthDoctor.class)); cards.add(new SetCardInfo("The Flux", 86, Rarity.RARE, mage.cards.t.TheFlux.class)); cards.add(new SetCardInfo("The Ninth Doctor", 148, Rarity.RARE, mage.cards.t.TheNinthDoctor.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("The Ninth Doctor", 432, Rarity.RARE, mage.cards.t.TheNinthDoctor.class, NON_FULL_USE_VARIOUS));