update timeline to latest info

add mimic and minotaur
This commit is contained in:
2024-01-01 13:53:47 -05:00
parent 9950216d30
commit 37779ddba3
27 changed files with 362 additions and 98 deletions

View File

@@ -23,8 +23,8 @@
<li>10</li>
<li>11</li>
<li>12</li>
<li class="currDay">13</li>
<li>14</li>
<li>13</li>
<li class="currDay">14</li>
<li>15</li>
<li>16</li>
<li>17</li>

View File

@@ -1,5 +1,5 @@
<div class="todayWrapper">
As of last session, it is **near the middle of the 2nd shift of the 2nd phase of the 13th day of Urtson-Nu, in year 5023 of the Common Astral Calendar**.
As of last session, it is **near the middle of the 2nd shift of the 1st phase of 14th day <!--3rd Aerday --> Urtson-Nu, in year 5023 of the Common Astral Calendar**.
</div>

View File

@@ -8,49 +8,91 @@
* https://www.itsericwoodward.com/licenses/mit
****************************************************************************/
const // Scripts for the Die Roller
addRollerForm = () => {
const rollerForm = document.getElementById('js-rollerForm'),
rollerInput = document.getElementById('js-rollerInput'),
rollerOutput = document.getElementById('js-rollerOutput');
// Die Roller script
const addRollerForm = () => {
const rollerForm = document.getElementById('js-rollerForm'),
rollerInput = document.getElementById('js-rollerInput'),
rollerOutput = document.getElementById('js-rollerOutput');
// double-click [x] to clear list
rollerForm.addEventListener('reset', (e) => {
if (rollerInput.value === '') rollerOutput.replaceChildren();
});
// double-click [x] to clear list
rollerForm.addEventListener('reset', (e) => {
if (rollerInput.value === '') rollerOutput.replaceChildren();
});
// do the roll(s) and show the (cleaned-up) result(s)
rollerForm.addEventListener('submit', (e) => {
// 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'),
// 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);
});
// clear on escape key
rollerForm.addEventListener('keydown', (event) => {
if (event.key === 'Escape') rollerForm.reset();
});
};
// Dungeon room populator
const RoomTypes = {
EMPTY: 2,
MONSTER: 4,
SPECIAL: 5,
TRAP: 6,
},
getRoomType = (room = 1) => {
if (room <= RoomTypes.EMPTY) return 'Empty';
if (room <= RoomTypes.MONSTER) return 'Monster';
if (room <= RoomTypes.SPECIAL) return 'Special';
return 'Trap';
},
checkForTreasure = (room = 1, treasure = 1) => {
if (room <= RoomTypes.EMPTY) return treasure <= 1;
if (room <= RoomTypes.MONSTER) return treasure <= 3;
if (room <= RoomTypes.SPECIAL) return false;
return treasure <= 2;
},
getRandomValue = (max = 1, min = 1) =>
Math.round(Math.random() * (max - min)) + min,
addRoomForm = () => {
const roomForm = document.getElementById('js-roomForm'),
roomOutput = document.getElementById('js-roomOutput');
roomForm.addEventListener('submit', (e) => {
e.preventDefault();
if (!window.dice) return;
const newEl = document.createElement('li'),
// support multiple sets of dice
rolls = rollerInput.value.split(/,\s+/);
roomVal = getRandomValue(6),
treasureVal = getRandomValue(6),
roomType = getRoomType(roomVal),
hasTreasure = checkForTreasure(roomVal, treasureVal);
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);
newEl.innerText = `${roomType}${
hasTreasure ? ' (Treasure)' : ''
} {${roomVal},${treasureVal}}`;
roomOutput.prepend(newEl);
});
};
// clear on escape key
rollerForm.addEventListener('keydown', (event) => {
if (event.key === 'Escape') rollerForm.reset();
});
},
// Scripts for the Complication Randomizers
shuffleContainer = (parent) => {
// Complication Randomizer scripts
const shuffleContainer = (parent) => {
const container = document.getElementById(parent),
children = container.children,
length = children.length,
@@ -79,6 +121,7 @@ const // Scripts for the Die Roller
export default (() => {
addRollerForm();
addRoomForm();
addComplicationForm();
addAstralComplicationForm();
})();

View File

@@ -301,6 +301,10 @@ table th {
max-width: 28rem;
}
.calendarWrapper h4 {
text-align: center;
}
.calendarWrapper li {
padding: .5rem;
}