Skip to content
Permalink
Browse files

fix the wildcards fix (#735)

  • Loading branch information
Manuel-777 committed Nov 18, 2019
1 parent 97f7d44 commit c841e62988b767b592d394069340b504aab59db5
@@ -279,10 +279,7 @@ function WildcardsNeeded(props: WildcardsNeededProps): JSX.Element {
function MissingCardSprite(props:MissingCardsProps):JSX.Element{
const{missing, cardRarity, listStyle, ww} = props;

//serious hack
const cr = _.upperFirst(cardRarity) as Rarity;

const xoff = CARD_RARITIES.indexOf(cr) * -24;
const xoff = CARD_RARITIES.indexOf(cardRarity) * -24;
const yoff = missing * -24;

var className = "not_owned_sprite";
@@ -718,7 +718,7 @@ export const CARD_TYPES = [
"Planeswalkers"
] as const;

export const CARD_RARITIES = ["Common", "Uncommon", "Rare", "Mythic", "Land"] as const;
export const CARD_RARITIES = ["common", "uncommon", "rare", "mythic", "land"] as const;

export const MANA_COLORS = [
"#E7CA8E",
@@ -848,7 +848,7 @@ function openSetStats(setStats, setName) {
cell.style.gridArea = `1 / ${color * 5 + 1} / auto / ${color * 5 + 6}`;
table.appendChild(cell);

CARD_RARITIES.filter(rarity => rarity !== "Land").forEach(rarity => {
CARD_RARITIES.filter(rarity => rarity !== "land").forEach(rarity => {
var rarityIndex = CARD_RARITIES.indexOf(rarity);
rarity = rarity.toLowerCase();
let cell = createDiv(["completion_table_rarity_title", rarity]);
@@ -889,7 +889,7 @@ function openSetStats(setStats, setName) {

let wanted = {};
let missing = {};
CARD_RARITIES.filter(rarity => rarity !== "Land").forEach(rarity => {
CARD_RARITIES.filter(rarity => rarity !== "land").forEach(rarity => {
rarity = rarity.toLowerCase();
const countStats = setStats[rarity];
if (countStats.total > 0) {
@@ -209,7 +209,7 @@ function deckStatsSection(deck) {
const boosterCost = getBoosterCountEstimate(missingWildcards);
const costSection = createDiv(["wildcards_cost"]);
costSection.appendChild(createSpan([], "Wildcards you have/need"));
CARD_RARITIES.filter(rarity => rarity !== "Land").forEach(cardRarity => {
CARD_RARITIES.filter(rarity => rarity !== "land").forEach(cardRarity => {
cardRarity = cardRarity.toLowerCase();
const wcText =
(ownedWildcards[cardRarity] > 0
@@ -179,7 +179,7 @@ export function openDecksTab(_filters = {}, scrollTop = 0) {
let wc;
let n = 0;
let boosterCost = getBoosterCountEstimate(missingWildcards);
CARD_RARITIES.filter(rarity => rarity !== "Land").forEach(cardRarity => {
CARD_RARITIES.filter(rarity => rarity !== "land").forEach(cardRarity => {
cardRarity = cardRarity.toLowerCase();
if (missingWildcards[cardRarity]) {
n++;
@@ -564,7 +564,7 @@ function deckLoad(_deck, index) {
let wc;
let n = 0;
let boosterCost = getBoosterCountEstimate(_deck.wildcards);
CARD_RARITIES.filter(r => r !== "Land").forEach(rarity => {
CARD_RARITIES.filter(r => r !== "land").forEach(rarity => {
rarity = rarity.toLowerCase();
const key = rarity[0];
if (_deck.wildcards.hasOwnProperty(key) && _deck.wildcards[key] > 0) {

0 comments on commit c841e62

Please sign in to comment.
You can’t perform that action at this time.