diff --git a/ADnD_2E_Revised/2ESheet.html b/ADnD_2E_Revised/2ESheet.html index fc465e7c6c..85f505f420 100644 --- a/ADnD_2E_Revised/2ESheet.html +++ b/ADnD_2E_Revised/2ESheet.html @@ -9,7 +9,6 @@
@@ -3903,7 +3904,7 @@
| @@ -33726,7 +33732,7 @@ intelligenceTable['intimm4th'] = ['Error','','','','','','','','','','','','','' intelligenceTable['intimm5th'] = ['Error','','','','','','','','','','','','','','','','','','','','','','','5th-level','5th-level','5th-level']; intelligenceTable['intimm6th'] = ['Error','','','','','','','','','','','','','','','','','','','','','','','','6th-level','6th-level']; intelligenceTable['intimm7th'] = ['Error','','','','','','','','','','','','','','','','','','','','','','','','','7th-level']; -// intelligenceTable['spell-points-int'] = ['Error','','','','','','','','','2','2','2','3','3','4','4','5','6','7','8','9','9','9','9','9','9']; +intelligenceTable['spell-points-int'] = [0,0,0,0,0,0,0,0,0,2,2,2,3,3,4,4,5,6,7,8,9,9,9,9,9,9]; intelligenceTable['intnotes'] = ['INVALID INTELLIGENCE','Communicate by Grunts & Gestures','','','','','','','','','','','','','','','','','','','','','','','','','']; const wisdomTable = {}; @@ -69808,6 +69814,17 @@ setupRepeatingSpellSumming(allWizardSpellSections, wizardSpellPoints, 'spell-poi setupRepeatingSpellSumming(allWizardSpellSections, 'arc', 'spell-arc', `${arc}-sum`, true); setupCalculateRemaining(`${wizardSpellPoints}-total`, `${wizardSpellPoints}-sum`, `${wizardSpellPoints}-remaining`); setupCalculateRemaining(arc, `${arc}-sum`, `${arc}-remaining`); +on('change:spell-points-int-enabled change:intelligence', function (eventInfo) { + getAttrs(['spell-points-int-enabled', 'intelligence'], function (values) { + let newValue = {'spell-points-int': 0} + if (values['spell-points-int-enabled'] !== '1') { + return setAttrs(newValue) + } + let intelligence = getLookupValue(values['intelligence'], 0); + newValue['spell-points-int'] = intelligenceTable['spell-points-int'][intelligence]; + setAttrs(newValue); + }); +}); let priestSpellPoints = 'spell-points-priest'; let wind = 'total-wind'; diff --git a/ADnD_2E_Revised/html/changelog.html b/ADnD_2E_Revised/html/changelog.html index 57571987f7..441c7fa495 100644 --- a/ADnD_2E_Revised/html/changelog.html +++ b/ADnD_2E_Revised/html/changelog.html @@ -4,7 +4,6 @@ | Level | Specialist | -Intelligence | +Intelligence | Total | | | Remaining | @@ -44,11 +44,16 @@+ | | | |||||||
| diff --git a/ADnD_2E_Revised/javascript/abilityScores.js b/ADnD_2E_Revised/javascript/abilityScores.js index 8470822ad9..30f09d49f9 100644 --- a/ADnD_2E_Revised/javascript/abilityScores.js +++ b/ADnD_2E_Revised/javascript/abilityScores.js @@ -99,7 +99,7 @@ intelligenceTable['intimm4th'] = ['Error','','','','','','','','','','','','','' intelligenceTable['intimm5th'] = ['Error','','','','','','','','','','','','','','','','','','','','','','','5th-level','5th-level','5th-level']; intelligenceTable['intimm6th'] = ['Error','','','','','','','','','','','','','','','','','','','','','','','','6th-level','6th-level']; intelligenceTable['intimm7th'] = ['Error','','','','','','','','','','','','','','','','','','','','','','','','','7th-level']; -// intelligenceTable['spell-points-int'] = ['Error','','','','','','','','','2','2','2','3','3','4','4','5','6','7','8','9','9','9','9','9','9']; +intelligenceTable['spell-points-int'] = [0,0,0,0,0,0,0,0,0,2,2,2,3,3,4,4,5,6,7,8,9,9,9,9,9,9]; intelligenceTable['intnotes'] = ['INVALID INTELLIGENCE','Communicate by Grunts & Gestures','','','','','','','','','','','','','','','','','','','','','','','','','']; const wisdomTable = {}; diff --git a/ADnD_2E_Revised/javascript/sheetWorkers.js b/ADnD_2E_Revised/javascript/sheetWorkers.js index 8dd46a163e..d02523196f 100644 --- a/ADnD_2E_Revised/javascript/sheetWorkers.js +++ b/ADnD_2E_Revised/javascript/sheetWorkers.js @@ -1323,6 +1323,17 @@ setupRepeatingSpellSumming(allWizardSpellSections, wizardSpellPoints, 'spell-poi setupRepeatingSpellSumming(allWizardSpellSections, 'arc', 'spell-arc', `${arc}-sum`, true); setupCalculateRemaining(`${wizardSpellPoints}-total`, `${wizardSpellPoints}-sum`, `${wizardSpellPoints}-remaining`); setupCalculateRemaining(arc, `${arc}-sum`, `${arc}-remaining`); +on('change:spell-points-int-enabled change:intelligence', function (eventInfo) { + getAttrs(['spell-points-int-enabled', 'intelligence'], function (values) { + let newValue = {'spell-points-int': 0} + if (values['spell-points-int-enabled'] !== '1') { + return setAttrs(newValue) + } + let intelligence = getLookupValue(values['intelligence'], 0); + newValue['spell-points-int'] = intelligenceTable['spell-points-int'][intelligence]; + setAttrs(newValue); + }); +}); let priestSpellPoints = 'spell-points-priest'; let wind = 'total-wind'; |