#56 Afficher valeur réussites
This commit is contained in:
parent
2097907f91
commit
da6db4d38c
@ -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 = $('<span class="span-valeur competence-label">');
|
||||
descr.append("Réussite : "+cell.score+ " - Particulière : " + cell.part + " - Significative : " + cell.sign);
|
||||
descr.append("<br>Echec Particulier : " + cell.epart + " - Echec Total : " + cell.etotal );
|
||||
descr.append("</span>");
|
||||
|
||||
return descr;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static buildHTMLTableExtract(caracValue, levelValue) {
|
||||
return this.buildHTMLTable(caracValue, levelValue, caracValue - 2, caracValue + 2, levelValue - 5, levelValue + 5)
|
||||
|
@ -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
|
||||
|
@ -52,8 +52,10 @@
|
||||
<label>Ajustement final : </label><label id="roll-param">10 / 0</label> <label name="addon-message" id="addon-message"></label>
|
||||
</div>
|
||||
<div id="resolutionTable">
|
||||
|
||||
</div>
|
||||
<div id="resolutionValeurs">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<script>
|
||||
|
@ -26,7 +26,8 @@
|
||||
<label>Ajustement final : </label><label id="roll-param">10 / 0</label> <label name="addon-message" id="addon-message"></label>
|
||||
</div>
|
||||
<div id="resolutionTable">
|
||||
|
||||
</div>
|
||||
<div id="resolutionValeurs">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
@ -23,5 +23,7 @@
|
||||
|
||||
<div id="resolutionTable">
|
||||
</div>
|
||||
<div id="resolutionValeurs">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
@ -66,7 +66,8 @@
|
||||
<label>Ajustement final : </label><label id="roll-param">10 / 0</label> <label name="addon-message" id="addon-message"></label>
|
||||
</div>
|
||||
<div id="resolutionTable">
|
||||
|
||||
</div>
|
||||
<div id="resolutionValeurs">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user