Merge from main, with conflict fixes

This commit is contained in:
Chris Ryan 2025-12-08 21:07:44 +10:00
commit a11a2d4e30
1252 changed files with 2537 additions and 22178 deletions

View file

@ -465,3 +465,25 @@ export async function waitForDiceSoNice(message) {
await game.dice3d.waitFor3DAnimationByMessageID(message.id);
}
}
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 * dice.number, 0);
}