From e6e802033b52475b22f3b0afc41cfbef7d5a237f Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Tue, 7 Sep 2021 15:43:22 -0500 Subject: [PATCH] [MID] Implemented Augur of Autumn --- Mage.Sets/src/mage/cards/a/AugurOfAutumn.java | 66 +++++++++++++++++++ .../src/mage/sets/InnistradMidnightHunt.java | 1 + .../LookAtTopCardOfLibraryAnyTimeEffect.java | 11 +++- 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/a/AugurOfAutumn.java diff --git a/Mage.Sets/src/mage/cards/a/AugurOfAutumn.java b/Mage.Sets/src/mage/cards/a/AugurOfAutumn.java new file mode 100644 index 0000000000..26e26f2d42 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AugurOfAutumn.java @@ -0,0 +1,66 @@ +package mage.cards.a; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.CovenCondition; +import mage.abilities.decorator.ConditionalAsThoughEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.LookAtTopCardOfLibraryAnyTimeEffect; +import mage.abilities.effects.common.continuous.PlayTheTopCardEffect; +import mage.abilities.hint.common.CovenHint; +import mage.constants.AbilityWord; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; +import mage.filter.common.FilterLandCard; + +/** + * + * @author weirddan455 + */ +public final class AugurOfAutumn extends CardImpl { + + private static final FilterCard filter = new FilterLandCard("play lands"); + private static final FilterCard filter2 = new FilterCreatureCard("cast creature spells"); + + public AugurOfAutumn(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.DRUID); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // You may look at the top card of your library any time. + this.addAbility(new SimpleStaticAbility(new LookAtTopCardOfLibraryAnyTimeEffect())); + + // You may play lands from the top of your library. + this.addAbility(new SimpleStaticAbility(new PlayTheTopCardEffect(TargetController.YOU, filter, false))); + + // Coven — As long as you control three or more creatures with different powers, you may cast creature spells from the top of your library. + Effect effect = new ConditionalAsThoughEffect( + new PlayTheTopCardEffect(TargetController.YOU, filter2, false), + CovenCondition.instance + ); + effect.setText("As long as you control three or more creatures with different powers, you may cast creature spells from the top of your library"); + Ability ability = new SimpleStaticAbility(effect); + ability.setAbilityWord(AbilityWord.COVEN); + ability.addHint(CovenHint.instance); + this.addAbility(ability); + } + + private AugurOfAutumn(final AugurOfAutumn card) { + super(card); + } + + @Override + public AugurOfAutumn copy() { + return new AugurOfAutumn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java index 7b87569833..81bb620acc 100644 --- a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java +++ b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java @@ -32,6 +32,7 @@ public final class InnistradMidnightHunt extends ExpansionSet { this.numBoosterDoubleFaced = 1; cards.add(new SetCardInfo("Arrogant Outlaw", 84, Rarity.COMMON, mage.cards.a.ArrogantOutlaw.class)); + cards.add(new SetCardInfo("Augur of Autumn", 168, Rarity.RARE, mage.cards.a.AugurOfAutumn.class)); cards.add(new SetCardInfo("Bladestitched Skaab", 212, Rarity.UNCOMMON, mage.cards.b.BladestitchedSkaab.class)); cards.add(new SetCardInfo("Briarbridge Tracker", 172, Rarity.RARE, mage.cards.b.BriarbridgeTracker.class)); cards.add(new SetCardInfo("Brimstone Vandal", 130, Rarity.COMMON, mage.cards.b.BrimstoneVandal.class)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/LookAtTopCardOfLibraryAnyTimeEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/LookAtTopCardOfLibraryAnyTimeEffect.java index 281a6cead4..62d074e21e 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/LookAtTopCardOfLibraryAnyTimeEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/LookAtTopCardOfLibraryAnyTimeEffect.java @@ -43,7 +43,16 @@ public class LookAtTopCardOfLibraryAnyTimeEffect extends ContinuousEffectImpl { default: throw new IllegalArgumentException("Unknown target library type: " + targetLibrary); } - staticText = duration.toString().isEmpty() ? "" : duration + " you may look at the top card of " + libInfo + " any time."; + StringBuilder sb = new StringBuilder(); + String durationString = duration.toString(); + if (durationString != null && !durationString.isEmpty()) { + sb.append(durationString); + sb.append(' '); + } + sb.append("you may look at the top card of "); + sb.append(libInfo); + sb.append(" any time"); + staticText = sb.toString(); } protected LookAtTopCardOfLibraryAnyTimeEffect(final LookAtTopCardOfLibraryAnyTimeEffect effect) {