From 2ee64db9906f62130b55c6b5234041adfb213b07 Mon Sep 17 00:00:00 2001 From: Jack Holloway Date: Wed, 10 Jan 2024 20:23:16 +0000 Subject: [PATCH] Blessing of Knowlege Advancement support --- src/parser/advancements/AdvancementHelper.js | 20 +++++++++++--------- src/parser/classes/DDBClass.js | 5 ++++- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/parser/advancements/AdvancementHelper.js b/src/parser/advancements/AdvancementHelper.js index 5331bc45b..35f0c4647 100644 --- a/src/parser/advancements/AdvancementHelper.js +++ b/src/parser/advancements/AdvancementHelper.js @@ -314,17 +314,14 @@ export default class AdvancementHelper { ? this.dictionary.multiclassSkill : mods.length; - // console.warn(`Parsing skill advancement for level ${i}`, { + // console.warn(`Parsing skill advancement for level ${level}`, { // availableToMulticlass, - // i, - // proficiencyFeature, + // level, + // feature, // mods, - // skillExplicitMods, - // skillChooseMods, - // skillMods, // parsedSkills, // chosenSkills, - // skillCount: count, + // count, // skillsFromMods, // }); @@ -970,8 +967,12 @@ export default class AdvancementHelper { const oneOffRegex = /you gain proficiency (?:in|with) (\w+) of the following skills of your choice:\s(.*?)(\.|$)/im; const oneOffMatch = textDescription.match(oneOffRegex); - if (skillMatch || oneOffMatch) { - const match = skillMatch ?? oneOffMatch; + // You also become proficient in your choice of two of the following skills: Arcana, History, Nature, or Religion. + const twoRegex = /also become proficient in your choice of (\w+) of the following skills:\s(.*?)(\.|$)/im; + const twoMatch = textDescription.match(twoRegex); + + if (skillMatch || oneOffMatch || twoMatch) { + const match = skillMatch ?? oneOffMatch ?? twoMatch; const skillNames = match[2].replace(' and ', ',').replace(" or ", " ").split(',').map((skill) => skill.trim()); const skills = skillNames .filter((name) => DICTIONARY.character.skills.some((skill) => skill.label.toLowerCase() === name.toLowerCase())) @@ -1501,6 +1502,7 @@ export default class AdvancementHelper { // // At 3rd level, choose two of your skill proficiencies. Your proficiency bonus is doubled for any ability check you make that uses either of the chosen proficiencies. // // At 6th level, choose two more of your skill proficiencies, or one more of your skill proficiencies and your proficiency with thieves’ tools. Your proficiency bonus is doubled for any ability check you make that uses either of the chosen proficiencies. // // Choose one skill in which you have proficiency. You gain expertise with that skill, + // Your proficiency bonus is doubled for any check you make with the chosen skills. // parse expertises diff --git a/src/parser/classes/DDBClass.js b/src/parser/classes/DDBClass.js index a2b188c7a..b96b67be5 100755 --- a/src/parser/classes/DDBClass.js +++ b/src/parser/classes/DDBClass.js @@ -21,6 +21,7 @@ export default class DDBClass { "Otherworldly Glamour", "Survivalist", "Training in War and Song", + "Blessings of Knowledge", "Elegant Courtier", // this is a you get a thing or otherwise choose from two others ]; @@ -29,6 +30,7 @@ export default class DDBClass { "Canny", "Deft Explorer", "Survivalist", + "Blessings of Knowledge", // "Tool Expertise", // revisit,this doesn't work the same way ]; @@ -661,7 +663,8 @@ export default class DDBClass { for (let i = 0; i <= 20; i++) { [true, false].forEach((availableToMulticlass) => { - if (!availableToMulticlass && i > 1) return; + if ((!availableToMulticlass && i > 1)) return; + if (this._isSubClass && !availableToMulticlass) return; const skillFeatures = this._proficiencyFeatures.filter((f) => f.requiredLevel === i); for (const feature of skillFeatures) {