@@ -3,13 +3,8 @@ import AddItemDialog from "../dialog/add-item-dialog.js";
3
3
import AttackDialog from "../dialog/attack-dialog.js" ;
4
4
import { diceSound , showDice } from "../dice.js" ;
5
5
import { regenerateCharacter , regenerateNpc } from "../generator.js" ;
6
- import {
7
- ITEMS_PACK ,
8
- TABLES_PACK ,
9
- documentFromPack ,
10
- simpleData ,
11
- tableFromPack ,
12
- } from "../packutils.js" ;
6
+ import { ITEMS_PACK , TABLES_PACK } from "../packs.js" ;
7
+ import { documentFromPack , simpleData } from "../packutils.js" ;
13
8
14
9
/**
15
10
* @extends {Actor }
@@ -41,7 +36,9 @@ export class DISActor extends Actor {
41
36
vision : true ,
42
37
} ;
43
38
}
44
- mergeObject ( data . prototypeToken , defaults , { overwrite : false } ) ;
39
+ foundry . utils . mergeObject ( data . prototypeToken , defaults , {
40
+ overwrite : false ,
41
+ } ) ;
45
42
return super . create ( data , options ) ;
46
43
}
47
44
@@ -167,7 +164,7 @@ export class DISActor extends Actor {
167
164
`${ d20Formula } + @abilities.${ ability } .value` ,
168
165
this . getRollData ( )
169
166
) ;
170
- abilityRoll . evaluate ( { async : false } ) ;
167
+ await abilityRoll . evaluate ( ) ;
171
168
await showDice ( abilityRoll ) ;
172
169
173
170
const targetDR = 12 ;
@@ -296,7 +293,7 @@ export class DISActor extends Actor {
296
293
`${ d20Formula } + @abilities.${ attackAbility } .value` ,
297
294
rollData
298
295
) ;
299
- attackRoll . evaluate ( { async : false } ) ;
296
+ await attackRoll . evaluate ( ) ;
300
297
await showDice ( attackRoll ) ;
301
298
302
299
// use the active die result, in case of advantage/disadvantage
@@ -326,10 +323,10 @@ export class DISActor extends Actor {
326
323
}
327
324
damageText = `Damage: ${ damageFormula } ` ;
328
325
damageRoll = new Roll ( damageFormula ) ;
329
- damageRoll . evaluate ( { async : false } ) ;
326
+ await damageRoll . evaluate ( ) ;
330
327
// TODO: including crit die in max formula means crits are less likely to reduce target condition
331
328
const maxDamageRoll = new Roll ( damageFormula ) ;
332
- maxDamageRoll . evaluate ( { async : false , maximize : true } ) ;
329
+ await maxDamageRoll . evaluate ( { maximize : true } ) ;
333
330
const isMaxDamage = damageRoll . total == maxDamageRoll . total ;
334
331
if ( isMaxDamage ) {
335
332
maxDamageOutcome = game . i18n . localize ( "DIS.MaxDamageOutcome" ) ;
@@ -403,7 +400,7 @@ export class DISActor extends Actor {
403
400
"Morale"
404
401
) } `;
405
402
const moraleRoll = new Roll ( "2d6" ) ;
406
- moraleRoll . evaluate ( { async : false } ) ;
403
+ await moraleRoll . evaluate ( ) ;
407
404
await showDice ( moraleRoll ) ;
408
405
let moraleOutcome ;
409
406
if ( moraleRoll . total > this . system . morale ) {
@@ -433,7 +430,7 @@ export class DISActor extends Actor {
433
430
const cardTitle = `${ game . i18n . localize ( "Reaction" ) } ` ;
434
431
const reactionText = "2D6" ;
435
432
const reactionRoll = new Roll ( "2d6" ) ;
436
- reactionRoll . evaluate ( { async : false } ) ;
433
+ await reactionRoll . evaluate ( ) ;
437
434
await showDice ( reactionRoll ) ;
438
435
let reactionOutcome ;
439
436
if ( reactionRoll . total === 2 ) {
@@ -499,7 +496,7 @@ export class DISActor extends Actor {
499
496
flavor : `${ game . i18n . localize ( "DIS.VoidCorruption" ) } ?` ,
500
497
} ) ;
501
498
if ( roll . total <= this . system . voidPoints . value ) {
502
- const table = await tableFromPack ( TABLES_PACK , "Void Corruption" ) ;
499
+ const table = await documentFromPack ( TABLES_PACK , "Void Corruption" ) ;
503
500
await table . draw ( ) ;
504
501
}
505
502
}
0 commit comments