@@ -10,7 +10,6 @@ import { CommonSections } from '../../../checks/common-sections.mjs';
1010import { ItemPartialTemplates } from '../item-partial-templates.mjs' ;
1111import { TraitUtils } from '../../../pipelines/traits.mjs' ;
1212import { BaseSkillDataModel } from '../skill/base-skill-data-model.mjs' ;
13- import { ExpressionContext } from '../../../expressions/expressions.mjs' ;
1413import { CommonEvents } from '../../../checks/common-events.mjs' ;
1514
1615const skillForAttributeCheck = 'skillForAttributeCheck' ;
@@ -46,17 +45,17 @@ Hooks.on(CheckHooks.renderCheck, onRenderAccuracyCheck);
4645/**
4746 * @type RenderCheckHook
4847 */
49- let onRenderAttributeCheck = async ( sections , check , actor , item , flags ) => {
48+ let onRenderAttributeCheck = async ( data , check , actor , item , flags ) => {
5049 if ( check . type === 'attribute' && item ?. system instanceof MiscAbilityDataModel && check . additionalData [ skillForAttributeCheck ] ) {
5150 const inspector = CheckConfiguration . inspect ( check ) ;
5251 const ability = await fromUuid ( inspector . getWeaponReference ( ) ) ;
53- CommonSections . itemFlavor ( sections , ability ) ;
52+ CommonSections . itemFlavor ( data . sections , ability ) ;
5453 if ( check . critical ) {
55- CommonSections . opportunity ( sections , ability . system . opportunity , CHECK_DETAILS ) ;
54+ CommonSections . opportunity ( data . sections , ability . system . opportunity , CHECK_DETAILS ) ;
5655 }
57- CommonSections . description ( sections , ability . system . description , ability . system . summary . value , CHECK_DETAILS , true ) ;
56+ CommonSections . description ( data . sections , ability . system . description , ability . system . summary . value , CHECK_DETAILS , true ) ;
5857 if ( ability . system . hasClock . value ) {
59- CommonSections . clock ( sections , item . system . progress , CHECK_DETAILS ) ;
58+ CommonSections . clock ( data . sections , item . system . progress , CHECK_DETAILS ) ;
6059 }
6160 }
6261} ;
@@ -157,7 +156,7 @@ export class MiscAbilityDataModel extends BaseSkillDataModel {
157156 secondary : this . attributes . secondary ,
158157 } ,
159158 this . parent ,
160- this . #initializeAttributeCheck( ) ,
159+ this . #initializeAttributeCheck( modifiers ) ,
161160 ) ;
162161 }
163162 }
@@ -179,11 +178,9 @@ export class MiscAbilityDataModel extends BaseSkillDataModel {
179178 /**
180179 * @return {CheckCallback }
181180 */
182- #initializeAttributeCheck( ) {
181+ #initializeAttributeCheck( modifiers ) {
183182 return async ( check , actor , item ) => {
184- const config = CheckConfiguration . configure ( check ) ;
185- await this . configureAttributeCheck ( config , actor , item ) ;
186- config . setWeaponReference ( this . parent ) ;
183+ await this . configureAttributeCheck ( modifiers , check , actor , item ) ;
187184 } ;
188185 }
189186
@@ -210,13 +207,7 @@ export class MiscAbilityDataModel extends BaseSkillDataModel {
210207 check . primary = weaponCheck . primary ;
211208 check . secondary = weaponCheck . secondary ;
212209
213- const config = CheckConfiguration . configure ( check ) ;
214- const targets = config . getTargets ( ) ;
215- const context = ExpressionContext . fromTargetData ( actor , item , targets ) ;
216- config . setWeaponReference ( weapon ) ;
217- await this . configureCheck ( config ) ;
218- await this . addSkillAccuracy ( config , actor , item , context ) ;
219- await this . addSkillDamage ( config , item , context , weapon . system ) ;
210+ return this . configureAccuracyCheck ( modifiers , check , actor , item , weapon ) ;
220211 } ;
221212 }
222213
0 commit comments