diff --git a/module/rdd-main.js b/module/rdd-main.js index cb47fd2e..761d6f85 100644 --- a/module/rdd-main.js +++ b/module/rdd-main.js @@ -70,7 +70,8 @@ const _patch_initiative = () => { } let compName = (armeCombat == undefined) ? "Corps à corps" : armeCombat.data.competence; competence = RdDItemCompetence.findCompetence(c.actor.data.items, compName); - rollFormula = "2+( ("+RdDUtility.calculInitiative(competence.data.niveau, c.actor.data.data.carac[competence.data.defaut_carac].value) + ")/100)"; + let bonusEcaille = (armeCombat && armeCombat.data.magique) ? armeCombat.data.ecaille_efficacite : 0; + rollFormula = "2+( ("+RdDUtility.calculInitiative(competence.data.niveau, c.actor.data.data.carac[competence.data.defaut_carac].value, bonusEcaille) + ")/100)"; } } //console.log("Combatat", c); diff --git a/module/rdd-utility.js b/module/rdd-utility.js index 42940840..5062a405 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -457,8 +457,9 @@ export class RdDUtility { } /* -------------------------------------------- */ - static calculInitiative(niveau, caracValue) { + static calculInitiative(niveau, caracValue, bonusEcaille = 0) { let base = niveau + Math.floor(caracValue / 2); + base += bonusEcaille; return "1d6" + (base >= 0 ? "+" : "") + base; }