From df288f539a28030b398b14ceba9f0922bc7dba87 Mon Sep 17 00:00:00 2001 From: Peter Bjerg Lidegaard Date: Tue, 16 Jan 2024 18:39:43 +0100 Subject: [PATCH] Added setup for reversible spells for priest --- ADnD_2E_Revised/2ESheet.html | 9 ++++++--- ADnD_2E_Revised/javascript/priestSpells.js | 7 ++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ADnD_2E_Revised/2ESheet.html b/ADnD_2E_Revised/2ESheet.html index 5564bd17f991..9f26c65820ef 100644 --- a/ADnD_2E_Revised/2ESheet.html +++ b/ADnD_2E_Revised/2ESheet.html @@ -55508,8 +55508,6 @@

Monster Sheet specific

} } -console.log() - wizardSpells['wizmonster'] = wizmonster; /* ---- Wizard spells end ---- */ /* ---- Priest spells start ---- */ @@ -64299,13 +64297,18 @@

Monster Sheet specific

priestSpells['priq'] = priq; const primonster = {}; -for (const [_, section] of Object.entries(priestSpells)) { +for (const [spellLevel, section] of Object.entries(priestSpells)) { for (const [spellName, spell] of Object.entries(section)) { let name = spellName; if (spellName === 'Fortify' && spell.book === 'Player\'s Option: Spells & Magic') { name += " (S&M)"; } primonster[name] = spell; + if (spell['reversible']) { + let reverseSpellName = `${spell['reversible']} (Reverse of ${spellName})`; + priestSpells[spellLevel][reverseSpellName] = spell; + primonster[reverseSpellName] = spell; + } } } priestSpells['primonster'] = primonster; diff --git a/ADnD_2E_Revised/javascript/priestSpells.js b/ADnD_2E_Revised/javascript/priestSpells.js index 4961bd22efa1..e30943874142 100644 --- a/ADnD_2E_Revised/javascript/priestSpells.js +++ b/ADnD_2E_Revised/javascript/priestSpells.js @@ -8785,13 +8785,18 @@ priestSpells['pri7'] = pri7; priestSpells['priq'] = priq; const primonster = {}; -for (const [_, section] of Object.entries(priestSpells)) { +for (const [spellLevel, section] of Object.entries(priestSpells)) { for (const [spellName, spell] of Object.entries(section)) { let name = spellName; if (spellName === 'Fortify' && spell.book === 'Player\'s Option: Spells & Magic') { name += " (S&M)"; } primonster[name] = spell; + if (spell['reversible']) { + let reverseSpellName = `${spell['reversible']} (Reverse of ${spellName})`; + priestSpells[spellLevel][reverseSpellName] = spell; + primonster[reverseSpellName] = spell; + } } } priestSpells['primonster'] = primonster;