From 418e81a966cb8e5d24e03d2f4c6b49ae1e1de30c Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 14 Sep 2018 08:30:50 -0400 Subject: [PATCH] Implemented Centaur Mediator --- .../src/mage/cards/c/CentaurMediator.java | 70 +++++++++++++++++++ Mage.Sets/src/mage/sets/GuildsOfRavnica.java | 1 + 2 files changed, 71 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/CentaurMediator.java diff --git a/Mage.Sets/src/mage/cards/c/CentaurMediator.java b/Mage.Sets/src/mage/cards/c/CentaurMediator.java new file mode 100644 index 0000000000..6f3cc72ed3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CentaurMediator.java @@ -0,0 +1,70 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; + +/** + * + * @author TheElk801 + */ +public final class CentaurMediator extends CardImpl { + + public CentaurMediator(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{W}"); + + this.subtype.add(SubType.CENTAUR); + this.subtype.add(SubType.CLERIC); + + // When Centaur Mediator enters the battlefield, each player gains 4 life. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new CentaurMediatorEffect() + )); + } + + public CentaurMediator(final CentaurMediator card) { + super(card); + } + + @Override + public CentaurMediator copy() { + return new CentaurMediator(this); + } +} + +class CentaurMediatorEffect extends OneShotEffect { + + public CentaurMediatorEffect() { + super(Outcome.GainLife); + staticText = "each player gains 4 life."; + } + + public CentaurMediatorEffect(final CentaurMediatorEffect effect) { + super(effect); + } + + @Override + public CentaurMediatorEffect copy() { + return new CentaurMediatorEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + game.getState().getPlayersInRange( + source.getControllerId(), game + ).stream().map((playerId) -> game.getPlayer(playerId)).filter( + (player) -> (player != null) + ).forEachOrdered((player) -> { + player.gainLife(4, game, source); + }); + return true; + } + +} diff --git a/Mage.Sets/src/mage/sets/GuildsOfRavnica.java b/Mage.Sets/src/mage/sets/GuildsOfRavnica.java index 44b163b1a5..2988176f8c 100644 --- a/Mage.Sets/src/mage/sets/GuildsOfRavnica.java +++ b/Mage.Sets/src/mage/sets/GuildsOfRavnica.java @@ -38,6 +38,7 @@ public final class GuildsOfRavnica extends ExpansionSet { cards.add(new SetCardInfo("Boros Guildgate", 244, Rarity.COMMON, mage.cards.b.BorosGuildgate.class)); cards.add(new SetCardInfo("Boros Locket", 231, Rarity.COMMON, mage.cards.b.BorosLocket.class)); cards.add(new SetCardInfo("Bounty Agent", 2, Rarity.RARE, mage.cards.b.BountyAgent.class)); + cards.add(new SetCardInfo("Centaur Mediator", 158, Rarity.COMMON, mage.cards.c.CentaurMediator.class)); cards.add(new SetCardInfo("Chemister's Insight", 32, Rarity.UNCOMMON, mage.cards.c.ChemistersInsight.class)); cards.add(new SetCardInfo("Chromatic Lantern", 233, Rarity.RARE, mage.cards.c.ChromaticLantern.class)); cards.add(new SetCardInfo("Citywatch Sphinx", 33, Rarity.UNCOMMON, mage.cards.c.CitywatchSphinx.class));