@@ -2,12 +2,13 @@ import { CHECK_FLAVOR, CHECK_RESULT } from './default-section-order.mjs';
22import { FUActor } from '../documents/actors/actor.mjs' ;
33import { TargetAction , Targeting } from '../helpers/targeting.mjs' ;
44import { ResourcePipeline } from '../pipelines/resource-pipeline.mjs' ;
5- import { FU } from '../helpers/config.mjs' ;
5+ import { FU , SYSTEM } from '../helpers/config.mjs' ;
66import { Flags } from '../helpers/flags.mjs' ;
77import { Pipeline } from '../pipelines/pipeline.mjs' ;
88import { TokenUtils } from '../helpers/token-utils.mjs' ;
99import { TextEditor } from '../helpers/text-editor.mjs' ;
1010import { InlineSourceInfo } from '../helpers/inline-helper.mjs' ;
11+ import { SETTINGS } from '../settings.js' ;
1112
1213/**
1314 * @param {CheckRenderData } sections
@@ -255,26 +256,25 @@ const targeted = (sections, actor, item, targets, flags, checkData = undefined,
255256 } ) ,
256257 ) ;
257258
258- if ( game . dice3d ) {
259- Hooks . once ( 'diceSoNiceRollComplete' , ( ) => {
260- for ( const target of targets ) {
261- showFloatyText ( target , target . result === 'hit' ? 'FU.Hit' : 'FU.Miss' ) ;
262- }
263- } ) ;
264- } else {
259+ function onRoll ( ) {
265260 for ( const target of targets ) {
266261 showFloatyText ( target , target . result === 'hit' ? 'FU.Hit' : 'FU.Miss' ) ;
267262 }
263+ if ( damageData && game . settings . get ( SYSTEM , SETTINGS . automationApplyDamage ) ) {
264+ setTimeout ( ( ) => {
265+ game . projectfu . socket . requestPipeline ( 'damage' , {
266+ sourceInfo : InlineSourceInfo . fromInstance ( actor , item ) ,
267+ targets,
268+ damageData,
269+ } ) ;
270+ } , 50 ) ;
271+ }
268272 }
269273
270- if ( damageData ) {
271- setTimeout ( ( ) => {
272- game . projectfu . socket . requestPipeline ( 'damage' , {
273- sourceInfo : InlineSourceInfo . fromInstance ( actor , item ) ,
274- targets,
275- damageData,
276- } ) ;
277- } , 50 ) ;
274+ if ( game . dice3d ) {
275+ Hooks . once ( 'diceSoNiceRollComplete' , onRoll ) ;
276+ } else {
277+ onRoll ( ) ;
278278 }
279279 }
280280
0 commit comments