Skip to content

Commit

Permalink
Blessing of Knowlege Advancement support
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPrimate committed Jan 10, 2024
1 parent e8148cc commit 2ee64db
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
20 changes: 11 additions & 9 deletions src/parser/advancements/AdvancementHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
// });

Expand Down Expand Up @@ -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()))
Expand Down Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion src/parser/classes/DDBClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
];

Expand All @@ -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
];

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 2ee64db

Please sign in to comment.