From 6b7d217f982af5019e668e7f07ed23d75b520563 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 11 Jan 2020 14:28:05 -0500 Subject: [PATCH] Implemented Flummoxed Cyclops --- .../src/mage/cards/f/FlummoxedCyclops.java | 87 +++++++++++++++++++ .../src/mage/sets/TherosBeyondDeath.java | 1 + 2 files changed, 88 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/f/FlummoxedCyclops.java diff --git a/Mage.Sets/src/mage/cards/f/FlummoxedCyclops.java b/Mage.Sets/src/mage/cards/f/FlummoxedCyclops.java new file mode 100644 index 0000000000..ed84eb23ef --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FlummoxedCyclops.java @@ -0,0 +1,87 @@ +package mage.cards.f; + +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.combat.CantBlockSourceEffect; +import mage.abilities.keyword.ReachAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; + +import java.util.Objects; +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class FlummoxedCyclops extends CardImpl { + + public FlummoxedCyclops(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}"); + + this.subtype.add(SubType.CYCLOPS); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Reach + this.addAbility(ReachAbility.getInstance()); + + // Whenever two or more creatures your opponents control attack, Flummoxed Cyclops can't block this combat. + this.addAbility(new FlummoxedCyclopsTriggeredAbility()); + } + + private FlummoxedCyclops(final FlummoxedCyclops card) { + super(card); + } + + @Override + public FlummoxedCyclops copy() { + return new FlummoxedCyclops(this); + } +} + +class FlummoxedCyclopsTriggeredAbility extends TriggeredAbilityImpl { + + FlummoxedCyclopsTriggeredAbility() { + super(Zone.BATTLEFIELD, new CantBlockSourceEffect(Duration.EndOfCombat)); + } + + private FlummoxedCyclopsTriggeredAbility(final FlummoxedCyclopsTriggeredAbility ability) { + super(ability); + } + + @Override + public FlummoxedCyclopsTriggeredAbility copy() { + return new FlummoxedCyclopsTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DECLARED_ATTACKERS; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (!game.getOpponents(getControllerId()).contains(game.getCombat().getAttackingPlayerId())) { + return false; + } + return game + .getCombat() + .getAttackers() + .stream() + .map(game::getPermanent) + .filter(Objects::nonNull) + .count() > 1; + } + + @Override + public String getRule() { + return "Whenever two or more creatures your opponents control attack, {this} can't block this combat."; + } + +} diff --git a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java index a9082da5cd..daf8ca681c 100644 --- a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java +++ b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java @@ -95,6 +95,7 @@ public final class TherosBeyondDeath extends ExpansionSet { cards.add(new SetCardInfo("Final Death", 95, Rarity.COMMON, mage.cards.f.FinalDeath.class)); cards.add(new SetCardInfo("Final Flare", 134, Rarity.COMMON, mage.cards.f.FinalFlare.class)); cards.add(new SetCardInfo("Flicker of Fate", 16, Rarity.COMMON, mage.cards.f.FlickerOfFate.class)); + cards.add(new SetCardInfo("Flummoxed Cyclops", 135, Rarity.COMMON, mage.cards.f.FlummoxedCyclops.class)); cards.add(new SetCardInfo("Forest", 254, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Fruit of Tizerus", 96, Rarity.COMMON, mage.cards.f.FruitOfTizerus.class)); cards.add(new SetCardInfo("Funeral Rites", 97, Rarity.COMMON, mage.cards.f.FuneralRites.class));