@@ -414,7 +414,15 @@ export class DemonlordActor extends Actor {
414
414
// if !target -> ui.notifications.warn(Please select target) ??
415
415
416
416
// Attack modifier and Boons/Banes
417
- const modifiers = [ attacker . system ?. attributes [ attackAttribute ] ?. modifier || 0 , parseInt ( inputModifier ) || 0 ]
417
+ const modifiers = [
418
+ item . system . action ?. rollbonus || 0 ,
419
+ attacker . system ?. attributes [ attackAttribute ] ?. modifier || 0 ,
420
+ attacker . system ?. bonuses . attack . modifier [ attackAttribute ] || 0 ,
421
+ attacker . system ?. bonuses . attack . modifier . all || 0 ,
422
+ attacker . system ?. bonuses . attack . modifier . weapon || 0 ,
423
+ parseInt ( inputModifier ) || 0 ,
424
+ ]
425
+
418
426
let boons =
419
427
( parseInt ( item . system . action . boonsbanes ) || 0 ) +
420
428
( parseInt ( inputBoons ) || 0 ) +
@@ -451,19 +459,22 @@ export class DemonlordActor extends Actor {
451
459
return attackRoll ?. total >= targetNumber
452
460
} )
453
461
454
- for ( let effect of this . appliedEffects ) {
455
- const specialDuration = foundry . utils . getProperty ( effect , 'flags.specialDuration' )
456
- // if (!(specialDuration?.length > 0)) continue
457
- if ( specialDuration === 'NextD20Roll' ) {
458
- let nAttackAttribute = attackAttribute . length ? attackAttribute : 'None'
459
- if (
460
- effect . changes . find ( e => e . key . includes ( 'system.bonuses.attack.boons.all' ) ) || ! effect . changes . length ||
461
- effect . changes . find ( e => e . key . includes ( `system.bonuses.attack.boons.${ nAttackAttribute } ` ) ) ||
462
- effect . changes . find ( e => e . key . includes ( `system.bonuses.attack.boons.weapon` ) )
463
- )
464
- await effect ?. delete ( )
465
- }
466
- }
462
+ for ( let effect of this . appliedEffects ) {
463
+ const specialDuration = foundry . utils . getProperty ( effect , 'flags.specialDuration' )
464
+ // if (!(specialDuration?.length > 0)) continue
465
+ if ( specialDuration === 'NextD20Roll' ) {
466
+ let nAttackAttribute = attackAttribute . length ? attackAttribute : 'None'
467
+ if (
468
+ effect . changes . find ( e => e . key . includes ( 'system.bonuses.attack.boons.all' ) ) || ! effect . changes . length ||
469
+ effect . changes . find ( e => e . key . includes ( `system.bonuses.attack.boons.${ nAttackAttribute } ` ) ) ||
470
+ effect . changes . find ( e => e . key . includes ( `system.bonuses.attack.boons.weapon` ) ) ||
471
+ effect . changes . find ( e => e . key . includes ( 'system.bonuses.attack.modifier.all' ) ) || ! effect . changes . length ||
472
+ effect . changes . find ( e => e . key . includes ( `system.bonuses.attack.modifier.${ nAttackAttribute } ` ) ) ||
473
+ effect . changes . find ( e => e . key . includes ( `system.bonuses.attack.modifier.weapon` ) )
474
+ )
475
+ await effect ?. delete ( )
476
+ }
477
+ }
467
478
468
479
Hooks . call ( 'DL.RollAttack' , {
469
480
sourceToken : attacker . token || tokenManager . getTokenByActorId ( attacker . id ) ,
@@ -594,8 +605,15 @@ export class DemonlordActor extends Actor {
594
605
595
606
const attackAttribute = talentData . action . attack . toLowerCase ( )
596
607
const defenseAttribute = talentData . action ?. attack ?. toLowerCase ( )
608
+ const attacker = this
597
609
598
- let modifiers = [ parseInt ( inputModifier ) , this . getAttribute ( attackAttribute ) ?. modifier || 0 ]
610
+ const modifiers = [
611
+ talentData . action ?. rollbonus || 0 ,
612
+ attacker . system ?. attributes [ attackAttribute ] ?. modifier || 0 ,
613
+ attacker . system ?. bonuses . attack . modifier [ attackAttribute ] || 0 ,
614
+ attacker . system ?. bonuses . attack . modifier . all || 0 ,
615
+ parseInt ( inputModifier ) || 0 ,
616
+ ]
599
617
600
618
let boons =
601
619
( parseInt ( inputBoons ) || 0 ) +
@@ -623,7 +641,9 @@ export class DemonlordActor extends Actor {
623
641
let nAttackAttribute = attackAttribute . length ? attackAttribute : 'None'
624
642
if (
625
643
effect . changes . find ( e => e . key . includes ( 'system.bonuses.attack.boons.all' ) ) || ! effect . changes . length ||
626
- effect . changes . find ( e => e . key . includes ( `system.bonuses.attack.boons.${ nAttackAttribute } ` ) )
644
+ effect . changes . find ( e => e . key . includes ( `system.bonuses.attack.boons.${ nAttackAttribute } ` ) ) ||
645
+ effect . changes . find ( e => e . key . includes ( 'system.bonuses.attack.modifier.all' ) ) || ! effect . changes . length ||
646
+ effect . changes . find ( e => e . key . includes ( `system.bonuses.attack.modifier.${ nAttackAttribute } ` ) )
627
647
)
628
648
await effect ?. delete ( )
629
649
}
@@ -683,9 +703,20 @@ export class DemonlordActor extends Actor {
683
703
684
704
let attackRoll
685
705
if ( attackAttribute ) {
706
+ const attacker = this
707
+
708
+ const modifiers = [
709
+ spellData . action ?. rollbonus || 0 ,
710
+ attacker . system ?. attributes [ attackAttribute ] ?. modifier || 0 ,
711
+ attacker . system ?. bonuses . attack . modifier [ attackAttribute ] || 0 ,
712
+ attacker . system ?. bonuses . attack . modifier . all || 0 ,
713
+ attacker . system ?. bonuses . attack . modifier . spell || 0 ,
714
+ parseInt ( inputModifier ) || 0 ,
715
+ ]
716
+
686
717
let boons =
687
718
( parseInt ( inputBoons ) || 0 ) +
688
- ( parseInt ( spellData . action . boonsbanes ) || 0 ) +
719
+ ( parseInt ( spellData . action ? .boonsbanes ) || 0 ) +
689
720
( this . system . bonuses . attack . boons [ attackAttribute ] || 0 ) +
690
721
( this . system . bonuses . attack . boons . all || 0 ) +
691
722
( this . system . bonuses . attack . boons . spell || 0 )
@@ -700,7 +731,6 @@ export class DemonlordActor extends Actor {
700
731
( target ?. actor ?. system . bonuses . defense . boons . spell || 0 ) +
701
732
( horrifyingBane && ignoreLevelDependentBane && ! this . system . horrifying && ! this . system . frightening && target ?. actor ?. system . horrifying && 1 || 0 )
702
733
703
- const modifiers = [ parseInt ( inputModifier ) || 0 , this . getAttribute ( attackAttribute ) . modifier || 0 ]
704
734
const boonsReroll = parseInt ( this . system . bonuses . rerollBoon1Dice )
705
735
706
736
attackRoll = new Roll ( this . rollFormula ( modifiers , boons , boonsReroll ) , this . system )
@@ -724,7 +754,10 @@ export class DemonlordActor extends Actor {
724
754
if (
725
755
effect . changes . find ( e => e . key . includes ( 'system.bonuses.attack.boons.all' ) ) || ! effect . changes . length ||
726
756
effect . changes . find ( e => e . key . includes ( `system.bonuses.attack.boons.${ nAttackAttribute } ` ) ) ||
727
- effect . changes . find ( e => e . key . includes ( `system.bonuses.attack.boons.spell` ) )
757
+ effect . changes . find ( e => e . key . includes ( `system.bonuses.attack.boons.spell` ) ) ||
758
+ effect . changes . find ( e => e . key . includes ( 'system.bonuses.attack.modifier.all' ) ) || ! effect . changes . length ||
759
+ effect . changes . find ( e => e . key . includes ( `system.bonuses.attack.modifier.${ nAttackAttribute } ` ) ) ||
760
+ effect . changes . find ( e => e . key . includes ( `system.bonuses.attack.modifier.spell` ) )
728
761
)
729
762
await effect ?. delete ( )
730
763
}
@@ -800,8 +833,15 @@ export class DemonlordActor extends Actor {
800
833
} else {
801
834
const attackAttribute = itemData . action . attack . toLowerCase ( )
802
835
const defenseAttribute = itemData . action ?. attack ?. toLowerCase ( )
836
+ const attacker = this
803
837
804
- let modifiers = [ parseInt ( inputModifier ) , ( this . getAttribute ( attackAttribute ) ?. modifier || 0 ) ]
838
+ const modifiers = [
839
+ item . system . action . rollbonus || 0 ,
840
+ attacker . system ?. attributes [ attackAttribute ] ?. modifier || 0 ,
841
+ attacker . system ?. bonuses . attack . modifier [ attackAttribute ] || 0 ,
842
+ attacker . system ?. bonuses . attack . modifier . all || 0 ,
843
+ parseInt ( inputModifier ) || 0 ,
844
+ ]
805
845
806
846
let boons =
807
847
( parseInt ( inputBoons ) || 0 ) +
@@ -829,7 +869,9 @@ export class DemonlordActor extends Actor {
829
869
let nAttackAttribute = attackAttribute . length ? attackAttribute : 'None'
830
870
if (
831
871
effect . changes . find ( e => e . key . includes ( 'system.bonuses.attack.boons.all' ) ) || ! effect . changes . length ||
832
- effect . changes . find ( e => e . key . includes ( `system.bonuses.attack.boons.${ nAttackAttribute } ` ) )
872
+ effect . changes . find ( e => e . key . includes ( `system.bonuses.attack.boons.${ nAttackAttribute } ` ) ) ||
873
+ effect . changes . find ( e => e . key . includes ( 'system.bonuses.attack.modifier.all' ) ) || ! effect . changes . length ||
874
+ effect . changes . find ( e => e . key . includes ( `system.bonuses.attack.modifier.${ nAttackAttribute } ` ) )
833
875
)
834
876
await effect ?. delete ( )
835
877
}
0 commit comments