Permalink
Browse files

Fix land counting

  • Loading branch information...
dougmill committed Jan 31, 2019
1 parent 81bd19a commit 34995b44d32565abd5a73c73fedadf95e47a9364
Showing with 13 additions and 17 deletions.
  1. +13 −17 window_background/labels.js
@@ -69,14 +69,12 @@ function onLabelOutLogInfo(entry, json) {
currentDeck.mainDeck.forEach(card => {
cardCounts[card.id] = card.quantity;
deckSize += card.quantity;
if (card.quantity >= 2 && card.quantity <= 4) {
multiCardPositions[card.quantity][card.id] = [];
}
let cardObj = cardsDb.get(card.id);
if (cardObj) {
if (cardObj.type.includes("Land")) {
landsInDeck += card.quantity;
}
if (!cardObj.type.includes("Basic") && card.quantity >= 2 && card.quantity <= 4) {
multiCardPositions[card.quantity][card.id] = [];
}
if (cardObj && cardObj.type.includes("Land")) {
landsInDeck += card.quantity;
}
});
let librarySize = deckSize - handSize;
@@ -85,17 +83,15 @@ function onLabelOutLogInfo(entry, json) {
let libraryLands = [];
game.shuffledOrder.forEach((cardId, i) => {
let cardCount = cardCounts[cardId];
let card = cardsDb.get(cardId);
if (card) {
if (!card.type.includes("Basic") && cardCount >= 2 && cardCount <= 4) {
multiCardPositions[cardCount][cardId].push(i+1);
}
if (i >= handSize) {
if (card.type.includes("Land")) {
landsSoFar++;
}
libraryLands.push(landsSoFar);
if (cardCount >= 2 && cardCount <= 4) {
multiCardPositions[cardCount][cardId].push(i+1);
}
if (i >= handSize) {
let card = cardsDb.get(cardId);
if (card && card.type.includes("Land")) {
landsSoFar++;
}
libraryLands.push(landsSoFar);
}
});

0 comments on commit 34995b4

Please sign in to comment.