mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
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:
@@ -1,5 +1,6 @@
|
|||||||
package forge.game.mulligan;
|
package forge.game.mulligan;
|
||||||
|
|
||||||
|
import forge.game.card.Card;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
|
|
||||||
public class LondonMulligan extends AbstractMulligan {
|
public class LondonMulligan extends AbstractMulligan {
|
||||||
@@ -17,6 +18,16 @@ public class LondonMulligan extends AbstractMulligan {
|
|||||||
return player.getMaxHandSize();
|
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
|
@Override
|
||||||
public int tuckCardsAfterKeepHand() {
|
public int tuckCardsAfterKeepHand() {
|
||||||
if (timesMulliganed == 0) {
|
if (timesMulliganed == 0) {
|
||||||
@@ -26,11 +37,4 @@ public class LondonMulligan extends AbstractMulligan {
|
|||||||
int extraCard = firstMulliganFree ? 1 : 0;
|
int extraCard = firstMulliganFree ? 1 : 0;
|
||||||
return timesMulliganed - extraCard;
|
return timesMulliganed - extraCard;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void afterMulligan() {
|
|
||||||
int tuckingCards = tuckCardsAfterKeepHand();
|
|
||||||
player.getController().londonMulliganReturnCards(player, tuckingCards);
|
|
||||||
super.afterMulligan();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ lblIsGoingFirst=is going first
|
|||||||
lblYouAreGoing=you are going
|
lblYouAreGoing=you are going
|
||||||
lblMulligan=Mulligan
|
lblMulligan=Mulligan
|
||||||
lblDoYouWantToKeepYourHand=Do you want to keep your hand?
|
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
|
lblOk=Ok
|
||||||
lblReset=Reset
|
lblReset=Reset
|
||||||
lblAuto=Auto
|
lblAuto=Auto
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public class InputLondonMulligan extends InputSyncronizedBase {
|
|||||||
|
|
||||||
getController().getGui().updateButtons(getOwner(), localizer.getMessage("lblOk"), "", cardsLeft == 0, false, true);
|
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());
|
showMessage(sb.toString());
|
||||||
}
|
}
|
||||||
@@ -90,6 +90,12 @@ public class InputLondonMulligan extends InputSyncronizedBase {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (selected.contains(c0)) {
|
||||||
|
selected.remove(c0);
|
||||||
|
} else {
|
||||||
|
selected.add(c0);
|
||||||
|
}
|
||||||
|
showMessage();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user