mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
Added support for Lens of Clarity.
This commit is contained in:
@@ -8918,7 +8918,8 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
case Graveyard:
|
||||
case Stack:
|
||||
//cards in these zones are visible to all
|
||||
if (isFaceDown() && getController().isOpponentOf(viewer) && !hasKeyword("Your opponent may look at this card.")) {
|
||||
if (isFaceDown() && getController().isOpponentOf(viewer) && !hasKeyword("Your opponent may look at this card.")
|
||||
&& !isVisibleToWhileFaceDown(viewer)) { //Support Lens of Clarity
|
||||
break; //exception is face down cards controlled by opponents
|
||||
}
|
||||
return true;
|
||||
@@ -8965,6 +8966,10 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isVisibleToWhileFaceDown(final Player viewer) {
|
||||
return viewer != null && viewer.getAmountOfKeyword("CanSeeOpponentsFaceDownCards") > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* getConvertedManaCost.
|
||||
|
||||
@@ -194,8 +194,7 @@ public enum FControl implements KeyEventDispatcher {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** After view and model have been initialized, control can start.
|
||||
* @param isHeadlessMode */
|
||||
/** After view and model have been initialized, control can start.*/
|
||||
public void initialize() {
|
||||
// Preloads skin components (using progress bar).
|
||||
FSkin.loadFull(true);
|
||||
@@ -373,6 +372,10 @@ public enum FControl implements KeyEventDispatcher {
|
||||
return game == null || !gameHasHumanPlayer || ForgePreferences.DEV_MODE || c.canBeShownTo(getCurrentPlayer());
|
||||
}
|
||||
|
||||
public boolean maySeeFaceDownCard(Card c) {
|
||||
return game == null || !gameHasHumanPlayer || ForgePreferences.DEV_MODE || c.isVisibleToWhileFaceDown(getCurrentPlayer());
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Write javadoc for this method.
|
||||
* @return
|
||||
|
||||
@@ -177,10 +177,10 @@ public class CardDetailPanel extends SkinnedPanel {
|
||||
|
||||
boolean canShowThis = false;
|
||||
|
||||
if (card.isFaceDown()) {
|
||||
if (card.isFaceDown() && !Singletons.getControl().maySeeFaceDownCard(card)) {
|
||||
if (card.isInZone(ZoneType.Battlefield)) {
|
||||
this.nameCostLabel.setText("???");
|
||||
this.typeLabel.setText("Creature");
|
||||
this.nameCostLabel.setText("???");
|
||||
this.typeLabel.setText("Creature");
|
||||
}
|
||||
}
|
||||
else if (Singletons.getControl().mayShowCard(card) || FDialog.isModalOpen()) { //allow showing cards while modal open to account for revealing, picking, and ordering cards
|
||||
|
||||
Reference in New Issue
Block a user