diff --git a/src/magic/model/MagicPlayer.java b/src/magic/model/MagicPlayer.java index aaab9b1009..78d1a4a81e 100644 --- a/src/magic/model/MagicPlayer.java +++ b/src/magic/model/MagicPlayer.java @@ -106,7 +106,7 @@ public class MagicPlayer implements MagicTarget { extraTurns, attackers, blockers, - hand.size(), + hand.getCardsId(), library.size(), graveyard.getCardsId(), exile.getCardsId(), diff --git a/src/magic/model/choice/MagicPlayChoice.java b/src/magic/model/choice/MagicPlayChoice.java index 712533a5da..db9d7881a6 100644 --- a/src/magic/model/choice/MagicPlayChoice.java +++ b/src/magic/model/choice/MagicPlayChoice.java @@ -53,34 +53,30 @@ public class MagicPlayChoice extends MagicChoice { // Pass is first choice when scores are equal. options.add(MagicPlayChoiceResult.PASS); + + // add rest of the options + addValidChoices(game, player, true, options); + return options; + } + + private void addValidChoices( + final MagicGame game, + final MagicPlayer player, + final boolean useHints, + final Collection validChoices) { + final MagicActivationMap activationMap=player.getActivationMap(); for (final MagicActivation activation : activationMap.getActivations()) { final Set sources=activationMap.get(activation); for (final MagicSource activationSource : sources) { - if (activation.canPlay(game,player,activationSource,true)) { - options.add(new MagicPlayChoiceResult(activationSource,activation)); + if (activation.canPlay(game,player,activationSource,useHints)) { + validChoices.add(activationSource); if (activation.getActivationHints().isIndependent()) { break; } } } } - - return options; - } - - private Set getValidChoices(final MagicGame game,final MagicPlayer player) { - final Set validChoices=new HashSet(); - final MagicActivationMap activationMap=player.getActivationMap(); - for (final MagicActivation activation : activationMap.getActivations()) { - final Set sources=activationMap.get(activation); - for (final MagicSource activationSource : sources) { - if (activation.canPlay(game,player,activationSource,false)) { - validChoices.add(activationSource); - } - } - } - return validChoices; } @Override @@ -119,8 +115,8 @@ public class MagicPlayChoice extends MagicChoice { } - final Set validChoices; - validChoices=getValidChoices(game,player); + final Set validChoices = new HashSet(); + addValidChoices(game, player, false, validChoices); if (validChoices.isEmpty() && game.canSkipSingleChoice()) { boolean skip = true;