diff --git a/module/actor.js b/module/actor.js index 7ab213fa..bcbc7388 100644 --- a/module/actor.js +++ b/module/actor.js @@ -1803,7 +1803,7 @@ export class RdDActor extends RdDBaseActor { async _surmonterExotisme(item) { const exotisme = Math.min(item.system.exotisme, item.system.qualite, 0); if (exotisme < 0) { - const rolled = await this.rollCaracCompetence('volonte', 'cuisine', exotisme, { title: `tente de surmonter l'exotisme de ${item.name}` }); + const rolled = await this.doRollCaracCompetence('volonte', 'cuisine', exotisme, { title: `tente de surmonter l'exotisme de ${item.name}` }); return rolled.isSuccess; } return true; @@ -1811,7 +1811,7 @@ export class RdDActor extends RdDBaseActor { /* -------------------------------------------- */ async apprecier(carac, compName, qualite, title) { - const rolled = await this.rollCaracCompetence(carac, compName, qualite, { title: title, apprecier: true }); + const rolled = await this.doRollCaracCompetence(carac, compName, qualite, { title: title, apprecier: true }); if (rolled?.isSuccess) { await this.jetDeMoral('heureux'); } @@ -2301,7 +2301,15 @@ export class RdDActor extends RdDBaseActor { await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-general.html'); } - async rollCaracCompetence(caracName, compName, diff, options = { title: "", apprecier: false }) { + /** + * Méthode pour faire un jet prédéterminer sans ouvrir la fenêtre de dialogue + * @param {*} caracName + * @param {*} compName + * @param {*} diff + * @param {*} options + * @returns + */ + async doRollCaracCompetence(caracName, compName, diff, options = { title: "", apprecier: false }) { const carac = this.getCaracByName(caracName); if (!carac) { ui.notifications.warn(`${this.name} n'a pas de caractéristique correspondant à ${caracName}`) diff --git a/module/rdd-commands.js b/module/rdd-commands.js index ebab970a..74dd1e61 100644 --- a/module/rdd-commands.js +++ b/module/rdd-commands.js @@ -332,7 +332,7 @@ export class RdDCommands { let competence = length > 1 ? actors[0].getCompetence(Misc.join(params.slice(1, length), ' ')) : { name: undefined }; if (competence) { for (let actor of actors) { - await actor.rollCaracCompetence(caracName, competence.name, diff); + await actor.doRollCaracCompetence(caracName, competence.name, diff); } } return;