* Fixed that spells with target amount distribution did not fizzle if all their targets were illegal at resolution (e.g. Electrolyze).

This commit is contained in:
LevelX2 2014-07-12 19:31:57 +02:00
parent ff011f8ab8
commit b602be2b53
3 changed files with 7 additions and 2 deletions

View file

@ -1514,7 +1514,7 @@ public abstract class PlayerImpl implements Player, Serializable {
@Override @Override
public void idleTimeout(Game game) { public void idleTimeout(Game game) {
game.informPlayers(new StringBuilder(getName()).append(" has run out of time. Loosing the Match.").toString()); game.informPlayers(new StringBuilder(getName()).append(" was idle for too long. Loosing the Match.").toString());
quit = true; quit = true;
idleTimeout = true; idleTimeout = true;
this.concede(game); this.concede(game);

View file

@ -327,7 +327,7 @@ public abstract class TargetImpl implements Target {
@Override @Override
public boolean isLegal(Ability source, Game game) { public boolean isLegal(Ability source, Game game) {
//20101001 - 608.2b //20101001 - 608.2b
Set <UUID> illegalTargets = new HashSet<UUID>(); Set <UUID> illegalTargets = new HashSet<>();
int replacedTargets = 0; int replacedTargets = 0;
for (UUID targetId: targets.keySet()) { for (UUID targetId: targets.keySet()) {
Card card = game.getCard(targetId); Card card = game.getCard(targetId);

View file

@ -53,7 +53,12 @@ public class TargetCreatureOrPlayerAmount extends TargetAmount {
protected FilterCreatureOrPlayer filter; protected FilterCreatureOrPlayer filter;
public TargetCreatureOrPlayerAmount(int amount) { public TargetCreatureOrPlayerAmount(int amount) {
// 107.1c If a rule or ability instructs a player to choose any number, that player may choose
// any positive number or zero, unless something (such as damage or counters) is being divided
// or distributed among any number of players and/or objects. In that case, a nonzero number
// of players and/or objects must be chosen if possible.
this(new StaticValue(amount)); this(new StaticValue(amount));
this.minNumberOfTargets = 1;
} }
public TargetCreatureOrPlayerAmount(DynamicValue amount) { public TargetCreatureOrPlayerAmount(DynamicValue amount) {