mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Standardized what gets refreshed by which refreshType (#1374)
This commit is contained in:
parent
2a622a7363
commit
14ac8977af
3 changed files with 25 additions and 9 deletions
|
|
@ -452,6 +452,23 @@ export async function waitForDiceSoNice(message) {
|
|||
}
|
||||
}
|
||||
|
||||
export function refreshIsAllowed(allowedTypes, typeToCheck) {
|
||||
switch (typeToCheck) {
|
||||
case CONFIG.DH.GENERAL.refreshTypes.scene.id:
|
||||
case CONFIG.DH.GENERAL.refreshTypes.session.id:
|
||||
case CONFIG.DH.GENERAL.refreshTypes.longRest.id:
|
||||
return allowedTypes.includes(typeToCheck);
|
||||
case CONFIG.DH.GENERAL.refreshTypes.shortRest.id:
|
||||
return allowedTypes.some(
|
||||
x =>
|
||||
x === CONFIG.DH.GENERAL.refreshTypes.shortRest.id ||
|
||||
x === CONFIG.DH.GENERAL.refreshTypes.longRest.id
|
||||
);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export async function getCritDamageBonus(formula) {
|
||||
const critRoll = new Roll(formula);
|
||||
return critRoll.dice.reduce((acc, dice) => acc + dice.faces, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue