From d35716f6b9c502a239f4fdaadf5e4fab8a3fb66b Mon Sep 17 00:00:00 2001 From: Jack Holloway Date: Tue, 23 Jan 2024 20:45:19 +0000 Subject: [PATCH] Kgar class spell choices --- CHANGELOG.md | 1 + src/parser/character/spellCasting.js | 1 + src/parser/spells/CharacterSpellFactory.js | 6 ++++++ src/parser/spells/parseSpell.js | 1 + src/settings.js | 1 + 5 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a540c2de..4d19c515c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Monster: Fathomer spell parsing. - Monster: Clay Golem Haste feature was parsed incorrectly as a bonus action. - Monster: Ankheg Acid Spray did not import as a 30ft line. +- Kgar Tidy 5e Sheet: add spells to class spellbook. # 3.7.14 diff --git a/src/parser/character/spellCasting.js b/src/parser/character/spellCasting.js index 8437b1055..9b5d59557 100644 --- a/src/parser/character/spellCasting.js +++ b/src/parser/character/spellCasting.js @@ -183,4 +183,5 @@ DDBCharacter.prototype._generateMaxPreparedSpells = function _generateMaxPrepare this.raw.character.system.details.maxPreparedSpells = max; setProperty(this.raw.character, "flags.tidy5e-sheet.maxPreparedSpells", max); + setProperty(this.raw.character, "flags.tidy5e-sheet-kgar.maxPreparedSpells", max); }; diff --git a/src/parser/spells/CharacterSpellFactory.js b/src/parser/spells/CharacterSpellFactory.js index 3c6e3383d..41cb2d3ed 100755 --- a/src/parser/spells/CharacterSpellFactory.js +++ b/src/parser/spells/CharacterSpellFactory.js @@ -71,6 +71,9 @@ export default class CharacterSpellFactory { "spell-class-filter-for-5e": { parentClass: classInfo.definition.name.toLowerCase(), }, + "tidy5e-sheet-kgar": { + parentClass: classInfo.definition.name.toLowerCase(), + }, // "spellbook-assistant-manager": { // class: classInfo.definition.name.toLowerCase(), // } @@ -162,6 +165,9 @@ export default class CharacterSpellFactory { forceMaterial: klass?.definition?.name === "Artificer", }, }, + "tidy5e-sheet-kgar": { + parentClass: (klass) ? klass.definition.name : undefined, + }, }; // Check for duplicate spells, normally domain ones diff --git a/src/parser/spells/parseSpell.js b/src/parser/spells/parseSpell.js index ad7e9ac4a..fce66f4cf 100644 --- a/src/parser/spells/parseSpell.js +++ b/src/parser/spells/parseSpell.js @@ -45,6 +45,7 @@ export async function parseSpell(data, character) { }, // "spellbook-assistant-manager": data.flags["spellbook-assistant-manager"], "spell-class-filter-for-5e": data.flags["spell-class-filter-for-5e"], + "tidy5e-sheet-kgar": data.flags["tidy5e-sheet-kgar"], }, }; diff --git a/src/settings.js b/src/settings.js index 0d7d0a671..507eef3ee 100644 --- a/src/settings.js +++ b/src/settings.js @@ -85,6 +85,7 @@ const SUPPORTED_FLAG_GROUPS = [ "obsidian", "siftoolkit", "spell-class-filter-for-5e", + "tidy5e-sheet-kgar", "spellbook-assistant-manager", "tagger", "tidy5e-sheet",