Added support for Lens of Clarity.

This commit is contained in:
Krazy
2014-09-13 22:56:30 +00:00
parent 23fc246ea5
commit 20ef2a9d27
3 changed files with 14 additions and 6 deletions

View File

@@ -8918,7 +8918,8 @@ public class Card extends GameEntity implements Comparable<Card> {
case Graveyard: case Graveyard:
case Stack: case Stack:
//cards in these zones are visible to all //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 break; //exception is face down cards controlled by opponents
} }
return true; return true;
@@ -8965,6 +8966,10 @@ public class Card extends GameEntity implements Comparable<Card> {
return false; return false;
} }
public boolean isVisibleToWhileFaceDown(final Player viewer) {
return viewer != null && viewer.getAmountOfKeyword("CanSeeOpponentsFaceDownCards") > 0;
}
/** /**
* <p> * <p>
* getConvertedManaCost. * getConvertedManaCost.

View File

@@ -194,8 +194,7 @@ public enum FControl implements KeyEventDispatcher {
return true; return true;
} }
/** After view and model have been initialized, control can start. /** After view and model have been initialized, control can start.*/
* @param isHeadlessMode */
public void initialize() { public void initialize() {
// Preloads skin components (using progress bar). // Preloads skin components (using progress bar).
FSkin.loadFull(true); FSkin.loadFull(true);
@@ -373,6 +372,10 @@ public enum FControl implements KeyEventDispatcher {
return game == null || !gameHasHumanPlayer || ForgePreferences.DEV_MODE || c.canBeShownTo(getCurrentPlayer()); 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. * TODO: Write javadoc for this method.
* @return * @return

View File

@@ -177,7 +177,7 @@ public class CardDetailPanel extends SkinnedPanel {
boolean canShowThis = false; boolean canShowThis = false;
if (card.isFaceDown()) { if (card.isFaceDown() && !Singletons.getControl().maySeeFaceDownCard(card)) {
if (card.isInZone(ZoneType.Battlefield)) { if (card.isInZone(ZoneType.Battlefield)) {
this.nameCostLabel.setText("???"); this.nameCostLabel.setText("???");
this.typeLabel.setText("Creature"); this.typeLabel.setText("Creature");