Adds referee screen and deities.

Updates bestiary with links to nonhuman racial modifiers.
This commit is contained in:
2023-12-10 21:25:57 -05:00
parent 744693b575
commit 9950216d30
34 changed files with 557 additions and 109 deletions

View File

@@ -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'