@cfvdb/core
Advanced tools
Comparing version 1.1.2 to 1.2.0
@@ -11,10 +11,25 @@ | ||
function getCardType(cardData) { | ||
if (cardData.card_trigger && cardData.card_trigger.trim() !== '-') { | ||
return 'trigger'; | ||
} else if (cardData.text.toLowerCase().includes('cannot be put in a deck') && cardData.text.toLowerCase().includes('token')) { | ||
return 'token'; | ||
} else if (cardData.tribe.toLowerCase().includes('normal order') || cardData.tribe.toLowerCase().includes('blitz order')) { | ||
return 'order'; | ||
let result; | ||
if (cardData.type) { | ||
if (cardData.type === 'normal-unit') { | ||
result = 'normal'; | ||
} else if (cardData.type === 'trigger-unit') { | ||
result = 'trigger'; | ||
} else if (cardData.type === 'normal-order' || cardData.type === 'blitz-order') { | ||
result = 'order'; | ||
} | ||
} | ||
if (!result) { | ||
if (cardData.card_trigger && cardData.card_trigger.trim() !== '-') { | ||
return 'trigger'; | ||
} else if (cardData.text && cardData.text.toLowerCase().includes('cannot be put in a deck') && cardData.text.toLowerCase().includes('token')) { | ||
return 'token'; | ||
} else if (cardData.tribe && cardData.tribe.toLowerCase().includes('normal order') || cardData.tribe.toLowerCase().includes('blitz order')) { | ||
return 'order'; | ||
} else { | ||
return 'normal'; | ||
} | ||
} else { | ||
return 'normal'; | ||
return result; | ||
} | ||
@@ -44,3 +59,3 @@ } | ||
if (card.starter) { | ||
if (card.starter || card.partOfRideDeck) { | ||
tempCount --; | ||
@@ -47,0 +62,0 @@ } |
{ | ||
"name": "@cfvdb/core", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"description": "Core functions for CFVDB", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
27626
545