Files
roll20-character-sheets-tester/ADnD_2E_Revised/pug/spellScrollsDatalists.pug
T
Peter Bjerg Lidegaard 3749eb78e8 - Removed duplicate spells from firefox spell list as it cannot show context
- Added a bit of styling to slim down scroll fields
- Added scroll name to popup boxes
2022-12-07 19:41:03 +01:00

20 lines
1.3 KiB
Plaintext

- function getScrollName(spellName) {return `Scroll of ${spellName}`}
- function getDisplayLevel(spell,type){let displayLevel;switch(spell.level){case"1":displayLevel="1st level";break;case"2":displayLevel="2nd level";break;case"3":displayLevel="3rd level";break;case"q":displayLevel="Quest Spell";break;default:displayLevel=`${spell.level}th level`}return displayLevel+=` ${type}`,spell.category&&(displayLevel+=`, ${spell.category}`),"PHB"!==spell.book&&(displayLevel+=`, ${spell.book}`),displayLevel}
datalist(id=`scroll-spells`)
each spell, spellName in wizardSpells['wizmonster']
option(value!=getScrollName(spellName))= getDisplayLevel(spell, 'Wizard')
each spell, spellName in priestSpells['primonster']
option(value!=getScrollName(spellName))= getDisplayLevel(spell, 'Priest')
- let processedSpells = new Set()
datalist(id=`scroll-spells-ff`)
each spell, spellName in wizardSpells['wizmonster']
if processedSpells.has(spellName)
- continue
- processedSpells.add(spellName)
option(value!=getScrollName(spellName))
each spell, spellName in priestSpells['primonster']
if processedSpells.has(spellName)
- continue
- processedSpells.add(spellName)
option(value!=getScrollName(spellName))