Adds referee screen and deities.
Updates bestiary with links to nonhuman racial modifiers.
This commit is contained in:
@@ -19,15 +19,28 @@ const // Scripts for the Die Roller
|
||||
if (rollerInput.value === '') rollerOutput.replaceChildren();
|
||||
});
|
||||
|
||||
// do the roll and show th (cleaned-up) result
|
||||
// do the roll(s) and show the (cleaned-up) result(s)
|
||||
rollerForm.addEventListener('submit', (e) => {
|
||||
e.preventDefault();
|
||||
if (!window.dice) return;
|
||||
|
||||
const newEl = document.createElement('li');
|
||||
const result = dice.roll(rollerInput.value);
|
||||
newEl.innerText = `${dice.stringify(result)
|
||||
.replaceAll('!!!mods listing not yet complete!!!', '')} = ${+result}`;
|
||||
const newEl = document.createElement('li'),
|
||||
// support multiple sets of dice
|
||||
rolls = rollerInput.value.split(/,\s+/);
|
||||
|
||||
newEl.innerText = rolls
|
||||
.map((roll) => {
|
||||
const result = dice.roll(roll),
|
||||
stringifiedResult = dice.stringify(result);
|
||||
return `${stringifiedResult.replaceAll(
|
||||
'!!!mods listing not yet complete!!!',
|
||||
''
|
||||
)}${
|
||||
// only show total if there's multiple dice thrown in a set
|
||||
stringifiedResult.includes(',') ? ` = ${+result}` : ''
|
||||
}`;
|
||||
})
|
||||
.join(', ');
|
||||
rollerOutput.prepend(newEl);
|
||||
});
|
||||
|
||||
@@ -36,7 +49,6 @@ const // Scripts for the Die Roller
|
||||
if (event.key === 'Escape') rollerForm.reset();
|
||||
});
|
||||
},
|
||||
|
||||
// Scripts for the Complication Randomizers
|
||||
shuffleContainer = (parent) => {
|
||||
const container = document.getElementById(parent),
|
||||
@@ -48,7 +60,6 @@ const // Scripts for the Die Roller
|
||||
shuffled.sort(() => 0.5 - Math.random());
|
||||
for (let i = 0; i < length; i++) container.appendChild(shuffled[i]);
|
||||
},
|
||||
|
||||
addComplicationForm = () => {
|
||||
const complicationForm = document.getElementById('js-complicationForm');
|
||||
complicationForm.addEventListener('submit', (e) => {
|
||||
@@ -56,7 +67,6 @@ const // Scripts for the Die Roller
|
||||
shuffleContainer('js-complicationList');
|
||||
});
|
||||
},
|
||||
|
||||
addAstralComplicationForm = () => {
|
||||
const complicationForm = document.getElementById(
|
||||
'js-astralComplicationForm'
|
||||
|
Reference in New Issue
Block a user