From 1d21b1e10c67435525f9831590013c7238893bdf Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Tue, 7 Sep 2021 23:22:39 -0400 Subject: [PATCH] Only add 'faction2_code' if the card has a second class --- strange_eons_to_arkhamdb.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/strange_eons_to_arkhamdb.js b/strange_eons_to_arkhamdb.js index e99ee79..11f2448 100644 --- a/strange_eons_to_arkhamdb.js +++ b/strange_eons_to_arkhamdb.js @@ -54,7 +54,6 @@ var card_data = { // TODO: could be derived? deck_limit: 2, faction_code: String(Component.settings.get('CardClass')).toLowerCase(), - faction2_code: String(Component.settings.get('CardClass2')).toLowerCase(), flavor: String(Component.settings.get('Flavor')), health: parseInt(Component.settings.get('Stamina')) || null, illustrator: String(Component.settings.get('Artist')), @@ -77,6 +76,10 @@ var card_data = { will: skills["Willpower"], }; +if (Component.settings.get('CardClass2') != 'None') { + card_data.faction2_code = String(Component.settings.get('CardClass2')).toLowerCase(); +} + if (card_types[Component.getFrontTemplateKey()] == 'enemy') { // TODO: "weakness" or "basicweakness" card_data.subtype_code = "basicweakness";