From cf4cfe25895cc00fc2388e9200301e101d915e06 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Mon, 16 Nov 2020 23:28:18 +0100 Subject: [PATCH] Fix initiative pour les creatures/entites --- module/actor.js | 2 +- module/rdd-resolution-table.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/module/actor.js b/module/actor.js index 66d33bd0..8857c123 100644 --- a/module/actor.js +++ b/module/actor.js @@ -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) diff --git a/module/rdd-resolution-table.js b/module/rdd-resolution-table.js index 8f2e0f4b..14d68645 100644 --- a/module/rdd-resolution-table.js +++ b/module/rdd-resolution-table.js @@ -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; }