@@ -226,6 +226,18 @@ export class CombatAttackDialog extends FormApplication {
226226 this . render ( true ) ;
227227 }
228228
229+ // Helper: get base dice formula from actor settings
230+ getBaseCombatDiceFormula ( actor ) {
231+ const diceSettings = actor . system . general . diceSettings ;
232+ return diceSettings ?. abilityDie . value ?? '1d100xa' ;
233+ }
234+
235+ // Helper: remove first dice term when rolling "withoutRoll"
236+ removeFirstDiceTerm ( formula ) {
237+ // Replace everything hasta el primer '+' por '0'
238+ return formula . replace ( / ^ [ ^ + ] + / , '0' ) ;
239+ }
240+
229241 static get defaultOptions ( ) {
230242 return foundry . utils . mergeObject ( super . defaultOptions , {
231243 classes : [ 'animabf-dialog combat-attack-dialog no-close' ] ,
@@ -335,9 +347,13 @@ export class CombatAttackDialog extends FormApplication {
335347 for ( const key in attackerCombatMod )
336348 combatModifier += attackerCombatMod [ key ] ?. value ?? 0 ;
337349
338- let formula = `1d100xa + ${ counterAttackBonus } + ${ attack } + ${ combatModifier } ` ;
339- if ( this . modalData . attacker . withoutRoll )
340- formula = formula . replace ( '1d100xa' , '0' ) ;
350+ const baseDice = this . getBaseCombatDiceFormula ( this . attackerActor ) ;
351+ let formula = `${ baseDice } + ${ counterAttackBonus } + ${ attack } + ${ combatModifier } ` ;
352+
353+ if ( this . modalData . attacker . withoutRoll ) {
354+ formula = this . removeFirstDiceTerm ( formula ) ;
355+ }
356+
341357 if ( this . attackerActor . system . combat . attack . base . value >= 200 ) {
342358 formula = formula . replace ( 'xa' , 'xamastery' ) ;
343359 }
@@ -364,7 +380,8 @@ export class CombatAttackDialog extends FormApplication {
364380
365381 // New fields
366382 const reducedArmorFinal = weapon ?. system ?. reducedArmor ?. final ?. value ?? 0 ;
367- const weaponName = weapon ?. name ?? game . i18n . localize ( 'macros.combat.unarmed' ) ?? 'Unarmed' ;
383+ const weaponName =
384+ weapon ?. name ?? game . i18n . localize ( 'macros.combat.unarmed' ) ?? 'Unarmed' ;
368385
369386 const critic = criticSelected ?? game . animabf . weapon . WeaponCritic . IMPACT ;
370387
0 commit comments