From c92eaee52427be474924d6c5a89233c94b02bab6 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 6 Jun 2022 08:22:25 -0400 Subject: [PATCH] [CLB] Implemented Gond Gate --- Mage.Sets/src/mage/cards/g/GondGate.java | 86 +++++++++++++++++++ .../CommanderLegendsBattleForBaldursGate.java | 1 + 2 files changed, 87 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/g/GondGate.java diff --git a/Mage.Sets/src/mage/cards/g/GondGate.java b/Mage.Sets/src/mage/cards/g/GondGate.java new file mode 100644 index 00000000000..d3b0d29273b --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GondGate.java @@ -0,0 +1,86 @@ +package mage.cards.g; + +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.mana.AnyColorLandsProduceManaAbility; +import mage.abilities.mana.ColorlessManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class GondGate extends CardImpl { + + private static final FilterPermanent filter = new FilterControlledPermanent(SubType.GATE); + + public GondGate(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); + + this.subtype.add(SubType.GATE); + + // Gates you control enter the battlefield untapped. + this.addAbility(new SimpleStaticAbility(new GondGateEffect())); + + // {T}: Add {C}. + this.addAbility(new ColorlessManaAbility()); + + // {T}: Add one mana of any color that a Gate you control could produce. + this.addAbility(new AnyColorLandsProduceManaAbility(TargetController.YOU, true, filter)); + } + + private GondGate(final GondGate card) { + super(card); + } + + @Override + public GondGate copy() { + return new GondGate(this); + } +} + +class GondGateEffect extends ReplacementEffectImpl { + + GondGateEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "Gates you control enter the battlefield untapped"; + } + + private GondGateEffect(final GondGateEffect effect) { + super(effect); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + ((EntersTheBattlefieldEvent) event).getTarget().setTapped(false); + return false; + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + Permanent targetObject = ((EntersTheBattlefieldEvent) event).getTarget(); + return targetObject != null + && targetObject.isControlledBy(source.getControllerId()) + && targetObject.hasSubtype(SubType.GATE, game); + } + + @Override + public GondGateEffect copy() { + return new GondGateEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java index 2f4d18ba7cc..329961bc8ec 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java +++ b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java @@ -263,6 +263,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet { cards.add(new SetCardInfo("Goblin Spymaster", 795, Rarity.RARE, mage.cards.g.GoblinSpymaster.class)); cards.add(new SetCardInfo("Goggles of Night", 74, Rarity.COMMON, mage.cards.g.GogglesOfNight.class)); cards.add(new SetCardInfo("Goliath Paladin", 21, Rarity.COMMON, mage.cards.g.GoliathPaladin.class)); + cards.add(new SetCardInfo("Gond Gate", 353, Rarity.UNCOMMON, mage.cards.g.GondGate.class)); cards.add(new SetCardInfo("Gonti, Lord of Luxury", 753, Rarity.RARE, mage.cards.g.GontiLordOfLuxury.class)); cards.add(new SetCardInfo("Gorion, Wise Mentor", 276, Rarity.RARE, mage.cards.g.GorionWiseMentor.class)); cards.add(new SetCardInfo("Gray Harbor Merfolk", 75, Rarity.COMMON, mage.cards.g.GrayHarborMerfolk.class));