Renommage méthode jet sans dialog

This commit is contained in:
Vincent Vandemeulebrouck 2023-03-10 22:25:53 +01:00
parent e470d76ea0
commit 41335cd433
2 changed files with 12 additions and 4 deletions

View File

@ -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}`)

View File

@ -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;