From d19d35a3106e39d6cb60057c90885ad0a5755075 Mon Sep 17 00:00:00 2001 From: Buhallin Date: Thu, 17 Nov 2022 01:03:58 -0800 Subject: [PATCH] Refactor upgrade sheet handling in the deck loader - Split upgrade sheets to follow the slots/data pattern - Factor out methods to set selections on upgrade sheets - Factor out method to add Summoned Servitor minicard - Add type 'UpgradeSheet' to appropriate cards - Remove handleStartsInPlay() method and detect it as a default zone --- ...calDistillationUpgradeSheet.156166.gmnotes | 7 + ...emicalDistillationUpgradeSheet.156166.json | 2 +- ...omModificationsUpgradeSheet.4104bf.gmnotes | 7 + ...ustomModificationsUpgradeSheet.4104bf.json | 2 +- ...amningTestimonyUpgradeSheet.dc4a62.gmnotes | 7 + .../DamningTestimonyUpgradeSheet.dc4a62.json | 2 +- ...ricalHypothesisUpgradeSheet.0c46a7.gmnotes | 7 + ...mpiricalHypothesisUpgradeSheet.0c46a7.json | 2 +- ...endsinLowPlacesUpgradeSheet.9fb3b9.gmnotes | 7 + ...FriendsinLowPlacesUpgradeSheet.9fb3b9.json | 2 +- .../GrizzledUpgradeSheet.ef8f08.gmnotes | 7 + .../GrizzledUpgradeSheet.ef8f08.json | 2 +- .../HonedInstinctUpgradeSheet.ba0e34.gmnotes | 7 + .../HonedInstinctUpgradeSheet.ba0e34.json | 2 +- .../HuntersArmorUpgradeSheet.d2d01b.gmnotes | 7 + .../HuntersArmorUpgradeSheet.d2d01b.json | 2 +- ...sicalShotcasterUpgradeSheet.a4eec2.gmnotes | 7 + ...physicalShotcasterUpgradeSheet.a4eec2.json | 2 +- .../LivingLinkUpgradeSheet.19a05b.gmnotes | 7 + .../LivingLinkUpgradeSheet.19a05b.json | 2 +- .../MakeshiftTrapUpgradeSheet.64dfce.gmnotes | 7 + .../MakeshiftTrapUpgradeSheet.64dfce.json | 2 +- ...PocketMultiToolUpgradeSheet.d706e7.gmnotes | 7 + .../PocketMultiToolUpgradeSheet.d706e7.json | 2 +- .../PowerWordUpgradeSheet.0d9481.gmnotes | 7 + .../PowerWordUpgradeSheet.0d9481.json | 2 +- .../RolandBanks.f8cea5.json | 1 - .../RunicAxeUpgradeSheet.be427d.gmnotes | 7 + .../RunicAxeUpgradeSheet.be427d.json | 2 +- ...ummonedServitorUpgradeSheet.5397a6.gmnotes | 7 + .../SummonedServitorUpgradeSheet.5397a6.json | 2 +- .../TheRavenQuillUpgradeSheet.23b96a.gmnotes | 7 + .../TheRavenQuillUpgradeSheet.23b96a.json | 2 +- src/arkhamdb/DeckImporterMain.ttslua | 168 ++++++++++-------- 34 files changed, 224 insertions(+), 89 deletions(-) create mode 100644 objects/AllPlayerCards.15bb07/AlchemicalDistillationUpgradeSheet.156166.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/CustomModificationsUpgradeSheet.4104bf.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/DamningTestimonyUpgradeSheet.dc4a62.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/EmpiricalHypothesisUpgradeSheet.0c46a7.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/FriendsinLowPlacesUpgradeSheet.9fb3b9.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/GrizzledUpgradeSheet.ef8f08.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/HonedInstinctUpgradeSheet.ba0e34.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/HuntersArmorUpgradeSheet.d2d01b.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/HyperphysicalShotcasterUpgradeSheet.a4eec2.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/LivingLinkUpgradeSheet.19a05b.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/MakeshiftTrapUpgradeSheet.64dfce.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/PocketMultiToolUpgradeSheet.d706e7.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/PowerWordUpgradeSheet.0d9481.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/RunicAxeUpgradeSheet.be427d.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/SummonedServitorUpgradeSheet.5397a6.gmnotes create mode 100644 objects/AllPlayerCards.15bb07/TheRavenQuillUpgradeSheet.23b96a.gmnotes diff --git a/objects/AllPlayerCards.15bb07/AlchemicalDistillationUpgradeSheet.156166.gmnotes b/objects/AllPlayerCards.15bb07/AlchemicalDistillationUpgradeSheet.156166.gmnotes new file mode 100644 index 00000000..c3a2a358 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/AlchemicalDistillationUpgradeSheet.156166.gmnotes @@ -0,0 +1,7 @@ +{ + "id": "09040-c", + "type": "UpgradeSheet", + "traits": "", + "permanent": false, + "weakness": false +} diff --git a/objects/AllPlayerCards.15bb07/AlchemicalDistillationUpgradeSheet.156166.json b/objects/AllPlayerCards.15bb07/AlchemicalDistillationUpgradeSheet.156166.json index 6176b090..4e919fc1 100644 --- a/objects/AllPlayerCards.15bb07/AlchemicalDistillationUpgradeSheet.156166.json +++ b/objects/AllPlayerCards.15bb07/AlchemicalDistillationUpgradeSheet.156166.json @@ -24,7 +24,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"09040-c\",\n \"traits\": \"\",\n \"permanent\": false,\n \"weakness\": false\n}", + "GMNotes_path": "AllPlayerCards.15bb07/AlchemicalDistillationUpgradeSheet.156166.gmnotes", "GUID": "156166", "Grid": true, "GridProjection": false, diff --git a/objects/AllPlayerCards.15bb07/CustomModificationsUpgradeSheet.4104bf.gmnotes b/objects/AllPlayerCards.15bb07/CustomModificationsUpgradeSheet.4104bf.gmnotes new file mode 100644 index 00000000..cbb3de69 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/CustomModificationsUpgradeSheet.4104bf.gmnotes @@ -0,0 +1,7 @@ +{ + "id": "09023-c", + "type": "UpgradeSheet", + "traits": "", + "permanent": false, + "weakness": false +} diff --git a/objects/AllPlayerCards.15bb07/CustomModificationsUpgradeSheet.4104bf.json b/objects/AllPlayerCards.15bb07/CustomModificationsUpgradeSheet.4104bf.json index e4374c06..9564c75b 100644 --- a/objects/AllPlayerCards.15bb07/CustomModificationsUpgradeSheet.4104bf.json +++ b/objects/AllPlayerCards.15bb07/CustomModificationsUpgradeSheet.4104bf.json @@ -24,7 +24,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"09023-c\",\n \"traits\": \"\",\n \"permanent\": false,\n \"weakness\": false\n}", + "GMNotes_path": "AllPlayerCards.15bb07/CustomModificationsUpgradeSheet.4104bf.gmnotes", "GUID": "4104bf", "Grid": true, "GridProjection": false, diff --git a/objects/AllPlayerCards.15bb07/DamningTestimonyUpgradeSheet.dc4a62.gmnotes b/objects/AllPlayerCards.15bb07/DamningTestimonyUpgradeSheet.dc4a62.gmnotes new file mode 100644 index 00000000..02e86ee9 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/DamningTestimonyUpgradeSheet.dc4a62.gmnotes @@ -0,0 +1,7 @@ +{ + "id": "09059-c", + "type": "UpgradeSheet", + "traits": "", + "permanent": false, + "weakness": false +} diff --git a/objects/AllPlayerCards.15bb07/DamningTestimonyUpgradeSheet.dc4a62.json b/objects/AllPlayerCards.15bb07/DamningTestimonyUpgradeSheet.dc4a62.json index 03fc500f..3fbe553b 100644 --- a/objects/AllPlayerCards.15bb07/DamningTestimonyUpgradeSheet.dc4a62.json +++ b/objects/AllPlayerCards.15bb07/DamningTestimonyUpgradeSheet.dc4a62.json @@ -24,7 +24,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"09059-c\",\n \"traits\": \"\",\n \"permanent\": false,\n \"weakness\": false\n}", + "GMNotes_path": "AllPlayerCards.15bb07/DamningTestimonyUpgradeSheet.dc4a62.gmnotes", "GUID": "dc4a62", "Grid": true, "GridProjection": false, diff --git a/objects/AllPlayerCards.15bb07/EmpiricalHypothesisUpgradeSheet.0c46a7.gmnotes b/objects/AllPlayerCards.15bb07/EmpiricalHypothesisUpgradeSheet.0c46a7.gmnotes new file mode 100644 index 00000000..57a52642 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/EmpiricalHypothesisUpgradeSheet.0c46a7.gmnotes @@ -0,0 +1,7 @@ +{ + "id": "09041-c", + "type": "UpgradeSheet", + "traits": "", + "permanent": false, + "weakness": false +} diff --git a/objects/AllPlayerCards.15bb07/EmpiricalHypothesisUpgradeSheet.0c46a7.json b/objects/AllPlayerCards.15bb07/EmpiricalHypothesisUpgradeSheet.0c46a7.json index f7c068e7..26ea64a7 100644 --- a/objects/AllPlayerCards.15bb07/EmpiricalHypothesisUpgradeSheet.0c46a7.json +++ b/objects/AllPlayerCards.15bb07/EmpiricalHypothesisUpgradeSheet.0c46a7.json @@ -24,7 +24,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"09041-c\",\n \"traits\": \"\",\n \"permanent\": false,\n \"weakness\": false\n}", + "GMNotes_path": "AllPlayerCards.15bb07/EmpiricalHypothesisUpgradeSheet.0c46a7.gmnotes", "GUID": "0c46a7", "Grid": true, "GridProjection": false, diff --git a/objects/AllPlayerCards.15bb07/FriendsinLowPlacesUpgradeSheet.9fb3b9.gmnotes b/objects/AllPlayerCards.15bb07/FriendsinLowPlacesUpgradeSheet.9fb3b9.gmnotes new file mode 100644 index 00000000..7a220752 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/FriendsinLowPlacesUpgradeSheet.9fb3b9.gmnotes @@ -0,0 +1,7 @@ +{ + "id": "09060-c", + "type": "UpgradeSheet", + "traits": "", + "permanent": false, + "weakness": false +} diff --git a/objects/AllPlayerCards.15bb07/FriendsinLowPlacesUpgradeSheet.9fb3b9.json b/objects/AllPlayerCards.15bb07/FriendsinLowPlacesUpgradeSheet.9fb3b9.json index fb03ee6b..02122b70 100644 --- a/objects/AllPlayerCards.15bb07/FriendsinLowPlacesUpgradeSheet.9fb3b9.json +++ b/objects/AllPlayerCards.15bb07/FriendsinLowPlacesUpgradeSheet.9fb3b9.json @@ -24,7 +24,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"09060-c\",\n \"traits\": \"\",\n \"permanent\": false,\n \"weakness\": false\n}", + "GMNotes_path": "AllPlayerCards.15bb07/FriendsinLowPlacesUpgradeSheet.9fb3b9.gmnotes", "GUID": "9fb3b9", "Grid": true, "GridProjection": false, diff --git a/objects/AllPlayerCards.15bb07/GrizzledUpgradeSheet.ef8f08.gmnotes b/objects/AllPlayerCards.15bb07/GrizzledUpgradeSheet.ef8f08.gmnotes new file mode 100644 index 00000000..b1f9193e --- /dev/null +++ b/objects/AllPlayerCards.15bb07/GrizzledUpgradeSheet.ef8f08.gmnotes @@ -0,0 +1,7 @@ +{ + "id": "09101-c", + "type": "UpgradeSheet", + "traits": "", + "permanent": false, + "weakness": false +} diff --git a/objects/AllPlayerCards.15bb07/GrizzledUpgradeSheet.ef8f08.json b/objects/AllPlayerCards.15bb07/GrizzledUpgradeSheet.ef8f08.json index f560be9f..866ebf5e 100644 --- a/objects/AllPlayerCards.15bb07/GrizzledUpgradeSheet.ef8f08.json +++ b/objects/AllPlayerCards.15bb07/GrizzledUpgradeSheet.ef8f08.json @@ -24,7 +24,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"09101-c\",\n \"traits\": \"\",\n \"permanent\": false,\n \"weakness\": false\n}", + "GMNotes_path": "AllPlayerCards.15bb07/GrizzledUpgradeSheet.ef8f08.gmnotes", "GUID": "ef8f08", "Grid": true, "GridProjection": false, diff --git a/objects/AllPlayerCards.15bb07/HonedInstinctUpgradeSheet.ba0e34.gmnotes b/objects/AllPlayerCards.15bb07/HonedInstinctUpgradeSheet.ba0e34.gmnotes new file mode 100644 index 00000000..135d6a13 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/HonedInstinctUpgradeSheet.ba0e34.gmnotes @@ -0,0 +1,7 @@ +{ + "id": "09061-c", + "type": "UpgradeSheet", + "traits": "", + "permanent": false, + "weakness": false +} diff --git a/objects/AllPlayerCards.15bb07/HonedInstinctUpgradeSheet.ba0e34.json b/objects/AllPlayerCards.15bb07/HonedInstinctUpgradeSheet.ba0e34.json index d72d8f40..befee2e1 100644 --- a/objects/AllPlayerCards.15bb07/HonedInstinctUpgradeSheet.ba0e34.json +++ b/objects/AllPlayerCards.15bb07/HonedInstinctUpgradeSheet.ba0e34.json @@ -24,7 +24,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"09061-c\",\n \"traits\": \"\",\n \"permanent\": false,\n \"weakness\": false\n}", + "GMNotes_path": "AllPlayerCards.15bb07/HonedInstinctUpgradeSheet.ba0e34.gmnotes", "GUID": "ba0e34", "Grid": true, "GridProjection": false, diff --git a/objects/AllPlayerCards.15bb07/HuntersArmorUpgradeSheet.d2d01b.gmnotes b/objects/AllPlayerCards.15bb07/HuntersArmorUpgradeSheet.d2d01b.gmnotes new file mode 100644 index 00000000..28615818 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/HuntersArmorUpgradeSheet.d2d01b.gmnotes @@ -0,0 +1,7 @@ +{ + "id": "09021-c", + "type": "UpgradeSheet", + "traits": "", + "permanent": false, + "weakness": false +} diff --git a/objects/AllPlayerCards.15bb07/HuntersArmorUpgradeSheet.d2d01b.json b/objects/AllPlayerCards.15bb07/HuntersArmorUpgradeSheet.d2d01b.json index 27ed93d0..fbdb4a91 100644 --- a/objects/AllPlayerCards.15bb07/HuntersArmorUpgradeSheet.d2d01b.json +++ b/objects/AllPlayerCards.15bb07/HuntersArmorUpgradeSheet.d2d01b.json @@ -24,7 +24,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"09021-c\",\n \"traits\": \"\",\n \"permanent\": false,\n \"weakness\": false\n}", + "GMNotes_path": "AllPlayerCards.15bb07/HuntersArmorUpgradeSheet.d2d01b.gmnotes", "GUID": "d2d01b", "Grid": true, "GridProjection": false, diff --git a/objects/AllPlayerCards.15bb07/HyperphysicalShotcasterUpgradeSheet.a4eec2.gmnotes b/objects/AllPlayerCards.15bb07/HyperphysicalShotcasterUpgradeSheet.a4eec2.gmnotes new file mode 100644 index 00000000..47c32dcc --- /dev/null +++ b/objects/AllPlayerCards.15bb07/HyperphysicalShotcasterUpgradeSheet.a4eec2.gmnotes @@ -0,0 +1,7 @@ +{ + "id": "09119-c", + "type": "UpgradeSheet", + "traits": "", + "permanent": false, + "weakness": false +} diff --git a/objects/AllPlayerCards.15bb07/HyperphysicalShotcasterUpgradeSheet.a4eec2.json b/objects/AllPlayerCards.15bb07/HyperphysicalShotcasterUpgradeSheet.a4eec2.json index 0e3e6040..a78e8db9 100644 --- a/objects/AllPlayerCards.15bb07/HyperphysicalShotcasterUpgradeSheet.a4eec2.json +++ b/objects/AllPlayerCards.15bb07/HyperphysicalShotcasterUpgradeSheet.a4eec2.json @@ -24,7 +24,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"09119-c\",\n \"traits\": \"\",\n \"permanent\": false,\n \"weakness\": false\n}", + "GMNotes_path": "AllPlayerCards.15bb07/HyperphysicalShotcasterUpgradeSheet.a4eec2.gmnotes", "GUID": "a4eec2", "Grid": true, "GridProjection": false, diff --git a/objects/AllPlayerCards.15bb07/LivingLinkUpgradeSheet.19a05b.gmnotes b/objects/AllPlayerCards.15bb07/LivingLinkUpgradeSheet.19a05b.gmnotes new file mode 100644 index 00000000..d73e064a --- /dev/null +++ b/objects/AllPlayerCards.15bb07/LivingLinkUpgradeSheet.19a05b.gmnotes @@ -0,0 +1,7 @@ +{ + "id": "09079-c", + "type": "UpgradeSheet", + "traits": "", + "permanent": false, + "weakness": false +} diff --git a/objects/AllPlayerCards.15bb07/LivingLinkUpgradeSheet.19a05b.json b/objects/AllPlayerCards.15bb07/LivingLinkUpgradeSheet.19a05b.json index 632156da..b7261103 100644 --- a/objects/AllPlayerCards.15bb07/LivingLinkUpgradeSheet.19a05b.json +++ b/objects/AllPlayerCards.15bb07/LivingLinkUpgradeSheet.19a05b.json @@ -24,7 +24,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"09079-c\",\n \"traits\": \"\",\n \"permanent\": false,\n \"weakness\": false\n}", + "GMNotes_path": "AllPlayerCards.15bb07/LivingLinkUpgradeSheet.19a05b.gmnotes", "GUID": "19a05b", "Grid": true, "GridProjection": false, diff --git a/objects/AllPlayerCards.15bb07/MakeshiftTrapUpgradeSheet.64dfce.gmnotes b/objects/AllPlayerCards.15bb07/MakeshiftTrapUpgradeSheet.64dfce.gmnotes new file mode 100644 index 00000000..fcb12412 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/MakeshiftTrapUpgradeSheet.64dfce.gmnotes @@ -0,0 +1,7 @@ +{ + "id": "09100-c", + "type": "UpgradeSheet", + "traits": "", + "permanent": false, + "weakness": false +} diff --git a/objects/AllPlayerCards.15bb07/MakeshiftTrapUpgradeSheet.64dfce.json b/objects/AllPlayerCards.15bb07/MakeshiftTrapUpgradeSheet.64dfce.json index f0d3915e..e27c7685 100644 --- a/objects/AllPlayerCards.15bb07/MakeshiftTrapUpgradeSheet.64dfce.json +++ b/objects/AllPlayerCards.15bb07/MakeshiftTrapUpgradeSheet.64dfce.json @@ -24,7 +24,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"09100-c\",\n \"traits\": \"\",\n \"permanent\": false,\n \"weakness\": false\n}", + "GMNotes_path": "AllPlayerCards.15bb07/MakeshiftTrapUpgradeSheet.64dfce.gmnotes", "GUID": "64dfce", "Grid": true, "GridProjection": false, diff --git a/objects/AllPlayerCards.15bb07/PocketMultiToolUpgradeSheet.d706e7.gmnotes b/objects/AllPlayerCards.15bb07/PocketMultiToolUpgradeSheet.d706e7.gmnotes new file mode 100644 index 00000000..f1d7bc6c --- /dev/null +++ b/objects/AllPlayerCards.15bb07/PocketMultiToolUpgradeSheet.d706e7.gmnotes @@ -0,0 +1,7 @@ +{ + "id": "09099-c", + "type": "UpgradeSheet", + "traits": "", + "permanent": false, + "weakness": false +} diff --git a/objects/AllPlayerCards.15bb07/PocketMultiToolUpgradeSheet.d706e7.json b/objects/AllPlayerCards.15bb07/PocketMultiToolUpgradeSheet.d706e7.json index 6e0d3aec..845bf1fe 100644 --- a/objects/AllPlayerCards.15bb07/PocketMultiToolUpgradeSheet.d706e7.json +++ b/objects/AllPlayerCards.15bb07/PocketMultiToolUpgradeSheet.d706e7.json @@ -24,7 +24,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"09099-c\",\n \"traits\": \"\",\n \"permanent\": false,\n \"weakness\": false\n}", + "GMNotes_path": "AllPlayerCards.15bb07/PocketMultiToolUpgradeSheet.d706e7.gmnotes", "GUID": "d706e7", "Grid": true, "GridProjection": false, diff --git a/objects/AllPlayerCards.15bb07/PowerWordUpgradeSheet.0d9481.gmnotes b/objects/AllPlayerCards.15bb07/PowerWordUpgradeSheet.0d9481.gmnotes new file mode 100644 index 00000000..68411058 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/PowerWordUpgradeSheet.0d9481.gmnotes @@ -0,0 +1,7 @@ +{ + "id": "09081-c", + "type": "UpgradeSheet", + "traits": "", + "permanent": false, + "weakness": false +} diff --git a/objects/AllPlayerCards.15bb07/PowerWordUpgradeSheet.0d9481.json b/objects/AllPlayerCards.15bb07/PowerWordUpgradeSheet.0d9481.json index 6c049aef..e8248cc5 100644 --- a/objects/AllPlayerCards.15bb07/PowerWordUpgradeSheet.0d9481.json +++ b/objects/AllPlayerCards.15bb07/PowerWordUpgradeSheet.0d9481.json @@ -24,7 +24,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"09081-c\",\n \"traits\": \"\",\n \"permanent\": false,\n \"weakness\": false\n}", + "GMNotes_path": "AllPlayerCards.15bb07/PowerWordUpgradeSheet.0d9481.gmnotes", "GUID": "0d9481", "Grid": true, "GridProjection": false, diff --git a/objects/AllPlayerCards.15bb07/RolandBanks.f8cea5.json b/objects/AllPlayerCards.15bb07/RolandBanks.f8cea5.json index f187299d..49858120 100644 --- a/objects/AllPlayerCards.15bb07/RolandBanks.f8cea5.json +++ b/objects/AllPlayerCards.15bb07/RolandBanks.f8cea5.json @@ -24,7 +24,6 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"01501-m\",\n \"type\": \"Minicard\",\n \"traits\": \"\"\n}", "GMNotes_path": "AllPlayerCards.15bb07/RolandBanks.f8cea5.gmnotes", "GUID": "f8cea5", "Grid": true, diff --git a/objects/AllPlayerCards.15bb07/RunicAxeUpgradeSheet.be427d.gmnotes b/objects/AllPlayerCards.15bb07/RunicAxeUpgradeSheet.be427d.gmnotes new file mode 100644 index 00000000..aa9c8fa9 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/RunicAxeUpgradeSheet.be427d.gmnotes @@ -0,0 +1,7 @@ +{ + "id": "09022-c", + "type": "UpgradeSheet", + "traits": "", + "permanent": false, + "weakness": false +} diff --git a/objects/AllPlayerCards.15bb07/RunicAxeUpgradeSheet.be427d.json b/objects/AllPlayerCards.15bb07/RunicAxeUpgradeSheet.be427d.json index fd8a1511..9650e3b1 100644 --- a/objects/AllPlayerCards.15bb07/RunicAxeUpgradeSheet.be427d.json +++ b/objects/AllPlayerCards.15bb07/RunicAxeUpgradeSheet.be427d.json @@ -24,7 +24,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"09022-c\",\n \"traits\": \"\",\n \"permanent\": false,\n \"weakness\": false\n}", + "GMNotes_path": "AllPlayerCards.15bb07/RunicAxeUpgradeSheet.be427d.gmnotes", "GUID": "be427d", "Grid": true, "GridProjection": false, diff --git a/objects/AllPlayerCards.15bb07/SummonedServitorUpgradeSheet.5397a6.gmnotes b/objects/AllPlayerCards.15bb07/SummonedServitorUpgradeSheet.5397a6.gmnotes new file mode 100644 index 00000000..9e67e3cb --- /dev/null +++ b/objects/AllPlayerCards.15bb07/SummonedServitorUpgradeSheet.5397a6.gmnotes @@ -0,0 +1,7 @@ +{ + "id": "09080-c", + "type": "UpgradeSheet", + "traits": "", + "permanent": false, + "weakness": false +} diff --git a/objects/AllPlayerCards.15bb07/SummonedServitorUpgradeSheet.5397a6.json b/objects/AllPlayerCards.15bb07/SummonedServitorUpgradeSheet.5397a6.json index 2129a7c0..c9197cfa 100644 --- a/objects/AllPlayerCards.15bb07/SummonedServitorUpgradeSheet.5397a6.json +++ b/objects/AllPlayerCards.15bb07/SummonedServitorUpgradeSheet.5397a6.json @@ -24,7 +24,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"09080-c\",\n \"traits\": \"\",\n \"permanent\": false,\n \"weakness\": false\n}", + "GMNotes_path": "AllPlayerCards.15bb07/SummonedServitorUpgradeSheet.5397a6.gmnotes", "GUID": "5397a6", "Grid": true, "GridProjection": false, diff --git a/objects/AllPlayerCards.15bb07/TheRavenQuillUpgradeSheet.23b96a.gmnotes b/objects/AllPlayerCards.15bb07/TheRavenQuillUpgradeSheet.23b96a.gmnotes new file mode 100644 index 00000000..fc009d40 --- /dev/null +++ b/objects/AllPlayerCards.15bb07/TheRavenQuillUpgradeSheet.23b96a.gmnotes @@ -0,0 +1,7 @@ +{ + "id": "09042-c", + "type": "UpgradeSheet", + "traits": "", + "permanent": false, + "weakness": false +} diff --git a/objects/AllPlayerCards.15bb07/TheRavenQuillUpgradeSheet.23b96a.json b/objects/AllPlayerCards.15bb07/TheRavenQuillUpgradeSheet.23b96a.json index 98de4c02..7db6b073 100644 --- a/objects/AllPlayerCards.15bb07/TheRavenQuillUpgradeSheet.23b96a.json +++ b/objects/AllPlayerCards.15bb07/TheRavenQuillUpgradeSheet.23b96a.json @@ -24,7 +24,7 @@ }, "Description": "", "DragSelectable": true, - "GMNotes": "{\n \"id\": \"09042-c\",\n \"traits\": \"\",\n \"permanent\": false,\n \"weakness\": false\n}", + "GMNotes_path": "AllPlayerCards.15bb07/TheRavenQuillUpgradeSheet.23b96a.gmnotes", "GUID": "23b96a", "Grid": true, "GridProjection": false, diff --git a/src/arkhamdb/DeckImporterMain.ttslua b/src/arkhamdb/DeckImporterMain.ttslua index 3eb9de7c..3cff0e43 100644 --- a/src/arkhamdb/DeckImporterMain.ttslua +++ b/src/arkhamdb/DeckImporterMain.ttslua @@ -147,6 +147,8 @@ local function onDeckResult(deck, playerColor, configuration) local slots = deck.slots maybeDrawRandomWeakness(slots, playerColor, configuration) maybeAddInvestigatorCards(deck, slots) + maybeAddCustomizeUpgradeSheets(slots, configuration) + maybeAddSummonedServitor(slots) extractBondedCards(slots, configuration) checkTaboos(deck.taboo_id, slots, playerColor, configuration) @@ -171,8 +173,8 @@ local function onDeckResult(deck, playerColor, configuration) local customizations = {} if meta then customizations = JSON.decode(deck.meta) end - loadCards(slots, deck.investigator_code, playerColor, commandManager, - configuration, results.configuration, customizations) + loadCards(slots, deck.investigator_code, customizations, playerColor, commandManager, + configuration, results.configuration) end -- Checks to see if the slot list includes the random weakness ID. If it does, @@ -224,6 +226,27 @@ function maybeAddInvestigatorCards(deck, slots) end end +function maybeAddCustomizeUpgradeSheets(slots, configuration) + local allCardsBag = getObjectFromGUID(configuration.card_bag_guid) + for cardId, _ in pairs(slots) do + -- upgrade sheets for customizable cards + local upgradesheet = allCardsBag.call("getCardById", { id = cardId .. "-c" }) + if upgradesheet ~= nil then + slots[cardId.."-c"] = 1 + end + end +end + +function maybeAddSummonedServitor(slots) + for cardId, cardCount in pairs(slots) do + -- spawn additional minicard for 'Summoned Servitor' + if cardId == "09080" then + slots["09080-m"] = cardCount + return + end + end +end + -- Process the slot list and looks for any cards which are bonded to those in the deck. Adds those cards to the slot list. ---@param slots: The slot list for cards in this deck. Table key is the cardId, value is the number of those cards which will be spawned ---@param configuration: The API configuration object @@ -276,10 +299,14 @@ end ---@param cardMetadata: Table of card metadata. Metadata fields type and permanent are required; all others are optional. ---@return: Zone name such as "Deck", "SetAside1", etc. See Zones object documentation for a list of valid zones. function getDefaultCardZone(cardMetadata) - if cardMetadata.type == "Investigator" then + if (cardMetadata.id == "09080-m") then + return "SetAside6" + elseif cardMetadata.type == "Investigator" then return "Investigator" elseif cardMetadata.type == "Minicard" then return "Minicard" + elseif cardMetadata.type == "UpgradeSheet" then + return "SetAside4" elseif cardMetadata.permanent then return "SetAside1" elseif bondedList[cardMetadata.id] then @@ -300,10 +327,10 @@ end -- Investigator cards should already be added to the slots list if they -- should be spawned, but this value is separate to check for special -- handling for certain investigators +---@param customizations: ArkhamDB data for customizations on customizable cards ---@param playerColor String Color name of the player mat to place this deck on (e.g. "Red") ---@param configuration: Loader configuration object ----@param customizations: ArkhamDB data for customizations on customizable cards -function loadCards(slots, investigatorId, playerColor, commandManager, configuration, command_config, customizations) +function loadCards(slots, investigatorId, customizations, playerColor, commandManager, configuration, command_config) function coinside() local allCardsBag = getObjectFromGUID(configuration.card_bag_guid) local yPos = {} @@ -316,73 +343,6 @@ function loadCards(slots, investigatorId, playerColor, commandManager, configura table.insert(cardsToSpawn, { data = card.data, metadata = card.metadata, zone = cardZone }) end - -- upgrade sheets for customizable cards - local upgradesheet = allCardsBag.call("getCardById", { id = cardId .. "-c" }) - if upgradesheet ~= nil then - - -- update metadata for spawned upgrade sheets - local upgrades = customizations["cus_" .. cardId] - - if upgrades ~= nil then - -- initialize tables - -- markedBoxes: contains the amount of markedBoxes (left to right) per row (starting at row 1) - -- inputValues: contains the amount of inputValues per row (starting at row 0) - local markedBoxes = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } - local inputValues = {} - local index_xp = {} - - -- get the index and xp values (looks like this: X|X,X|X, ..) - for str in string.gmatch(customizations["cus_" .. cardId], "([^,]+)") do - table.insert(index_xp, str) - end - - -- split each pair and assign it to the proper position in markedBoxes - if (customizationRowsWithFields[cardId] ~= nil) then - for i = 1, customizationRowsWithFields[cardId].inputCount do - table.insert(inputValues, "") - end - end - local inputCount = 0 - for _, entry in ipairs(index_xp) do - local counter = 0 - local index = 0 - - -- if found number is 0, then only get inputvalue - for str in string.gmatch(entry, "([^|]+)") do - counter = counter + 1 - if counter == 1 then - index = tonumber(str) + 1 - elseif counter == 2 then - markedBoxes[index] = tonumber(str) - elseif counter == 3 and str ~= "" then - if (cardId == "09042") then - inputValues[customizationRowsWithFields[cardId].inputMap[index]] = - convertRavenQuillSelections(str) - else - inputValues[customizationRowsWithFields[cardId].inputMap[index]] = str - end - end - end - end - - -- remove first entry in markedBoxes if row 0 has textbox - if customizationRowsWithFields[cardId] ~= nil - and customizationRowsWithFields[cardId].inputCount > 0 then - table.remove(markedBoxes, 1) - end - - -- write the loaded values to the save_data of the sheets - upgradesheet.data["LuaScriptState"] = JSON.encode({ markedBoxes, inputValues }) - table.insert(cardsToSpawn, { data = upgradesheet.data, metadata = upgradesheet.metadata, zone = "SetAside4" }) - end - end - - -- spawn additional minicard for 'Summoned Servitor' - if cardId == "09080" then - local servitor = allCardsBag.call("getCardById", { id = "09080-m" }) - table.insert(cardsToSpawn, { data = servitor.data, metadata = servitor.metadata, zone = "SetAside6" }) - end - slots[cardId] = 0 end end @@ -397,6 +357,7 @@ function loadCards(slots, investigatorId, playerColor, commandManager, configura handleAncestralKnowledge(cardsToSpawn) handleUnderworldMarket(cardsToSpawn, playerColor) handleHunchDeck(investigatorId, cardsToSpawn, playerColor) + handleCustomizableUpgrades(cardsToSpawn, customizations) -- Split the card list into separate lists for each zone local zoneDecks = buildZoneLists(cardsToSpawn) @@ -650,6 +611,69 @@ function handleHunchDeck(investigatorId, cardList, playerColor) end end +function handleCustomizableUpgrades(cardList, customizations) + for _, card in ipairs(cardList) do + if card.metadata.type == "UpgradeSheet" then + local baseId = string.sub(card.metadata.id, 1, 5) + local upgrades = customizations["cus_" .. baseId] + log(upgrades) + log(baseId) + + if upgrades ~= nil then + -- initialize tables + -- markedBoxes: contains the amount of markedBoxes (left to right) per row (starting at row 1) + -- inputValues: contains the amount of inputValues per row (starting at row 0) + local markedBoxes = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + local inputValues = {} + local index_xp = {} + + -- get the index and xp values (looks like this: X|X,X|X, ..) + for str in string.gmatch(customizations["cus_" .. baseId], "([^,]+)") do + table.insert(index_xp, str) + end + + -- split each pair and assign it to the proper position in markedBoxes + if (customizationRowsWithFields[baseId] ~= nil) then + for i = 1, customizationRowsWithFields[baseId].inputCount do + table.insert(inputValues, "") + end + end + local inputCount = 0 + for _, entry in ipairs(index_xp) do + local counter = 0 + local index = 0 + + -- if found number is 0, then only get inputvalue + for str in string.gmatch(entry, "([^|]+)") do + counter = counter + 1 + if counter == 1 then + index = tonumber(str) + 1 + elseif counter == 2 then + markedBoxes[index] = tonumber(str) + elseif counter == 3 and str ~= "" then + if (baseId == "09042") then + inputValues[customizationRowsWithFields[baseId].inputMap[index]] = + convertRavenQuillSelections(str) + else + inputValues[customizationRowsWithFields[baseId].inputMap[index]] = str + end + end + end + end + + -- remove first entry in markedBoxes if row 0 has textbox + if customizationRowsWithFields[baseId] ~= nil + and customizationRowsWithFields[baseId].inputCount > 0 then + table.remove(markedBoxes, 1) + end + + -- write the loaded values to the save_data of the sheets + card.data["LuaScriptState"] = JSON.encode({ markedBoxes, inputValues }) + end + end + end +end + -- Test method. Loads all decks which were submitted to ArkhamDB on a given date window. function testLoadLotsOfDecks() local configuration = getConfiguration()