#27 Gestion des rencontres

This commit is contained in:
2020-11-21 09:10:31 +01:00
parent 40f0efec1a
commit 40027882e4
4 changed files with 17 additions and 15 deletions

View File

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