Sold basic lands that could have been added through "Add basic land" will not be removed from decks.

This commit is contained in:
Seravy
2018-03-04 23:36:48 +01:00
parent 7ff8564077
commit 83bae5ad74
2 changed files with 20 additions and 0 deletions

View File

@@ -121,6 +121,7 @@ public final class PaperCard implements Comparable<IPaperCard>, InventoryItemFro
} }
}; };
public PaperCard(final CardRules rules0, final String edition0, final CardRarity rarity0, final int artIndex0) { public PaperCard(final CardRules rules0, final String edition0, final CardRarity rarity0, final int artIndex0) {
this(rules0, edition0, rarity0, artIndex0, false); this(rules0, edition0, rarity0, artIndex0, false);
} }
@@ -228,4 +229,16 @@ public final class PaperCard implements Comparable<IPaperCard>, InventoryItemFro
} }
return imageKey; return imageKey;
} }
// Return true if card is one of the five basic lands that can be added for free
public boolean isVeryBasicLand() {
if ((this.getName().equals("Swamp"))
|| (this.getName().equals("Plains"))
|| (this.getName().equals("Island"))
|| (this.getName().equals("Forest"))
|| (this.getName().equals("Mountain"))) {
return true;
} else return false;
}
} }

View File

@@ -415,6 +415,13 @@ public final class QuestUtilCards {
final int leftInPool = questAssets.getCardPool().count(card); final int leftInPool = questAssets.getCardPool().count(card);
// If card is a nonfoil basic land of the "free" kind, do not remove from the deck
// but pretend as if it was added through "Add Basic Land".
if ((!card.isFoil())
&& (card.isVeryBasicLand())) {
return;
}
// remove sold cards from all decks: // remove sold cards from all decks:
for (final Deck deck : questController.getMyDecks()) { for (final Deck deck : questController.getMyDecks()) {