*Fixed enabling/disabling of buttons in partial paris mulligan.

This commit is contained in:
Hellfish
2013-04-02 19:27:51 +00:00
parent f760d39e7e
commit 02cff88cf9
2 changed files with 25 additions and 17 deletions

View File

@@ -21,6 +21,7 @@ import java.util.Stack;
import forge.Singletons;
import forge.game.GameState;
import forge.game.GameType;
import forge.game.phase.PhaseHandler;
import forge.game.phase.PhaseType;
import forge.game.player.Player;
@@ -117,8 +118,14 @@ public class InputControl extends MyObservable implements java.io.Serializable {
public final Input getActualInput(GameState game) {
if ( !game.hasMulliganned() )
{
return new InputMulligan(Singletons.getModel().getMatch(), Singletons.getControl().getPlayer());
//return new InputPartialParisMulligan(Singletons.getModel().getMatch(), Singletons.getControl().getPlayer());
if(game.getType() == GameType.Commander)
{
return new InputPartialParisMulligan(Singletons.getModel().getMatch(), Singletons.getControl().getPlayer());
}
else
{
return new InputMulligan(Singletons.getModel().getMatch(), Singletons.getControl().getPlayer());
}
}
final PhaseHandler handler = game.getPhaseHandler();
final PhaseType phase = handler.getPhase();

View File

@@ -204,26 +204,27 @@ public class InputPartialParisMulligan extends InputBase {
{
lastExiled.remove(c0);
c0.setUsedToPay(false);
return;
}
Zone z0 = match.getCurrentGame().getZoneOf(c0);
if (c0.getName().equals("Serum Powder") && z0.is(ZoneType.Hand)) {
if (GuiDialog.confirm(c0, "Use " + c0.getName() + "'s ability?")) {
List<Card> hand = new ArrayList<Card>(c0.getController().getCardsIn(ZoneType.Hand));
for (Card c : hand) {
match.getCurrentGame().getAction().exile(c);
else
{
Zone z0 = match.getCurrentGame().getZoneOf(c0);
if (c0.getName().equals("Serum Powder") && z0.is(ZoneType.Hand)) {
if (GuiDialog.confirm(c0, "Use " + c0.getName() + "'s ability?")) {
List<Card> hand = new ArrayList<Card>(c0.getController().getCardsIn(ZoneType.Hand));
for (Card c : hand) {
match.getCurrentGame().getAction().exile(c);
}
c0.getController().drawCards(hand.size());
}
c0.getController().drawCards(hand.size());
}
else
{
else
{
lastExiled.add(c0);
c0.setUsedToPay(true);
}
} else {
lastExiled.add(c0);
c0.setUsedToPay(true);
}
} else {
lastExiled.add(c0);
c0.setUsedToPay(true);
}
if(lastExiled.size() > 0)