Commandes pour jet de dés

This commit is contained in:
Vincent Vandemeulebrouck
2020-12-29 00:11:58 +01:00
parent 3e42ddd314
commit 77ed4f1482
5 changed files with 227 additions and 66 deletions

View File

@ -89,13 +89,22 @@ export class RdDResolutionTable {
}
static explainRollData(rollData) {
let message = "<br>Difficultés <strong>libre: " + rollData.diffLibre + "</strong> / conditions: " + Misc.toSignedString(rollData.diffConditions)
+ " / état: " + rollData.etat;
message += RdDResolutionTable.explain(rollData.rolled)
if (rollData.selectedCarac == rollData.carac.volonte) {
message += " / moral: " + rollData.moral;
let parts = [];
if (rollData.diffLibre != undefined) {
parts.push(`<strong>libre: ${rollData.diffLibre}</strong>`);
}
return message;
if (rollData.diffConditions != undefined) {
parts.push(`conditions: ${Misc.toSignedString(rollData.diffConditions)}`);
}
if (rollData.etat != undefined) {
parts.push(`état: ${rollData.etat}`);
}
if (rollData.selectedCarac != undefined && rollData.moral != undefined && rollData.selectedCarac.label == 'Volonté') {
parts.push(`moral: ${rollData.moral}`);
}
let message = parts.length > 0 ? "<br>Difficulté " + parts.reduce((a, b) => a + ' / ' + b) : "";
return message+ RdDResolutionTable.explain(rollData.rolled)
}
/* -------------------------------------------- */