From c00dadcd4ca414c7160cf9a27538f510ee7a3492 Mon Sep 17 00:00:00 2001 From: drmDev Date: Fri, 29 Jul 2016 03:46:43 -0400 Subject: [PATCH] build fix - maven doesn't like bloodclockeffect as public unless in its own file named bloodclockeffect --- .../sets/saviorsofkamigawa/BloodClock.java | 2 +- .../src/mage/sets/urzassaga/Umbilicus.java | 48 ++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/BloodClock.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/BloodClock.java index 9b8f682e9e..1d3c52c454 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/BloodClock.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/BloodClock.java @@ -68,7 +68,7 @@ public class BloodClock extends CardImpl { } } -public class BloodClockEffect extends OneShotEffect { +class BloodClockEffect extends OneShotEffect { public BloodClockEffect() { super(Outcome.ReturnToHand); diff --git a/Mage.Sets/src/mage/sets/urzassaga/Umbilicus.java b/Mage.Sets/src/mage/sets/urzassaga/Umbilicus.java index e692e4d83c..c77aa96e89 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Umbilicus.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Umbilicus.java @@ -30,12 +30,18 @@ package mage.sets.urzassaga; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; -import mage.sets.saviorsofkamigawa.BloodClockEffect; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetControlledPermanent; /** * @@ -61,3 +67,43 @@ public class Umbilicus extends CardImpl { return new Umbilicus(this); } } + +class BloodClockEffect extends OneShotEffect { + + public BloodClockEffect() { + super(Outcome.ReturnToHand); + this.staticText = "that player returns a permanent he or she controls to its owner's hand unless he or she pays 2 life"; + } + + public BloodClockEffect(final BloodClockEffect effect) { + super(effect); + } + + @Override + public BloodClockEffect copy() { + return new BloodClockEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + if (player == null) { + return false; + } + if (player.getLife() > 2 && player.chooseUse(Outcome.Neutral, "Pay 2 life? If you don't, return a permanent you control to its owner's hand.", source, game)) { + player.loseLife(2, game); + game.informPlayers(player.getLogName() + " pays 2 life. He will not return a permanent he or she controls."); + return true; + } else { + Target target = new TargetControlledPermanent(); + if (target.canChoose(source.getSourceId(), player.getId(), game) && player.chooseTarget(outcome, target, source, game)) { + Permanent permanent = game.getPermanent(target.getFirstTarget()); + if (permanent != null) { + game.informPlayers(player.getLogName() + " returns " + permanent.getName() + " to hand."); + return permanent.moveToZone(Zone.HAND, source.getSourceId(), game, false); + } + } + } + return false; + } +} \ No newline at end of file