Gestion écaille sur initiative
This commit is contained in:
parent
7ed05b3722
commit
449ec40f07
@ -70,7 +70,8 @@ const _patch_initiative = () => {
|
|||||||
}
|
}
|
||||||
let compName = (armeCombat == undefined) ? "Corps à corps" : armeCombat.data.competence;
|
let compName = (armeCombat == undefined) ? "Corps à corps" : armeCombat.data.competence;
|
||||||
competence = RdDItemCompetence.findCompetence(c.actor.data.items, compName);
|
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);
|
//console.log("Combatat", c);
|
||||||
|
@ -457,8 +457,9 @@ export class RdDUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static calculInitiative(niveau, caracValue) {
|
static calculInitiative(niveau, caracValue, bonusEcaille = 0) {
|
||||||
let base = niveau + Math.floor(caracValue / 2);
|
let base = niveau + Math.floor(caracValue / 2);
|
||||||
|
base += bonusEcaille;
|
||||||
return "1d6" + (base >= 0 ? "+" : "") + base;
|
return "1d6" + (base >= 0 ? "+" : "") + base;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user