add short rest and long rest actions to dying simulator

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main
Matthew Huntington 1 month ago
parent 12fbdcb24d
commit 7667fee91e

@ -785,6 +785,57 @@ flowchart TD
return { msg: 'You are slain instantly by a death effect. These abilities bypass the normal dying progression &mdash; if they reduce you to 0 HP you die without reaching dying 4. Some kill outright without dealing damage at all.' };
},
},
{
name: 'Short Rest (10 min)',
hint: simWounded > 0 ? 'Treat Wounds \u2014 Medicine check to clear Wounded ' + simWounded : 'No Wounded condition to treat',
needsRoll: simWounded > 0,
rollLabel: 'Treat Wounds \u2014 Medicine check result:',
getOutcomes: function() {
var prev = simWounded;
return [
{ label: '&#x2713; Success \u2014 Wounded ' + prev + ' clears',
action: function() {
simWounded = 0; renderCondVals();
simHistory.push({ state: 'ALIVE', dying: 0, via: 'Short Rest' });
return { msg: 'Treat Wounds succeeds. Your <strong>Wounded&nbsp;' + prev + '</strong> condition is cleared.' };
}
},
{ label: '&#x2717; Failure \u2014 Wounded ' + prev + ' remains',
action: function() {
simHistory.push({ state: 'ALIVE', dying: 0, via: 'Short Rest' });
return { msg: 'Treat Wounds fails. Your <strong>Wounded&nbsp;' + prev + '</strong> condition remains.' };
}
},
];
},
action: function() {
simHistory.push({ state: 'ALIVE', dying: 0, via: 'Short Rest' });
return { msg: 'You rest for 10 minutes. You have no Wounded condition to treat.' };
},
},
{
name: 'Long Rest (full night)',
hint: 'Doomed \u22121; Wounded clears (restored to full HP during rest)',
needsRoll: false,
action: function() {
var parts = [];
if (simDoomed > 0) {
simDoomed -= 1;
parts.push('Doomed decreases by 1 (now <strong>Doomed&nbsp;' + simDoomed + '</strong>).');
} else {
parts.push('Doomed is already 0.');
}
if (simWounded > 0) {
var prev = simWounded; simWounded = 0;
parts.push('Wounded&nbsp;' + prev + ' clears (restored to full HP and rested).');
} else {
parts.push('No Wounded condition to clear.');
}
renderCondVals();
simHistory.push({ state: 'ALIVE', dying: 0, via: 'Long Rest' });
return { msg: parts.join(' ') };
},
},
];
if (simState === 'DYING') {
@ -886,6 +937,26 @@ flowchart TD
return { msg: 'You are awoken &mdash; by a loud noise (Perception check vs DC&nbsp;5 for battle), an ally using an Interact action, healing, or damage that doesn\u2019t reduce you to 0 HP. You lose the unconscious condition.' };
},
},
{
name: 'Long Rest (full night)',
hint: 'Wake at full HP; Doomed \u22121; Wounded clears',
needsRoll: false,
action: function() {
simState = 'ALIVE'; simDying = 0;
var parts = ['You wake fully rested and restored to full HP.'];
if (simDoomed > 0) {
simDoomed -= 1;
parts.push('Doomed decreases by 1 (now <strong>Doomed&nbsp;' + simDoomed + '</strong>).');
}
if (simWounded > 0) {
var prev = simWounded; simWounded = 0;
parts.push('Wounded&nbsp;' + prev + ' clears.');
}
renderCondVals();
simHistory.push({ state: 'ALIVE', dying: 0, via: 'Long Rest' });
return { msg: parts.join(' ') };
},
},
{
name: 'Take Lethal Damage (to 0 HP)',
hint: 'Damage while at 0 HP \u2014 gain dying condition (+W)',

Loading…
Cancel
Save