- Added a bit of styling to slim down scroll fields - Added scroll name to popup boxes
20 lines
1.3 KiB
Plaintext
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)) |