Fixed Zur's Weirdling.
@@ -31,6 +31,7 @@ import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
+import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.continuous.PlayWithHandRevealedEffect;
import mage.cards.Card;
@@ -95,44 +96,50 @@ class ZursWeirdingReplacementEffect extends ReplacementEffectImpl {
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
+ return true;
+ }
+
+ @Override
+ public boolean checksEventType(GameEvent event, Game game) {
+ return event.getType() == GameEvent.EventType.DRAW_CARD;
+ }
+
+ @Override
+ public boolean applies(GameEvent event, Ability source, Game game) {
+ boolean paid = false;
Player player = game.getPlayer(event.getTargetId());
MageObject sourceObject = source.getSourceObject(game);
- if (player != null && sourceObject != null) {
+ if (player != null
+ && sourceObject != null) {
Card card = player.getLibrary().getFromTop(game);
if (card != null) {
- // reveals it instead
+ // Reveals it instead
player.revealCards(sourceObject.getIdName() + " next draw of " + player.getName() + " (" + game.getTurnNum() + '|' + game.getPhase().getType() + ')', new CardsImpl(card), game);
// Then any other player may pay 2 life. If a player does, put that card into its owner's graveyard
- String message = "Pay 2 life to put " + card.getLogName() + " into graveyard?";
+ String message = "Pay 2 life to put " + card.getLogName() + " into " + player.getLogName() + " graveyard?";
+
for (UUID playerId : game.getState().getPlayersInRange(player.getId(), game)) {
if (playerId.equals(player.getId())) {
continue;
}
Player otherPlayer = game.getPlayer(playerId);
if (otherPlayer.canPayLifeCost()
- && otherPlayer.getLife() >= 2
+ && otherPlayer.getLife() >= 2) {
+ PayLifeCost lifeCost = new PayLifeCost(2);
+ while (otherPlayer.canRespond()
+ && !paid
&& otherPlayer.chooseUse(Outcome.Benefit, message, source, game)) {
- otherPlayer.loseLife(2, game, false);
+ paid = lifeCost.pay(source, game, source.getSourceId(), otherPlayer.getId(), false, null);
+ }
+ if (paid) {
player.moveCards(card, Zone.GRAVEYARD, source, game);
- break;
+ return true;
}
}
-
}
- return true;
- }
- return false;
}
-
- @Override
- public boolean checksEventType(GameEvent event, Game game) {
- return event.getType() == GameEvent.EventType.DRAW_CARD;
}
-
- @Override
- public boolean applies(GameEvent event, Ability source, Game game) {
- return true;
+ return false;
}
-
}
