feat: update Roll evaluation methods
This commit is contained in:
parent
bfbd327e51
commit
9ed959337d
1 changed files with 2 additions and 3 deletions
|
@ -204,7 +204,7 @@ export class DS4ActorSheet extends foundry.applications.api.DocumentSheetV2 {
|
|||
// Try to parse as a formula
|
||||
try {
|
||||
const roll = new Roll(value);
|
||||
return roll.evaluate({ async: false }).total;
|
||||
return roll.evaluateSync().total;
|
||||
} catch (error) {
|
||||
return value;
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ export class DS4ActorSheet extends foundry.applications.api.DocumentSheetV2 {
|
|||
|
||||
if (check !== undefined) {
|
||||
const roll = new Roll("1d20");
|
||||
const rollResult = await roll.evaluate({ async: true });
|
||||
const rollResult = await roll.evaluate();
|
||||
|
||||
const success = rollResult.total <= check;
|
||||
const resultText = success ? "DS4.CheckSuccess" : "DS4.CheckFailure";
|
||||
|
@ -236,7 +236,6 @@ export class DS4ActorSheet extends foundry.applications.api.DocumentSheetV2 {
|
|||
target: check,
|
||||
}),
|
||||
content: game.i18n.localize(resultText),
|
||||
type: CONST.CHAT_MESSAGE_TYPES.ROLL,
|
||||
rolls: [rollResult],
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue