From b82b213939da4d0e3316cc1b05cb4b2a9f367214 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 31 Oct 2020 17:08:19 -0400 Subject: [PATCH] [CMR] Implemented Court of Bounty --- Mage.Sets/src/mage/cards/c/CourtOfBounty.java | 57 +++++++++++++++++++ Mage.Sets/src/mage/sets/CommanderLegends.java | 1 + 2 files changed, 58 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/CourtOfBounty.java diff --git a/Mage.Sets/src/mage/cards/c/CourtOfBounty.java b/Mage.Sets/src/mage/cards/c/CourtOfBounty.java new file mode 100644 index 00000000000..3e6828b6f9f --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CourtOfBounty.java @@ -0,0 +1,57 @@ +package mage.cards.c; + +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.MonarchIsSourceControllerCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.BecomesMonarchSourceEffect; +import mage.abilities.effects.common.PutCardFromHandOntoBattlefieldEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.filter.FilterCard; +import mage.filter.StaticFilters; +import mage.filter.predicate.Predicates; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class CourtOfBounty extends CardImpl { + + private static final FilterCard filter = new FilterCard("a creature or land card"); + + static { + filter.add(Predicates.or( + CardType.CREATURE.getPredicate(), + CardType.LAND.getPredicate() + )); + } + + public CourtOfBounty(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{G}"); + + // When Court of Bounty enters the battlefield, you become the monarch. + this.addAbility(new EntersBattlefieldTriggeredAbility(new BecomesMonarchSourceEffect())); + + // At the beginning of your upkeep, you may put a land card from your hand onto the battlefield. If you're the monarch, instead you may put a creature or land card from your hand onto the battlefield. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new ConditionalOneShotEffect( + new PutCardFromHandOntoBattlefieldEffect(filter), + new PutCardFromHandOntoBattlefieldEffect(StaticFilters.FILTER_CARD_LAND_A), + MonarchIsSourceControllerCondition.instance, "you may put a land card " + + "from your hand onto the battlefield. If you're the monarch, " + + "instead you may put a creature or land card from your hand onto the battlefield" + ), TargetController.YOU, false)); + } + + private CourtOfBounty(final CourtOfBounty card) { + super(card); + } + + @Override + public CourtOfBounty copy() { + return new CourtOfBounty(this); + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegends.java b/Mage.Sets/src/mage/sets/CommanderLegends.java index 01074817424..70f08574c40 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegends.java +++ b/Mage.Sets/src/mage/sets/CommanderLegends.java @@ -58,6 +58,7 @@ public final class CommanderLegends extends ExpansionSet { cards.add(new SetCardInfo("Commander's Sphere", 306, Rarity.COMMON, mage.cards.c.CommandersSphere.class)); cards.add(new SetCardInfo("Confiscate", 62, Rarity.UNCOMMON, mage.cards.c.Confiscate.class)); cards.add(new SetCardInfo("Court Street Denizen", 17, Rarity.COMMON, mage.cards.c.CourtStreetDenizen.class)); + cards.add(new SetCardInfo("Court of Bounty", 220, Rarity.RARE, mage.cards.c.CourtOfBounty.class)); cards.add(new SetCardInfo("Court of Cunning", 63, Rarity.RARE, mage.cards.c.CourtOfCunning.class)); cards.add(new SetCardInfo("Court of Grace", 16, Rarity.RARE, mage.cards.c.CourtOfGrace.class)); cards.add(new SetCardInfo("Cuombajj Witches", 116, Rarity.UNCOMMON, mage.cards.c.CuombajjWitches.class));