From 5a526f854c15f78b128a0e9b73912949d9e9c09b Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 8 Jan 2020 16:11:06 -0500 Subject: [PATCH] Implemented Eidolon of Obstruction --- .../mage/cards/e/EidolonOfObstruction.java | 81 +++++++++++++++++++ .../src/mage/sets/TherosBeyondDeath.java | 1 + 2 files changed, 82 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/e/EidolonOfObstruction.java diff --git a/Mage.Sets/src/mage/cards/e/EidolonOfObstruction.java b/Mage.Sets/src/mage/cards/e/EidolonOfObstruction.java new file mode 100644 index 0000000000..db4f205110 --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/EidolonOfObstruction.java @@ -0,0 +1,81 @@ +package mage.cards.e; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.cost.CostModificationEffectImpl; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.util.CardUtil; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class EidolonOfObstruction extends CardImpl { + + public EidolonOfObstruction(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{1}{W}"); + + this.subtype.add(SubType.SPIRIT); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + + // Loyalty abilities of planeswalkers your opponents control cost {1} more to activate. + this.addAbility(new SimpleStaticAbility(new EidolonOfObstructionEffect())); + } + + private EidolonOfObstruction(final EidolonOfObstruction card) { + super(card); + } + + @Override + public EidolonOfObstruction copy() { + return new EidolonOfObstruction(this); + } +} + +class EidolonOfObstructionEffect extends CostModificationEffectImpl { + + EidolonOfObstructionEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.INCREASE_COST); + staticText = "Loyalty abilities of planeswalkers your opponents control cost {1} more to activate"; + } + + private EidolonOfObstructionEffect(EidolonOfObstructionEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source, Ability abilityToModify) { + CardUtil.increaseCost(abilityToModify, 1); + return true; + } + + @Override + public boolean applies(Ability abilityToModify, Ability source, Game game) { + if (!(abilityToModify instanceof LoyaltyAbility)) { + return false; + } + Permanent permanent = game.getPermanent(abilityToModify.getSourceId()); + if (permanent == null) { + return false; + } + return permanent.isPlaneswalker() + && game.getOpponents(source.getControllerId()).contains(abilityToModify.getControllerId()); + } + + @Override + public EidolonOfObstructionEffect copy() { + return new EidolonOfObstructionEffect(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java index be504b9e15..6a65592225 100644 --- a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java +++ b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java @@ -56,6 +56,7 @@ public final class TherosBeyondDeath extends ExpansionSet { cards.add(new SetCardInfo("Drag to the Underworld", 89, Rarity.UNCOMMON, mage.cards.d.DragToTheUnderworld.class)); cards.add(new SetCardInfo("Dryad of Ilysian Grove", 169, Rarity.RARE, mage.cards.d.DryadOfIlysianGrove.class)); cards.add(new SetCardInfo("Eat to Extinction", 90, Rarity.RARE, mage.cards.e.EatToExtinction.class)); + cards.add(new SetCardInfo("Eidolon of Obstruction", 12, Rarity.RARE, mage.cards.e.EidolonOfObstruction.class)); cards.add(new SetCardInfo("Eidolon of Philosophy", 48, Rarity.COMMON, mage.cards.e.EidolonOfPhilosophy.class)); cards.add(new SetCardInfo("Elspeth, Sun's Nemesis", 14, Rarity.MYTHIC, mage.cards.e.ElspethSunsNemesis.class)); cards.add(new SetCardInfo("Elspeth, Undaunted Hero", 270, Rarity.MYTHIC, mage.cards.e.ElspethUndauntedHero.class));