Update the macros to include a reminder and throw some extra stats into the WorldAPI

This commit is contained in:
Oliver-Akins 2025-04-03 22:19:03 -06:00
parent 5bcba4bb6a
commit 9d4704897f
7 changed files with 386 additions and 18 deletions

View file

@ -1,6 +1,6 @@
const notifStyle = `
font-size: 1.5rem;
margin-bottom: 0.5rem;
margin: 0.5rem 0;
padding: 6px 8px;
box-shadow: 0 0 10px var(--color-shadow-dark);
color: var(--color-text-light-1);
@ -15,8 +15,6 @@ const redNotif = `
background: var(--color-level-error-bg);
border: 1px solid var(--color-level-error);`;
const blueText = `color: ; filter: sepia(0.5) hue-rotate()`;
async function rollDice() {
const sidesOnDice = 6;
@ -74,15 +72,16 @@ async function rollDice() {
successes = Math.max(successes, 1);
WorldAPI?.saveRollValue?.(20, Math.min(diceCount, 20));
WorldAPI?.saveRollValue?.(100, successes === 0 ? 100 : successes);
let content = `Rolls:<div class="dice-tooltip"><ol class="dice-rolls">${results.join(`\n`)}</ol></div><hr>Successes: ${successes}<br>Crits: ${critsOnly}`;
let content = `Rolls:<div class="dice-tooltip"><ol class="dice-rolls">${results.join(`\n`)}</ol></div><hr>Gain 1 Momentum<br>Successes: ${successes}<br>Crits: ${critsOnly}`;
if (successes >= 8) {
content += `<br><br><div style="${notifStyle} ${greenNotif}">POP OFF</div> Add one to the stat you didn't use and gain 1 Momentum!`;
content += `<div style="${notifStyle} ${greenNotif}">POP OFF</div> Add one to your hobby stat and gain 1 additional Momentum!`;
}
else if (successes === 0) {
content += `<br><br><div style="${notifStyle} ${redNotif}">Pinned Down</div> Roll a d6, rescuing you becomes a new objective`;
content += `<div style="${notifStyle} ${redNotif}">Pinned Down</div> Roll a d6, rescuing you becomes a new objective`;
}