Permalink
Browse files

Booster cost in deck details

  • Loading branch information...
Manuel-777 committed Dec 23, 2018
1 parent 188a275 commit 9bf731022d93d47777b8a6736f2a403a0f6e1672
Showing with 7 additions and 2 deletions.
  1. +6 −1 window_main/deck_details.js
  2. +1 −1 window_main/index.css
@@ -25,6 +25,7 @@ var orderedCardRarities = ['common', 'uncommon', 'rare', 'mythic'];
var orderedColorCodes = ['w', 'u', 'b', 'r', 'g', 'c'];
var orderedManaColors = ['#E7CA8E', '#AABEDF', '#A18E87', '#DD8263', '#B7C89E', '#E3E3E3'];
var currentOpenDeck = null;
let rarityBooster = {common: 3, uncommon: 3, rare: 6, mythic: 13};

function deckColorBar(deck) {
let deckColors = $('<div class="deck_top_colors" style="align-self: center;"></div>');
@@ -172,13 +173,17 @@ function deckStatsSection(deck, deck_type) {
// Deck crafting cost section
let missingWildcards = get_deck_missing(deck);
let costSection = $('<div class="wildcards_cost"><span>Wildcards Needed</span></div>');
let boosterCost = 0;
orderedCardRarities.forEach(cardRarity => {
let bp = rarityBooster[cardRarity] * missingWildcards[cardRarity];
if (bp > boosterCost) boosterCost = bp;
$(`<div title="${cardRarity}" class="wc_cost wc_${cardRarity}">
${missingWildcards[cardRarity]}</div>`)
.appendTo(costSection);
});
$(`<div title="Aproximate boosters" class="wc_cost wc_booster">${boosterCost}</div>`).appendTo(costSection);

costSection.appendTo(stats);

return stats;
}

@@ -969,11 +969,11 @@ a:hover {
background-image: url('../images/complete.png');
}


.wc_common { background-image: url('../images/wc_common.png'); }
.wc_uncommon { background-image: url('../images/wc_uncommon.png'); }
.wc_rare { background-image: url('../images/wc_rare.png'); }
.wc_mythic { background-image: url('../images/wc_mythic.png'); }
.wc_booster { background-image: url('../images/booster.png'); height: 34px; line-height: 34px; }

.inventory {
padding-left: 8px;

0 comments on commit 9bf7310

Please sign in to comment.