Little fixes

This commit is contained in:
Oleg Agafonov 2020-01-16 17:11:19 +04:00
parent caa328c38c
commit a31da48084
3 changed files with 12 additions and 12 deletions

View file

@ -62,7 +62,6 @@ import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import static org.mage.test.serverside.base.impl.CardTestPlayerAPIImpl.*;
@ -2035,7 +2034,7 @@ public class TestPlayer implements Player {
Assert.fail(message);
}
this.chooseStrictModeFailed("target", game,getInfo(source, game) + "\n" + getInfo(target));
this.chooseStrictModeFailed("target", game, getInfo(source, game) + "\n" + getInfo(target));
return computerPlayer.chooseTarget(outcome, target, source, game);
}
@ -2128,7 +2127,8 @@ public class TestPlayer implements Player {
}
}
this.chooseStrictModeFailed("choice", game, getInfo(ability, game) + "; " + message);
this.chooseStrictModeFailed("choice", game, getInfo(ability, game)
+ "\nMessage: " + message);
return computerPlayer.announceXMana(min, max, multiplier, message, game, ability);
}
@ -2142,7 +2142,8 @@ public class TestPlayer implements Player {
}
}
this.chooseStrictModeFailed("choice", game, getInfo(ability, game) + "; " + message);
this.chooseStrictModeFailed("choice", game, getInfo(ability, game)
+ "\nMessage: " + message);
return computerPlayer.announceXCost(min, max, message, game, ability, null);
}

View file

@ -1,7 +1,5 @@
package mage.abilities.effects.common;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
@ -13,8 +11,9 @@ import mage.players.Player;
import mage.target.common.TargetCardInYourGraveyard;
import mage.util.CardUtil;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public class ExileCardFromOwnGraveyardControllerEffect extends OneShotEffect {
@ -39,10 +38,10 @@ public class ExileCardFromOwnGraveyardControllerEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if(player != null){
if (player != null) {
TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(Math.min(amount, player.getGraveyard().size()), new FilterCard());
if (player.chooseTarget(outcome, target, source, game)) {
for (UUID targetId: target.getTargets()) {
for (UUID targetId : target.getTargets()) {
Card card = player.getGraveyard().get(targetId, game);
if (card != null) {
card.moveToZone(Zone.EXILED, source.getSourceId(), game, false);
@ -57,9 +56,9 @@ public class ExileCardFromOwnGraveyardControllerEffect extends OneShotEffect {
private String setText() {
StringBuilder sb = new StringBuilder("exile ");
if (amount == 1) {
sb.append(" a card ");
sb.append("a card ");
} else {
sb.append(CardUtil.numberToText(amount)). append(" cards ");
sb.append(CardUtil.numberToText(amount)).append(" cards ");
}
sb.append("from your graveyard");
return sb.toString();

View file

@ -165,7 +165,7 @@ public final class ZonesHandler {
game.getPermanentsEntering().remove(permanent.getId());
break;
default:
throw new UnsupportedOperationException("to Zone" + toZone.toString() + " not supported yet");
throw new UnsupportedOperationException("to Zone " + toZone.toString() + " not supported yet");
}
}
game.setZone(event.getTargetId(), event.getToZone());