mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Merge branch 'multiplayer-mulligan' into 'master'
Remove partial paris mulligan See merge request core-developers/forge!1273
This commit is contained in:
@@ -52,7 +52,6 @@ import forge.util.maps.HashMapOfLists;
|
|||||||
import forge.util.maps.MapOfLists;
|
import forge.util.maps.MapOfLists;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.Map.Entry;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Methods for common actions performed during a game.
|
* Methods for common actions performed during a game.
|
||||||
@@ -1674,12 +1673,8 @@ public class GameAction {
|
|||||||
|
|
||||||
// rule 103.4b
|
// rule 103.4b
|
||||||
boolean isMultiPlayer = game.getPlayers().size() > 2;
|
boolean isMultiPlayer = game.getPlayers().size() > 2;
|
||||||
int mulliganDelta = isMultiPlayer ? 0 : 1;
|
|
||||||
|
|
||||||
// https://magic.wizards.com/en/articles/archive/feature/checking-brawl-2018-07-09
|
// https://magic.wizards.com/en/articles/archive/feature/checking-brawl-2018-07-09
|
||||||
if (game.getRules().hasAppliedVariant(GameType.Brawl) && !isMultiPlayer){
|
int mulliganDelta = isMultiPlayer || game.getRules().hasAppliedVariant(GameType.Brawl) ? 0 : 1;
|
||||||
mulliganDelta = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean allKept;
|
boolean allKept;
|
||||||
do {
|
do {
|
||||||
@@ -1695,7 +1690,6 @@ public class GameAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (toMulligan != null && !toMulligan.isEmpty()) {
|
if (toMulligan != null && !toMulligan.isEmpty()) {
|
||||||
if (!isCommander) {
|
|
||||||
toMulligan = new CardCollection(p.getCardsIn(ZoneType.Hand));
|
toMulligan = new CardCollection(p.getCardsIn(ZoneType.Hand));
|
||||||
for (final Card c : toMulligan) {
|
for (final Card c : toMulligan) {
|
||||||
moveToLibrary(c, null, null);
|
moveToLibrary(c, null, null);
|
||||||
@@ -1707,20 +1701,6 @@ public class GameAction {
|
|||||||
}
|
}
|
||||||
p.shuffle(null);
|
p.shuffle(null);
|
||||||
p.drawCards(handSize[i] - mulliganDelta);
|
p.drawCards(handSize[i] - mulliganDelta);
|
||||||
} else {
|
|
||||||
List<Card> toExile = Lists.newArrayList(toMulligan);
|
|
||||||
for (Card c : toExile) {
|
|
||||||
exile(c, null, null);
|
|
||||||
}
|
|
||||||
exiledDuringMulligans.addAll(p, toExile);
|
|
||||||
try {
|
|
||||||
Thread.sleep(100); //delay for a tiny bit to give UI a chance catch up
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
p.drawCards(toExile.size() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
p.onMulliganned();
|
p.onMulliganned();
|
||||||
allKept = false;
|
allKept = false;
|
||||||
} else {
|
} else {
|
||||||
@@ -1731,17 +1711,6 @@ public class GameAction {
|
|||||||
mulliganDelta++;
|
mulliganDelta++;
|
||||||
} while (!allKept);
|
} while (!allKept);
|
||||||
|
|
||||||
if (isCommander) {
|
|
||||||
for (Entry<Player, Collection<Card>> kv : exiledDuringMulligans.entrySet()) {
|
|
||||||
Player p = kv.getKey();
|
|
||||||
Collection<Card> cc = kv.getValue();
|
|
||||||
for (Card c : cc) {
|
|
||||||
moveToLibrary(c, null, null);
|
|
||||||
}
|
|
||||||
p.shuffle(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Vancouver Mulligan
|
//Vancouver Mulligan
|
||||||
for(Player p : whoCanMulligan) {
|
for(Player p : whoCanMulligan) {
|
||||||
if (p.getStartingHandSize() > p.getZone(ZoneType.Hand).size()) {
|
if (p.getStartingHandSize() > p.getZone(ZoneType.Hand).size()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user