mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
build fix - maven doesn't like bloodclockeffect as public unless in its own file named bloodclockeffect
This commit is contained in:
parent
3f3229c43c
commit
c00dadcd4c
2 changed files with 48 additions and 2 deletions
|
@ -68,7 +68,7 @@ public class BloodClock extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
public class BloodClockEffect extends OneShotEffect {
|
||||
class BloodClockEffect extends OneShotEffect {
|
||||
|
||||
public BloodClockEffect() {
|
||||
super(Outcome.ReturnToHand);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue