Merge branch 'london-mulligan-feature-flag' into 'master'

Fix LondonMulligan not actually working

See merge request core-developers/forge!1825
This commit is contained in:
Michael Kamensky
2019-06-11 04:02:05 +00:00
3 changed files with 19 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
package forge.game.mulligan;
import forge.game.card.Card;
import forge.game.player.Player;
public class LondonMulligan extends AbstractMulligan {
@@ -17,6 +18,16 @@ public class LondonMulligan extends AbstractMulligan {
return player.getMaxHandSize();
}
@Override
public void mulliganDraw() {
player.drawCards(handSizeAfterNextMulligan());
int tuckingCards = tuckCardsAfterKeepHand();
for (final Card c : player.getController().londonMulliganReturnCards(player, tuckingCards)) {
player.getGame().getAction().moveToLibrary(c, -1, null);
}
}
@Override
public int tuckCardsAfterKeepHand() {
if (timesMulliganed == 0) {
@@ -26,11 +37,4 @@ public class LondonMulligan extends AbstractMulligan {
int extraCard = firstMulliganFree ? 1 : 0;
return timesMulliganed - extraCard;
}
@Override
public void afterMulligan() {
int tuckingCards = tuckCardsAfterKeepHand();
player.getController().londonMulliganReturnCards(player, tuckingCards);
super.afterMulligan();
}
}

View File

@@ -283,7 +283,7 @@ lblIsGoingFirst=is going first
lblYouAreGoing=you are going
lblMulligan=Mulligan
lblDoYouWantToKeepYourHand=Do you want to keep your hand?
lblReturnForLondon=Return %n card(s) to bottom of library
lblReturnForLondon=Return %s of %s card(s) to bottom of library
lblOk=Ok
lblReset=Reset
lblAuto=Auto

View File

@@ -60,7 +60,7 @@ public class InputLondonMulligan extends InputSyncronizedBase {
getController().getGui().updateButtons(getOwner(), localizer.getMessage("lblOk"), "", cardsLeft == 0, false, true);
sb.append(String.format(localizer.getMessage("lblReturnForLondon"), cardsLeft));
sb.append(String.format(localizer.getMessage("lblReturnForLondon"), selected.size(), toReturn));
showMessage(sb.toString());
}
@@ -90,6 +90,12 @@ public class InputLondonMulligan extends InputSyncronizedBase {
return false;
}
if (selected.contains(c0)) {
selected.remove(c0);
} else {
selected.add(c0);
}
showMessage();
return true;
}