From da6db4d38c9f0ebae716dd0f618d65569102fee8 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Tue, 15 Dec 2020 23:54:09 +0100 Subject: [PATCH] =?UTF-8?q?#56=20Afficher=20valeur=20r=C3=A9ussites?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/rdd-resolution-table.js | 14 ++++++++++++++ module/rdd-roll.js | 2 ++ templates/dialog-competence.html | 6 ++++-- templates/dialog-roll-carac.html | 5 +++-- templates/dialog-roll-ethylisme.html | 2 ++ templates/dialog-roll-sort.html | 3 ++- 6 files changed, 27 insertions(+), 5 deletions(-) diff --git a/module/rdd-resolution-table.js b/module/rdd-resolution-table.js index 395f7c19..a2d3acf5 100644 --- a/module/rdd-resolution-table.js +++ b/module/rdd-resolution-table.js @@ -155,6 +155,7 @@ export class RdDResolutionTable { return rollData.rolled.isEchec; } + /* -------------------------------------------- */ static isEchecTotal(rollData) { if (rollData.arme && rollData.surprise == 'demi') { return rollData.rolled.isEchec; @@ -162,6 +163,7 @@ export class RdDResolutionTable { return rollData.rolled.isETotal; } + /* -------------------------------------------- */ static isParticuliere(rollData) { if (rollData.arme && rollData.surprise) { return false; @@ -169,6 +171,7 @@ export class RdDResolutionTable { return rollData.rolled.isPart; } + /* -------------------------------------------- */ static isReussite(rollData) { switch (rollData.surprise) { case 'demi': return rollData.rolled.isSign; @@ -235,6 +238,17 @@ export class RdDResolutionTable { return Math.ceil(score / 10) + 91; } + /* -------------------------------------------- */ + static buildHTMLResults( caracValue, levelValue) { + let cell = this.computeChances( caracValue, levelValue); + let descr = $(''); + descr.append("Réussite : "+cell.score+ " - Particulière : " + cell.part + " - Significative : " + cell.sign); + descr.append("
Echec Particulier : " + cell.epart + " - Echec Total : " + cell.etotal ); + descr.append("
"); + + return descr; + } + /* -------------------------------------------- */ static buildHTMLTableExtract(caracValue, levelValue) { return this.buildHTMLTable(caracValue, levelValue, caracValue - 2, caracValue + 2, levelValue - 5, levelValue + 5) diff --git a/module/rdd-roll.js b/module/rdd-roll.js index da037010..526a3d70 100644 --- a/module/rdd-roll.js +++ b/module/rdd-roll.js @@ -124,6 +124,8 @@ export class RdDRoll extends Dialog { $("#compdialogTitle").text(RdDRoll._getTitle(rollData)); $(".table-resolution").remove(); $("#resolutionTable").append(RdDResolutionTable.buildHTMLTableExtract(caracValue, rollLevel)); + $(".span-valeur").remove(); + $("#resolutionValeurs").append(RdDResolutionTable.buildHTMLResults(caracValue, rollLevel)); } // Setup everything onload diff --git a/templates/dialog-competence.html b/templates/dialog-competence.html index d42ba2c7..67a5e024 100644 --- a/templates/dialog-competence.html +++ b/templates/dialog-competence.html @@ -51,9 +51,11 @@
   
-
- +
+
+
+