Explications des difficultés de jets

This commit is contained in:
Vincent Vandemeulebrouck 2020-12-18 23:48:41 +01:00
parent ea4b7a7b22
commit 15d67e72a3
3 changed files with 21 additions and 25 deletions

View File

@ -1271,8 +1271,7 @@ export class RdDActor extends Actor {
// Final chat message // Final chat message
let chatOptions = { let chatOptions = {
content: "<strong>Test : " + rollData.selectedCarac.label + " / " + rollData.selectedDraconic.name + " / " + rollData.selectedSort.name + "</strong>" content: "<strong>Test : " + rollData.selectedCarac.label + " / " + rollData.selectedDraconic.name + " / " + rollData.selectedSort.name + "</strong>"
+ "<br>Difficultés <strong>libre : " + rollData.diffLibre + "</strong> / conditions : " + Misc.toSignedString(rollData.diffConditions) +" / état : " + rollData.etat + RdDResolutionTable.explainRollData(rollData)
+ RdDResolutionTable.explain(rolled)
+ explications + explications
} }
@ -1310,8 +1309,7 @@ export class RdDActor extends Actor {
// Final chat message // Final chat message
let chatOptions = { let chatOptions = {
content: "<strong>Test : " + rollData.selectedCarac.label + " / " + resumeCompetence + "</strong>" content: "<strong>Test : " + rollData.selectedCarac.label + " / " + resumeCompetence + "</strong>"
+ "<br>Difficultés <strong>libre : " + rollData.diffLibre + "</strong> / conditions : " + Misc.toSignedString(rollData.diffConditions) +" / état : " + rollData.etat + RdDResolutionTable.explainRollData(rollData)
+ RdDResolutionTable.explain(rolled)
+ explications + explications
} }
@ -1410,8 +1408,7 @@ export class RdDActor extends Actor {
// Message de résultat // Message de résultat
ChatUtility.chatWithRollMode({ ChatUtility.chatWithRollMode({
content: "<strong>Test de Tache : " + rollData.tache.name + " - " + rollData.selectedCarac.label + " / " + rollData.competence.name + "</strong>" content: "<strong>Test de Tache : " + rollData.tache.name + " - " + rollData.selectedCarac.label + " / " + rollData.competence.name + "</strong>"
+ "<br>Difficultés <strong>libre : " + rollData.diffLibre + "</strong> / conditions : " + Misc.toSignedString(rollData.diffConditions) +" / état : " + rollData.etat + RdDResolutionTable.explainRollData(rollData)
+ "<br>" + RdDResolutionTable.explain(rollData.rolled)
+ "<br>Points de taches : " + rollData.rolled.ptTache + ", ajustement qualité: " + rollData.rolled.ptQualite + "<br>Points de taches : " + rollData.rolled.ptTache + ", ajustement qualité: " + rollData.rolled.ptQualite
}, this.name); }, this.name);
// Message spécifique de la tâche // Message spécifique de la tâche
@ -1432,8 +1429,7 @@ export class RdDActor extends Actor {
_competenceResult(rollData) { _competenceResult(rollData) {
ChatUtility.chatWithRollMode({ ChatUtility.chatWithRollMode({
content: "<strong>Test : " + rollData.selectedCarac.label + " / " + rollData.competence.name + "</strong>" content: "<strong>Test : " + rollData.selectedCarac.label + " / " + rollData.competence.name + "</strong>"
+ "<br>Difficultés <strong>libre : " + rollData.diffLibre + "</strong> / conditions : " + Misc.toSignedString(rollData.diffConditions) +" / état : " + rollData.etat + RdDResolutionTable.explainRollData(rollData)
+ RdDResolutionTable.explain(rollData.rolled)
+ "<br>Points de taches : " + rollData.rolled.ptTache + ", ajustement qualité: " + rollData.rolled.ptQualite + "<br>Points de taches : " + rollData.rolled.ptTache + ", ajustement qualité: " + rollData.rolled.ptQualite
}, this.name); }, this.name);
} }

View File

@ -262,8 +262,7 @@ export class RdDCombat {
// Final chat message // Final chat message
let chatOptions = { let chatOptions = {
content: "<strong>Test : " + rollData.selectedCarac.label + " / " + rollData.competence.name + "</strong>" content: "<strong>Test : " + rollData.selectedCarac.label + " / " + rollData.competence.name + "</strong>"
+ "<br>Difficultés <strong>libre : " + rollData.diffLibre + "</strong> / conditions : " + Misc.toSignedString(rollData.diffConditions) + " / état : " + rollData.etat + RdDResolutionTable.explainRollData(rollData)
+ RdDResolutionTable.explain(rollData.rolled)
+ explications + explications
} }
ChatUtility.chatWithRollMode(chatOptions, this.attacker.name) ChatUtility.chatWithRollMode(chatOptions, this.attacker.name)
@ -345,8 +344,7 @@ export class RdDCombat {
console.log("RdDCombat.onAttaqueEchec >>>", rollData); console.log("RdDCombat.onAttaqueEchec >>>", rollData);
let chatOptions = { let chatOptions = {
content: "<strong>Test : " + rollData.selectedCarac.label + " / " + rollData.competence.name + "</strong>" content: "<strong>Test : " + rollData.selectedCarac.label + " / " + rollData.competence.name + "</strong>"
+ "<br>Difficultés <strong>libre : " + rollData.diffLibre + "</strong> / conditions : " + Misc.toSignedString(rollData.diffConditions) + " / état : " + rollData.etat + RdDResolutionTable.explainRollData(rollData)
+ RdDResolutionTable.explain(rollData.rolled)
+ (this.target ? "<br><strong>Cible</strong> : " + this.defender.data.name : "") + (this.target ? "<br><strong>Cible</strong> : " + this.defender.data.name : "")
} }
ChatUtility.chatWithRollMode(chatOptions, this.attacker.name) ChatUtility.chatWithRollMode(chatOptions, this.attacker.name)
@ -456,8 +454,7 @@ export class RdDCombat {
let chatOptions = { let chatOptions = {
content: "<strong>Test : " + rollData.selectedCarac.label + " / " + rollData.competence.name + "</strong>" content: "<strong>Test : " + rollData.selectedCarac.label + " / " + rollData.competence.name + "</strong>"
+ "<br>Difficultés <strong>libre : " + rollData.diffLibre + "</strong> / conditions : " + Misc.toSignedString(rollData.diffConditions) + " / état : " + rollData.etat + RdDResolutionTable.explainRollData(rollData)
+ RdDResolutionTable.explain(rollData.rolled)
+ "<br><strong>Attaque parée!</strong>" + "<br><strong>Attaque parée!</strong>"
} }
ChatUtility.chatWithRollMode(chatOptions, this.defender.name) ChatUtility.chatWithRollMode(chatOptions, this.defender.name)
@ -487,8 +484,7 @@ export class RdDCombat {
let chatOptions = { let chatOptions = {
content: "<strong>Test : " + rollData.selectedCarac.label + " / " + rollData.competence.name + "</strong>" content: "<strong>Test : " + rollData.selectedCarac.label + " / " + rollData.competence.name + "</strong>"
+ "<br>Difficultés <strong>libre : " + rollData.diffLibre + "</strong> / conditions : " + Misc.toSignedString(rollData.diffConditions) + " / état : " + rollData.etat + RdDResolutionTable.explainRollData(rollData)
+ RdDResolutionTable.explain(rollData.rolled)
+ explications + explications
} }
@ -557,8 +553,7 @@ export class RdDCombat {
console.log("RdDCombat._onEsquiveNormal >>>", rollData); console.log("RdDCombat._onEsquiveNormal >>>", rollData);
let chatOptions = { let chatOptions = {
content: "<strong>Test : " + rollData.selectedCarac.label + " / " + rollData.competence.name + "</strong>" content: "<strong>Test : " + rollData.selectedCarac.label + " / " + rollData.competence.name + "</strong>"
+ "<br>Difficultés <strong>libre : " + rollData.diffLibre + "</strong> / conditions : " + Misc.toSignedString(rollData.diffConditions) + " / état : " + rollData.etat + RdDResolutionTable.explainRollData(rollData)
+ RdDResolutionTable.explain(rollData.rolled)
+ "<br><strong>Attaque esquivée!</strong>" + "<br><strong>Attaque esquivée!</strong>"
} }
ChatUtility.chatWithRollMode(chatOptions, this.defender.name) ChatUtility.chatWithRollMode(chatOptions, this.defender.name)
@ -585,8 +580,7 @@ export class RdDCombat {
let chatOptions = { let chatOptions = {
content: "<strong>Test : " + rollData.selectedCarac.label + " / " + rollData.competence.name + "</strong>" content: "<strong>Test : " + rollData.selectedCarac.label + " / " + rollData.competence.name + "</strong>"
+ "<br>Difficultés <strong>libre : " + rollData.diffLibre + "</strong> / conditions : " + Misc.toSignedString(rollData.diffConditions) + " / état : " + rollData.etat + RdDResolutionTable.explainRollData(rollData)
+ RdDResolutionTable.explain(rollData.rolled)
+ explications + explications
} }

View File

@ -86,7 +86,13 @@ export class RdDResolutionTable {
} }
message += '<strong>' + rolled.quality + '</strong>' message += '<strong>' + rolled.quality + '</strong>'
return message; return message;
}
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)
return message;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -163,7 +169,7 @@ export class RdDResolutionTable {
} }
return rollData.rolled.isETotal; return rollData.rolled.isETotal;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static isParticuliere(rollData) { static isParticuliere(rollData) {
if (rollData.arme && rollData.surprise) { if (rollData.arme && rollData.surprise) {
@ -240,11 +246,11 @@ export class RdDResolutionTable {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static buildHTMLResults( caracValue, levelValue) { static buildHTMLResults(caracValue, levelValue) {
let cell = this.computeChances( caracValue, levelValue); let cell = this.computeChances(caracValue, levelValue);
let descr = $('<span class="span-valeur competence-label">'); let descr = $('<span class="span-valeur competence-label">');
descr.append("Particulière : " + cell.part+ " - Significative : " + cell.sign + " - Réussite : "+cell.score); descr.append("Particulière : " + cell.part + " - Significative : " + cell.sign + " - Réussite : " + cell.score);
descr.append("<br>Echec Particulier : " + cell.epart + " - Echec Total : " + cell.etotal ); descr.append("<br>Echec Particulier : " + cell.epart + " - Echec Total : " + cell.etotal);
descr.append("</span>"); descr.append("</span>");
return descr; return descr;
} }