Fix: simplifier l'affichage des jets

L'affichage de plus ou moins de jets ne marchait pas et faisait
régression
This commit is contained in:
Vincent Vandemeulebrouck
2021-12-03 22:53:38 +01:00
parent 0ccb98cfc9
commit 1f1fb39866
8 changed files with 29 additions and 49 deletions

View File

@ -7,7 +7,7 @@ import { RdDUtility } from "./rdd-utility.js";
import { Grammar } from "./grammar.js";
import { RdDDice } from "./rdd-dice.js";
import { Misc } from "./misc.js";
import { SYSTEM_RDD } from "./constants.js";
import { HIDE_DICE, SHOW_DICE, SHOW_DICE_OPTIONAL, SYSTEM_RDD } from "./constants.js";
/* -------------------------------------------- */
const dossierIconesHeures = 'systems/foundryvtt-reve-de-dragon/icons/heures/'
@ -145,10 +145,10 @@ export class RdDCalendrier extends Application {
}
/* -------------------------------------------- */
async ajouterNombreAstral(index, showDice = true) {
const nombreAstral = await RdDDice.rollTotal("1dh", { showDice: showDice, hideDice: !showDice, rollMode: "selfroll" });
async ajouterNombreAstral(index, showDice = SHOW_DICE_OPTIONAL) {
const nombreAstral = await RdDDice.rollTotal("1dh", { showDice: showDice, rollMode: "selfroll" });
const dateFuture = this.getDateFromIndex(index);
if (showDice) {
if (showDice != HIDE_DICE) {
ChatMessage.create({
whisper: ChatMessage.getWhisperRecipients("GM"),
content: `Le chiffre astrologique du ${dateFuture} sera le ${nombreAstral}`
@ -185,7 +185,7 @@ export class RdDCalendrier extends Application {
}
/* -------------------------------------------- */
async rebuildListeNombreAstral(showDice = true) {
async rebuildListeNombreAstral(showDice = SHOW_DICE) {
if (Misc.isUniqueConnectedGM()) {
console.log("rebuildListeNombreAstral", showDice);
let jourCourant = this.getCurrentDayIndex();
@ -324,7 +324,7 @@ export class RdDCalendrier extends Application {
let rollData = {
caracValue: request.carac_vue,
finalLevel: niveau,
showDice: false,
showDice: HIDE_DICE,
rollMode: "blindroll"
};
await RdDResolutionTable.rollData(rollData);
@ -333,7 +333,7 @@ export class RdDCalendrier extends Application {
request.isValid = true;
if (!request.rolled.isSuccess) {
request.isValid = false;
nbAstral = await RdDDice.rollTotal("1dhr" + nbAstral, { showDice: true, rollMode: "selfroll" });
nbAstral = await RdDDice.rollTotal("1dhr" + nbAstral, { rollMode: "selfroll" });
// Mise à jour des nombres astraux du joueur
let astralData = this.listeNombreAstral.find((nombreAstral, i) => nombreAstral.index == request.date);
astralData.valeursFausses.push({ actorId: request.id, nombreAstral: nbAstral });