diff --git a/5eShaped/precompiled/components/sheetWorkers.js b/5eShaped/precompiled/components/sheetWorkers.js index ea1995cf99..8cde850be7 100644 --- a/5eShaped/precompiled/components/sheetWorkers.js +++ b/5eShaped/precompiled/components/sheetWorkers.js @@ -3274,6 +3274,27 @@ on('change:global_attack_bonus change:global_melee_attack_bonus change:global_ra updateAction('lairaction'); }); +const setSpellLevelToNewSystem = () => { + const repeatingItem = 'repeating_spell'; + const collectionArray = []; + const finalSetAttrs = {}; + + getSectionIDs(repeatingItem, (ids) => { + for (const id of ids) { + const repeatingString = `${repeatingItem}_${id}_`; + collectionArray.push(`${repeatingString}spell_level`); + } + + getAttrs(collectionArray, (v) => { + for (const id of ids) { + const repeatingString = `${repeatingItem}_${id}_`; + finalSetAttrs[`${repeatingString}spell_level`] = `@{spell_level_${v[`${repeatingString}spell_level`]}}`; + } + setFinalAttrs(v, finalSetAttrs); + }); + }); +}; + const updateSpell = (rowId) => { const repeatingItem = 'repeating_spell'; const collectionArray = ['is_npc', 'pb', 'finesse_mod', 'global_spell_attack_bonus', 'global_spell_damage_bonus', 'global_spell_dc_bonus', 'global_spell_heal_bonus', 'default_ability', 'caster_level']; @@ -5729,6 +5750,7 @@ const sheetOpened = () => { if (versionCompare(version, '4.4.0') < 0) { updateCustomSavingThrows(); newAttackToggle(); + setSpellLevelToNewSystem(); } } diff --git a/5eShaped/precompiled/components/spells/spell.html b/5eShaped/precompiled/components/spells/spell.html index f3cb8b9267..9dc29fbecc 100644 --- a/5eShaped/precompiled/components/spells/spell.html +++ b/5eShaped/precompiled/components/spells/spell.html @@ -69,15 +69,15 @@
diff --git a/5eShaped/precompiled/components/spells/spells.html b/5eShaped/precompiled/components/spells/spells.html index 9c975e81df..93fcf50a80 100644 --- a/5eShaped/precompiled/components/spells/spells.html +++ b/5eShaped/precompiled/components/spells/spells.html @@ -1,4 +1,14 @@
+ + + + + + + + + +