Correction async pas utiles

This commit is contained in:
2020-11-17 11:35:05 +01:00
parent 803b340ad0
commit fbe70e42ea
6 changed files with 69 additions and 56 deletions

View File

@ -85,21 +85,20 @@ export class RdDResolutionTable {
}
/* -------------------------------------------- */
static async roll(carac, finalLevel, showDice=false) {
static roll(carac, finalLevel) {
let chances = this.computeChances(carac, finalLevel);
chances.showDice = showDice;
let rolled = await this.rollChances(chances);
chances.showDice = true;
let rolled = this.rollChances(chances);
rolled.carac = carac;
rolled.finalLevel = finalLevel;
return rolled;
}
/* -------------------------------------------- */
static async rollChances(chances) {
static rollChances(chances) {
let myRoll = new Roll("d100").roll();
if (chances.showDice) {
await RdDDice.showDiceSoNice(myRoll);
}
myRoll.showDice = chances.showDice;
RdDDice.show(myRoll);
chances.roll = myRoll.total;
mergeObject(chances, this._computeReussite(chances, chances.roll));
return chances;