diff --git a/ADnD_2E_Revised/2ESheet.html b/ADnD_2E_Revised/2ESheet.html index 85ed4573db..180502a455 100644 --- a/ADnD_2E_Revised/2ESheet.html +++ b/ADnD_2E_Revised/2ESheet.html @@ -16,9 +16,11 @@
  • Removed the "Roll Spell Effect" button as it caused more confusion than it helped
  • -
  • Added Spell tracking selection to the Sheet Settings Tab. Choices are: Spell slots, spell points, arcs / songs / winds
  • +
  • Added Spell tracking selection to the Sheet Settings Tab. Choices are: Spell slots, spell points, Arcs / Winds
  • Redesigned the Spells tab to only show the spell tracking system that selected on the Sheet Settings Tab
  • -
  • Styled Monster tab to have dynamically sized fields, and larger fields for Hice Dice, HP, and Max HP
  • +
  • Added autofill for bonus Winds from high Wisdom for the Arcs/Winds spell tracking system. If the PO: S&P sub ability scores are used, base Wisdom is still used for determining bonus winds
  • +
  • Fixed bonus spells from high Intuition. Willpower was incorrectly used
  • +
  • Styled Monster tab to have dynamically sized fields, and larger fields for Hit Dice, HP, and Max HP

  • @@ -3922,7 +3924,7 @@ Remaining - Arc + Arcs | @@ -33828,8 +33830,7 @@ intelligenceTable['intnotes'] = ['INVALID INTELLIGENCE','Communicate by Grunts & const wisdomTable = {}; wisdomTable['wisdef'] = ['Error','-6','-4','-3','-2','-1','-1','-1','0','0','0','0','0','0','0','+1','+2','+3','+4','+4','+4','+4','+4','+4','+4','+4']; wisdomTable['wisbonus'] = ['Error','—','—','—','—','—','—','—','—','0','0','0','0','1st','1st','2nd','2nd','3rd','4th','1st,3rd','2nd,4th','3rd,5th','4th,5th','1st,6th','5th,6th','6th,7th']; -wisdomTable['wisbonus-prime'] = ['Error','','','','','','','','','','','','','1st','2x1st','2x1st, 2nd','2x1st, 2x2nd','2x1st, 2x2nd, 3rd','2x1st, 2x2nd, 3rd, 4th','3x1st, 2x2nd, 2x3rd, 4th','3x1st, 3x2nd, 2x3rd, 2x4th','3x1st, 3x2nd, 3x3rd, 2x4th','3x1st, 3x2nd, 3x3rd, 3x4th','4x1st, 3x2nd, 3x3rd, 3x4th','4x1st, 3x2nd, 3x3rd, 3x4th','4x1st, 3x2nd, 3x3rd, 3x4th']; -wisdomTable['wisbonus-extra'] = ['Error','','','','','','','','','','','','','','','','','','','','','5th','2x5th','2x5th, 6th','3x5th, 2x6th','3x5th, 3x6th, 7th']; +wisdomTable['wisdom-wind'] = [0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,2,3,4,5,6,7,8,9,10,11,12]; wisdomTable['wisfail'] = ['Error','80','60','50','45','40','35','30','25','20','15','10','5','0','0','0','0','0','0','0','0','0','0','0','0','0']; wisdomTable['wisimmune'] = ['Error','','','','','','','','','','','','','','','','','','','cause fear, charm person, command, friends, hypnotism','forget, hold person, ray of enfeeblement, scare','fear','charm monster, confusion, emotion, fumble, suggestion','chaos, feeblemind, hold monster, magic jar, quest','geas, mass suggestion, rod of rulership','antipathy/sympathy, death spell, mass charm']; wisdomTable['wisnotes'] = ['INVALID WISDOM','','','','','','','','','','','','','','','','','','','','','','','','','','']; @@ -69250,7 +69251,7 @@ on('change:intelligence change:reason change:knowledge', function() { }); // Set sub-attributes based on Wisdom, Intuition, and Willpower -function parseWisBonus(abilityScore) { +function parseWisBonus(abilityScore, wisdom) { if (abilityScore < 13) { return { '1st': 0, @@ -69260,6 +69261,7 @@ function parseWisBonus(abilityScore) { '5th': 0, '6th': 0, '7th': 0, + 'wind': wisdomTable['wisdom-wind'][wisdom], 'wisbonus': wisdomTable['wisbonus'][abilityScore], 'wisbonus-prime': wisdomTable['wisbonus'][abilityScore], 'wisbonus-extra': wisdomTable['wisbonus'][abilityScore], @@ -69281,11 +69283,21 @@ function parseWisBonus(abilityScore) { '5th': (bonusString.match(/5th/g) || []).length, '6th': (bonusString.match(/6th/g) || []).length, '7th': (bonusString.match(/7th/g) || []).length, + 'wind': wisdomTable['wisdom-wind'][wisdom], }; // Generate bonus prime and bonus extra strings - bonus['wisbonus-prime'] = wisdomTable['wisbonus-prime'][abilityScore]; - bonus['wisbonus-extra'] = wisdomTable['wisbonus-extra'][abilityScore]; + function format(bonus, key) { + if (bonus[key] === 0) { + return ''; + } + if (bonus[key] === 1) { + return key + } + return `${bonus[key]}x${key}`; + } + bonus['wisbonus-prime'] = [format(bonus, '1st'), format(bonus, '2nd'), format(bonus, '3rd'), format(bonus, '4th')].filter(Boolean).join(', '); + bonus['wisbonus-extra'] = [format(bonus, '5th'), format(bonus, '6th'), format(bonus, '7th')].filter(Boolean).join(', '); bonus['wisbonus'] = [bonus['wisbonus-prime'], bonus['wisbonus-extra']].filter(Boolean).join(', '); return bonus; @@ -69304,7 +69316,7 @@ on('change:wisdom change:intuition change:willpower', function() { let bonusSpells; if (wisdom === 0) { - bonusSpells = parseWisBonus(0); + bonusSpells = parseWisBonus(0, 0); assignAttributes(0, 0, 0, bonusSpells, wisdomTable['wisimmune'][0], wisdomTable['wisimmune'][0], wisdomTable['wisnotes'][0], wisdomTable['wisnotes'][0]); return; } @@ -69336,7 +69348,8 @@ on('change:wisdom change:intuition change:willpower', function() { wisimm1 = wisImmuneArray.slice(0, slicePoint).filter(Boolean).join(', '); wisimm2 = wisImmuneArray.slice(slicePoint).filter(Boolean).join(', '); } - bonusSpells = parseWisBonus(willpower); + bonusSpells = parseWisBonus(intuition, wisdom); + console.log(bonusSpells); assignAttributes(wisdom, intuition, willpower, bonusSpells, wisimm1, wisimm2, wisnotes, wis2notes); @@ -69359,6 +69372,7 @@ on('change:wisdom change:intuition change:willpower', function() { 'spell-priest-level5-wisdom': bonusSpells['5th'], 'spell-priest-level6-wisdom': bonusSpells['6th'], 'spell-priest-level7-wisdom': bonusSpells['7th'], + 'wisdom-wind': bonusSpells['wind'], }); } }); @@ -69517,7 +69531,7 @@ function setupRepeatingSpellSumming(sections, oldField, newField, resultFieldNam } function setupCalculateRemaining(totalField, sumField, remainingField) { - on(`change:${totalField} change:${sumField}`, function () { + on(`change:${totalField} change:${sumField}`, function (eventInfo) { getAttrs([totalField, sumField], function (values) { let intTotal = parseInt(values[totalField]) || 0; let intSum = parseInt(values[sumField]) || 0; @@ -69891,6 +69905,7 @@ let priestSpellPoints = 'spell-points-priest'; let wind = 'total-wind'; let allPriestSpellSections = priestSpellLevelsSections.flatMap(sl => sl.sections); setupStaticCalculateTotal(`${priestSpellPoints}-total`, [`${priestSpellPoints}-lvl`, `${priestSpellPoints}-wis`]); +setupStaticCalculateTotal(wind, ['level-wind', 'wisdom-wind']); setupRepeatingSpellSumming(allPriestSpellSections, priestSpellPoints, 'spell-points', `${priestSpellPoints}-sum`, true); setupRepeatingSpellSumming(allPriestSpellSections, 'wind', 'spell-wind', `${wind}-sum`, true); setupCalculateRemaining(`${priestSpellPoints}-total`, `${priestSpellPoints}-sum`, `${priestSpellPoints}-remaining`); diff --git a/ADnD_2E_Revised/html/changelog.html b/ADnD_2E_Revised/html/changelog.html index 065eaae948..af3afdafb2 100644 --- a/ADnD_2E_Revised/html/changelog.html +++ b/ADnD_2E_Revised/html/changelog.html @@ -11,9 +11,11 @@

  • Removed the "Roll Spell Effect" button as it caused more confusion than it helped
  • -
  • Added Spell tracking selection to the Sheet Settings Tab. Choices are: Spell slots, spell points, arcs / songs / winds
  • +
  • Added Spell tracking selection to the Sheet Settings Tab. Choices are: Spell slots, spell points, Arcs / Winds
  • Redesigned the Spells tab to only show the spell tracking system that selected on the Sheet Settings Tab
  • -
  • Styled Monster tab to have dynamically sized fields, and larger fields for Hice Dice, HP, and Max HP
  • +
  • Added autofill for bonus Winds from high Wisdom for the Arcs/Winds spell tracking system. If the PO: S&P sub ability scores are used, base Wisdom is still used for determining bonus winds
  • +
  • Fixed bonus spells from high Intuition. Willpower was incorrectly used
  • +
  • Styled Monster tab to have dynamically sized fields, and larger fields for Hit Dice, HP, and Max HP

  • diff --git a/ADnD_2E_Revised/html/tabs/character-tab/spells-tab/wizard-tab.html b/ADnD_2E_Revised/html/tabs/character-tab/spells-tab/wizard-tab.html index 5e427d5a39..d07d15f437 100644 --- a/ADnD_2E_Revised/html/tabs/character-tab/spells-tab/wizard-tab.html +++ b/ADnD_2E_Revised/html/tabs/character-tab/spells-tab/wizard-tab.html @@ -57,7 +57,7 @@ Remaining - Arc + Arcs | diff --git a/ADnD_2E_Revised/javascript/abilityScores.js b/ADnD_2E_Revised/javascript/abilityScores.js index cd4b4c6b81..7c213a0b3c 100644 --- a/ADnD_2E_Revised/javascript/abilityScores.js +++ b/ADnD_2E_Revised/javascript/abilityScores.js @@ -105,8 +105,7 @@ intelligenceTable['intnotes'] = ['INVALID INTELLIGENCE','Communicate by Grunts & const wisdomTable = {}; wisdomTable['wisdef'] = ['Error','-6','-4','-3','-2','-1','-1','-1','0','0','0','0','0','0','0','+1','+2','+3','+4','+4','+4','+4','+4','+4','+4','+4']; wisdomTable['wisbonus'] = ['Error','—','—','—','—','—','—','—','—','0','0','0','0','1st','1st','2nd','2nd','3rd','4th','1st,3rd','2nd,4th','3rd,5th','4th,5th','1st,6th','5th,6th','6th,7th']; -wisdomTable['wisbonus-prime'] = ['Error','','','','','','','','','','','','','1st','2x1st','2x1st, 2nd','2x1st, 2x2nd','2x1st, 2x2nd, 3rd','2x1st, 2x2nd, 3rd, 4th','3x1st, 2x2nd, 2x3rd, 4th','3x1st, 3x2nd, 2x3rd, 2x4th','3x1st, 3x2nd, 3x3rd, 2x4th','3x1st, 3x2nd, 3x3rd, 3x4th','4x1st, 3x2nd, 3x3rd, 3x4th','4x1st, 3x2nd, 3x3rd, 3x4th','4x1st, 3x2nd, 3x3rd, 3x4th']; -wisdomTable['wisbonus-extra'] = ['Error','','','','','','','','','','','','','','','','','','','','','5th','2x5th','2x5th, 6th','3x5th, 2x6th','3x5th, 3x6th, 7th']; +wisdomTable['wisdom-wind'] = [0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,2,3,4,5,6,7,8,9,10,11,12]; wisdomTable['wisfail'] = ['Error','80','60','50','45','40','35','30','25','20','15','10','5','0','0','0','0','0','0','0','0','0','0','0','0','0']; wisdomTable['wisimmune'] = ['Error','','','','','','','','','','','','','','','','','','','cause fear, charm person, command, friends, hypnotism','forget, hold person, ray of enfeeblement, scare','fear','charm monster, confusion, emotion, fumble, suggestion','chaos, feeblemind, hold monster, magic jar, quest','geas, mass suggestion, rod of rulership','antipathy/sympathy, death spell, mass charm']; wisdomTable['wisnotes'] = ['INVALID WISDOM','','','','','','','','','','','','','','','','','','','','','','','','','','']; diff --git a/ADnD_2E_Revised/javascript/sheetWorkers.js b/ADnD_2E_Revised/javascript/sheetWorkers.js index 4a9dd16204..d955789724 100644 --- a/ADnD_2E_Revised/javascript/sheetWorkers.js +++ b/ADnD_2E_Revised/javascript/sheetWorkers.js @@ -668,7 +668,7 @@ on('change:intelligence change:reason change:knowledge', function() { }); // Set sub-attributes based on Wisdom, Intuition, and Willpower -function parseWisBonus(abilityScore) { +function parseWisBonus(abilityScore, wisdom) { if (abilityScore < 13) { return { '1st': 0, @@ -678,6 +678,7 @@ function parseWisBonus(abilityScore) { '5th': 0, '6th': 0, '7th': 0, + 'wind': wisdomTable['wisdom-wind'][wisdom], 'wisbonus': wisdomTable['wisbonus'][abilityScore], 'wisbonus-prime': wisdomTable['wisbonus'][abilityScore], 'wisbonus-extra': wisdomTable['wisbonus'][abilityScore], @@ -699,11 +700,21 @@ function parseWisBonus(abilityScore) { '5th': (bonusString.match(/5th/g) || []).length, '6th': (bonusString.match(/6th/g) || []).length, '7th': (bonusString.match(/7th/g) || []).length, + 'wind': wisdomTable['wisdom-wind'][wisdom], }; // Generate bonus prime and bonus extra strings - bonus['wisbonus-prime'] = wisdomTable['wisbonus-prime'][abilityScore]; - bonus['wisbonus-extra'] = wisdomTable['wisbonus-extra'][abilityScore]; + function format(bonus, key) { + if (bonus[key] === 0) { + return ''; + } + if (bonus[key] === 1) { + return key + } + return `${bonus[key]}x${key}`; + } + bonus['wisbonus-prime'] = [format(bonus, '1st'), format(bonus, '2nd'), format(bonus, '3rd'), format(bonus, '4th')].filter(Boolean).join(', '); + bonus['wisbonus-extra'] = [format(bonus, '5th'), format(bonus, '6th'), format(bonus, '7th')].filter(Boolean).join(', '); bonus['wisbonus'] = [bonus['wisbonus-prime'], bonus['wisbonus-extra']].filter(Boolean).join(', '); return bonus; @@ -722,7 +733,7 @@ on('change:wisdom change:intuition change:willpower', function() { let bonusSpells; if (wisdom === 0) { - bonusSpells = parseWisBonus(0); + bonusSpells = parseWisBonus(0, 0); assignAttributes(0, 0, 0, bonusSpells, wisdomTable['wisimmune'][0], wisdomTable['wisimmune'][0], wisdomTable['wisnotes'][0], wisdomTable['wisnotes'][0]); return; } @@ -754,7 +765,7 @@ on('change:wisdom change:intuition change:willpower', function() { wisimm1 = wisImmuneArray.slice(0, slicePoint).filter(Boolean).join(', '); wisimm2 = wisImmuneArray.slice(slicePoint).filter(Boolean).join(', '); } - bonusSpells = parseWisBonus(willpower); + bonusSpells = parseWisBonus(intuition, wisdom); assignAttributes(wisdom, intuition, willpower, bonusSpells, wisimm1, wisimm2, wisnotes, wis2notes); @@ -777,6 +788,7 @@ on('change:wisdom change:intuition change:willpower', function() { 'spell-priest-level5-wisdom': bonusSpells['5th'], 'spell-priest-level6-wisdom': bonusSpells['6th'], 'spell-priest-level7-wisdom': bonusSpells['7th'], + 'wisdom-wind': bonusSpells['wind'], }); } }); @@ -935,7 +947,7 @@ function setupRepeatingSpellSumming(sections, oldField, newField, resultFieldNam } function setupCalculateRemaining(totalField, sumField, remainingField) { - on(`change:${totalField} change:${sumField}`, function () { + on(`change:${totalField} change:${sumField}`, function (eventInfo) { getAttrs([totalField, sumField], function (values) { let intTotal = parseInt(values[totalField]) || 0; let intSum = parseInt(values[sumField]) || 0; @@ -1309,6 +1321,7 @@ let priestSpellPoints = 'spell-points-priest'; let wind = 'total-wind'; let allPriestSpellSections = priestSpellLevelsSections.flatMap(sl => sl.sections); setupStaticCalculateTotal(`${priestSpellPoints}-total`, [`${priestSpellPoints}-lvl`, `${priestSpellPoints}-wis`]); +setupStaticCalculateTotal(wind, ['level-wind', 'wisdom-wind']); setupRepeatingSpellSumming(allPriestSpellSections, priestSpellPoints, 'spell-points', `${priestSpellPoints}-sum`, true); setupRepeatingSpellSumming(allPriestSpellSections, 'wind', 'spell-wind', `${wind}-sum`, true); setupCalculateRemaining(`${priestSpellPoints}-total`, `${priestSpellPoints}-sum`, `${priestSpellPoints}-remaining`);