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 to parse as a formula
|
||||||
try {
|
try {
|
||||||
const roll = new Roll(value);
|
const roll = new Roll(value);
|
||||||
return roll.evaluate({ async: false }).total;
|
return roll.evaluateSync().total;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
@ -224,7 +224,7 @@ export class DS4ActorSheet extends foundry.applications.api.DocumentSheetV2 {
|
||||||
|
|
||||||
if (check !== undefined) {
|
if (check !== undefined) {
|
||||||
const roll = new Roll("1d20");
|
const roll = new Roll("1d20");
|
||||||
const rollResult = await roll.evaluate({ async: true });
|
const rollResult = await roll.evaluate();
|
||||||
|
|
||||||
const success = rollResult.total <= check;
|
const success = rollResult.total <= check;
|
||||||
const resultText = success ? "DS4.CheckSuccess" : "DS4.CheckFailure";
|
const resultText = success ? "DS4.CheckSuccess" : "DS4.CheckFailure";
|
||||||
|
@ -236,7 +236,6 @@ export class DS4ActorSheet extends foundry.applications.api.DocumentSheetV2 {
|
||||||
target: check,
|
target: check,
|
||||||
}),
|
}),
|
||||||
content: game.i18n.localize(resultText),
|
content: game.i18n.localize(resultText),
|
||||||
type: CONST.CHAT_MESSAGE_TYPES.ROLL,
|
|
||||||
rolls: [rollResult],
|
rolls: [rollResult],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue