From 99f484672ec069b57bcc7cb74e04b7895cf32920 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 2 Jun 2022 19:42:14 -0400 Subject: [PATCH] [CLB] Implemented You Look Upon the Tarrasque --- .../mage/cards/y/YouLookUponTheTarrasque.java | 98 +++++++++++++++++++ .../CommanderLegendsBattleForBaldursGate.java | 1 + 2 files changed, 99 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/y/YouLookUponTheTarrasque.java diff --git a/Mage.Sets/src/mage/cards/y/YouLookUponTheTarrasque.java b/Mage.Sets/src/mage/cards/y/YouLookUponTheTarrasque.java new file mode 100644 index 00000000000..3bcc1c633c4 --- /dev/null +++ b/Mage.Sets/src/mage/cards/y/YouLookUponTheTarrasque.java @@ -0,0 +1,98 @@ +package mage.cards.y; + +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.RequirementEffect; +import mage.abilities.effects.common.PreventAllNonCombatDamageToAllEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class YouLookUponTheTarrasque extends CardImpl { + + public YouLookUponTheTarrasque(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{G}"); + + // Choose one — + // • Run and Hide — Prevent all combat damage that would be dealt to you and creatures you control this turn. + this.getSpellAbility().addEffect(new PreventAllNonCombatDamageToAllEffect( + Duration.EndOfTurn, StaticFilters.FILTER_CONTROLLED_CREATURES, true + )); + this.getSpellAbility().withFirstModeFlavorWord("Run and Hide"); + + // • Gather Your Courage — Target creature gets +5/+5 and gains indestructible until end of turn. All creatures your opponents control able to block that creature this turn do so. + this.getSpellAbility().addMode(new Mode(new BoostTargetEffect(5, 5) + .setText("target creature gets +5/+5")) + .addEffect(new GainAbilityTargetEffect(IndestructibleAbility.getInstance()) + .setText("and gains indestructible until end of turn")) + .addEffect(new YouLookUponTheTarrasqueEffect()) + .addTarget(new TargetCreaturePermanent()) + .withFlavorWord("Gather Your Courage")); + } + + private YouLookUponTheTarrasque(final YouLookUponTheTarrasque card) { + super(card); + } + + @Override + public YouLookUponTheTarrasque copy() { + return new YouLookUponTheTarrasque(this); + } +} + +class YouLookUponTheTarrasqueEffect extends RequirementEffect { + + public YouLookUponTheTarrasqueEffect() { + super(Duration.EndOfTurn); + staticText = "All creatures your opponents control able to block that creature this turn do so"; + } + + public YouLookUponTheTarrasqueEffect(final YouLookUponTheTarrasqueEffect effect) { + super(effect); + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + Permanent attackingCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source)); + return attackingCreature != null + && attackingCreature.isAttacking() + && game + .getOpponents(source.getControllerId()) + .contains(permanent.getControllerId()) + && permanent + .canBlock(this.getTargetPointer().getFirst(game, source), game); + } + + @Override + public boolean mustAttack(Game game) { + return false; + } + + @Override + public boolean mustBlock(Game game) { + return true; + } + + @Override + public UUID mustBlockAttacker(Ability source, Game game) { + return this.getTargetPointer().getFirst(game, source); + } + + @Override + public YouLookUponTheTarrasqueEffect copy() { + return new YouLookUponTheTarrasqueEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java index f9a7b0ab706..48170a80f9a 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java +++ b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java @@ -586,6 +586,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet { cards.add(new SetCardInfo("Wyll, Blade of Frontiers", 208, Rarity.RARE, mage.cards.w.WyllBladeOfFrontiers.class)); cards.add(new SetCardInfo("Wyrm's Crossing Patrol", 51, Rarity.COMMON, mage.cards.w.WyrmsCrossingPatrol.class)); cards.add(new SetCardInfo("Xenagos, the Reveler", 853, Rarity.MYTHIC, mage.cards.x.XenagosTheReveler.class)); + cards.add(new SetCardInfo("You Look Upon the Tarrasque", 262, Rarity.UNCOMMON, mage.cards.y.YouLookUponTheTarrasque.class)); cards.add(new SetCardInfo("You Meet in a Tavern", 263, Rarity.COMMON, mage.cards.y.YouMeetInATavern.class)); cards.add(new SetCardInfo("You're Confronted by Robbers", 53, Rarity.COMMON, mage.cards.y.YoureConfrontedByRobbers.class)); cards.add(new SetCardInfo("You've Been Caught Stealing", 211, Rarity.COMMON, mage.cards.y.YouveBeenCaughtStealing.class));