Reveal foretold cards and other face-down cards when a player leaves the game or the game ends

This commit is contained in:
Alumi
2021-02-17 04:07:59 +00:00
committed by Michael Kamensky
parent 201f53fb09
commit 3ff19f7957
8 changed files with 39 additions and 0 deletions

View File

@@ -736,6 +736,17 @@ public class Game {
boolean planarControllerLost = false; boolean planarControllerLost = false;
boolean isMultiplayer = this.getPlayers().size() > 2; boolean isMultiplayer = this.getPlayers().size() > 2;
// 702.142f & 707.9
// If a player leaves the game, all face-down cards that player owns must be revealed to all players.
// At the end of each game, all face-down cards must be revealed to all players.
if (!isMultiplayer) {
for (Player pl : getPlayers()) {
pl.revealFaceDownCards();
}
} else {
p.revealFaceDownCards();
}
for(Card c : cards) { for(Card c : cards) {
if (c.getController().equals(p) && (c.isPlane() || c.isPhenomenon())) { if (c.getController().equals(p) && (c.isPlane() || c.isPhenomenon())) {
planarControllerLost = true; planarControllerLost = true;

View File

@@ -2839,6 +2839,10 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
return facedown; return facedown;
} }
public final boolean isRealFaceDown() {
return facedown;
}
public final void setFaceDown(boolean value) { public final void setFaceDown(boolean value) {
facedown = value; facedown = value;
} }

View File

@@ -3546,4 +3546,23 @@ public class Player extends GameEntity implements Comparable<Player> {
&& Iterables.any(landsControlled, Predicates.and(CardPredicates.isType("Urza's"), CardPredicates.isType("Power-Plant"))) && Iterables.any(landsControlled, Predicates.and(CardPredicates.isType("Urza's"), CardPredicates.isType("Power-Plant")))
&& Iterables.any(landsControlled, Predicates.and(CardPredicates.isType("Urza's"), CardPredicates.isType("Tower"))); && Iterables.any(landsControlled, Predicates.and(CardPredicates.isType("Urza's"), CardPredicates.isType("Tower")));
} }
public void revealFaceDownCards() {
final List<List<ZoneType>> revealZones = Arrays.asList(Arrays.asList(ZoneType.Battlefield, ZoneType.Merged), Arrays.asList(ZoneType.Exile));
final PlayerCollection otherPlayers = new PlayerCollection(game.getRegisteredPlayers());
otherPlayers.remove(this);
for (List<ZoneType> z : revealZones) {
CardCollection revealCards = new CardCollection();
for (Card c : game.getCardsInOwnedBy(z, this)) {
if (!c.isRealFaceDown()) continue;
Card lki = CardUtil.getLKICopy(c);
lki.forceTurnFaceUp();
lki.setZone(c.getZone());
revealCards.add(lki);
}
game.getAction().revealTo(revealCards, otherPlayers, Localizer.getInstance().getMessage("lblRevealFaceDownCards"));
}
}
} }

View File

@@ -2624,6 +2624,7 @@ lblDetectedInvalidHostAddress=Ungültige Host-Adresse ({0}) wurde festgestellt.
#Player.java #Player.java
lblChooseACompanion=Wähle einen Gefährten lblChooseACompanion=Wähle einen Gefährten
lblChooseAColorFor=Wähle eine Farbe für {0} lblChooseAColorFor=Wähle eine Farbe für {0}
lblRevealFaceDownCards=Revealing face-down cards from
#QuestPreferences.java #QuestPreferences.java
lblWildOpponentNumberError=Anzahl der Wild-Gegner kann nur 0 bis 3 sein lblWildOpponentNumberError=Anzahl der Wild-Gegner kann nur 0 bis 3 sein
#GauntletWinLose.java #GauntletWinLose.java

View File

@@ -2624,6 +2624,7 @@ lblDetectedInvalidHostAddress=Invalid host address ({0}) was detected.
#Player.java #Player.java
lblChooseACompanion=Choose a companion lblChooseACompanion=Choose a companion
lblChooseAColorFor=Choose a color for {0} lblChooseAColorFor=Choose a color for {0}
lblRevealFaceDownCards=Revealing face-down cards from
#QuestPreferences.java #QuestPreferences.java
lblWildOpponentNumberError=Wild Opponents can only be 0 to 3 lblWildOpponentNumberError=Wild Opponents can only be 0 to 3
#GauntletWinLose.java #GauntletWinLose.java

View File

@@ -2624,6 +2624,7 @@ lblDetectedInvalidHostAddress=Se detectó una dirección de host no válida ({0}
#Player.java #Player.java
lblChooseACompanion=Elige un compañero lblChooseACompanion=Elige un compañero
lblChooseAColorFor=Elige un color para {0} lblChooseAColorFor=Elige un color para {0}
lblRevealFaceDownCards=Revealing face-down cards from
#QuestPreferences.java #QuestPreferences.java
lblWildOpponentNumberError=Los Oponentes Salvajes sólo pueden ser de 0 a 3 lblWildOpponentNumberError=Los Oponentes Salvajes sólo pueden ser de 0 a 3
#GauntletWinLose.java #GauntletWinLose.java

View File

@@ -2624,6 +2624,7 @@ lblDetectedInvalidHostAddress=Invalid host address ({0}) was detected.
#Player.java #Player.java
lblChooseACompanion=Choose a companion lblChooseACompanion=Choose a companion
lblChooseAColorFor=Choose a color for {0} lblChooseAColorFor=Choose a color for {0}
lblRevealFaceDownCards=Revealing face-down cards from
#QuestPreferences.java #QuestPreferences.java
lblWildOpponentNumberError=Wild Opponents can only be 0 to 3 lblWildOpponentNumberError=Wild Opponents can only be 0 to 3
#GauntletWinLose.java #GauntletWinLose.java

View File

@@ -2624,6 +2624,7 @@ lblDetectedInvalidHostAddress=检测到无效的主机地址({0})。
#Player.java #Player.java
lblChooseACompanion=选择一个行侣 lblChooseACompanion=选择一个行侣
lblChooseAColorFor=为{0}选择一个颜色 lblChooseAColorFor=为{0}选择一个颜色
lblRevealFaceDownCards=Revealing face-down cards from
#QuestPreferences.java #QuestPreferences.java
lblWildOpponentNumberError=野外对手数只能在0-3之间 lblWildOpponentNumberError=野外对手数只能在0-3之间
#GauntletWinLose.java #GauntletWinLose.java