diff --git a/Mage.Sets/src/mage/cards/m/ModelOfUnity.java b/Mage.Sets/src/mage/cards/m/ModelOfUnity.java new file mode 100644 index 00000000000..5a4b00fab36 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/ModelOfUnity.java @@ -0,0 +1,76 @@ +package mage.cards.m; + +import mage.abilities.Ability; +import mage.abilities.common.FinishVotingTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.mana.AnyColorManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.players.Player; + +import java.util.Set; +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ModelOfUnity extends CardImpl { + + public ModelOfUnity(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); + + // Whenever players finish voting, you and each opponent who voted for a choice you voted for may scry 2. + this.addAbility(new FinishVotingTriggeredAbility(new ModelOfUnityEffect())); + + // {T}: Add one mana of any color. + this.addAbility(new AnyColorManaAbility()); + } + + private ModelOfUnity(final ModelOfUnity card) { + super(card); + } + + @Override + public ModelOfUnity copy() { + return new ModelOfUnity(this); + } +} + +class ModelOfUnityEffect extends OneShotEffect { + + ModelOfUnityEffect() { + super(Outcome.Benefit); + staticText = "you and each opponent who voted for a choice you voted for may scry 2"; + } + + private ModelOfUnityEffect(final ModelOfUnityEffect effect) { + super(effect); + } + + @Override + public ModelOfUnityEffect copy() { + return new ModelOfUnityEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null && controller.chooseUse(outcome, "Scry 2?", source, game)) { + controller.scry(2, source, game); + } + Set playerIds = (Set) getValue("votedAgainst"); + for (UUID opponentId : game.getOpponents(source.getControllerId())) { + if (playerIds.contains(opponentId)) { + continue; + } + Player player = game.getPlayer(opponentId); + if (player != null && player.chooseUse(outcome, "Scry 2?", source, game)) { + player.loseLife(2, game, source, false); + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java b/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java index e7d556306d3..a34f5588350 100644 --- a/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java +++ b/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java @@ -152,6 +152,7 @@ public final class TalesOfMiddleEarthCommander extends ExpansionSet { cards.add(new SetCardInfo("Merry, Warden of Isengard", 61, Rarity.RARE, mage.cards.m.MerryWardenOfIsengard.class)); cards.add(new SetCardInfo("Minamo, School at Water's Edge", 369, Rarity.MYTHIC, mage.cards.m.MinamoSchoolAtWatersEdge.class)); cards.add(new SetCardInfo("Mind Stone", 282, Rarity.UNCOMMON, mage.cards.m.MindStone.class)); + cards.add(new SetCardInfo("Model of Unity", 78, Rarity.RARE, mage.cards.m.ModelOfUnity.class)); cards.add(new SetCardInfo("Mortify", 269, Rarity.UNCOMMON, mage.cards.m.Mortify.class)); cards.add(new SetCardInfo("Mouth of Ronom", 370, Rarity.MYTHIC, mage.cards.m.MouthOfRonom.class)); cards.add(new SetCardInfo("Murmuring Bosk", 320, Rarity.RARE, mage.cards.m.MurmuringBosk.class));