Fix initiative pour les creatures/entites

This commit is contained in:
sladecraven 2020-11-16 23:28:18 +01:00
parent 78b4eef453
commit cf4cfe2589
2 changed files with 7 additions and 1 deletions

View File

@ -122,7 +122,7 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
async performRoll(rollData) {
let rolled = await RdDResolutionTable.roll(rollData.carac, rollData.finalLevel);
let rolled = await RdDResolutionTable.roll(rollData.carac, rollData.finalLevel, true);
//rolled.isPart = true; // Pour tester le particulières
rollData.rolled = rolled; // garder le résultat
console.log("performRoll", rollData, rolled)

View File

@ -142,6 +142,7 @@ export class RdDResolutionTable {
return reussite;
}
/* -------------------------------------------- */
static _computeRow(carac) {
let dataRow = [
this._computeCell(-10, Math.max(Math.floor(carac / 4), 1)),
@ -153,6 +154,7 @@ export class RdDResolutionTable {
return dataRow;
}
/* -------------------------------------------- */
static _computeCell(niveau, percentage) {
return {
niveau: niveau,
@ -164,18 +166,22 @@ export class RdDResolutionTable {
}
}
/* -------------------------------------------- */
static _reussiteSignificative(score) {
return Math.floor(score / 2);
}
/* -------------------------------------------- */
static _reussitePart(score) {
return Math.ceil(score / 5);
}
/* -------------------------------------------- */
static _echecParticulier(score) {
return Math.ceil(score / 5) + 80;
}
/* -------------------------------------------- */
static _echecTotal(score) {
return Math.ceil(score / 10) + 91;
}