Affichage du jet de refoulement
This commit is contained in:
parent
cf4be389b4
commit
086ad4f23a
@ -1433,27 +1433,25 @@ export class RdDActor extends Actor {
|
||||
title: 'Confirmer la refoulement',
|
||||
buttonLabel: 'Refouler',
|
||||
onAction: async () => {
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: `${this.name} a refoulé une queue ${item.nname} pour ${refoulement} points de refoulement`
|
||||
});
|
||||
await this.ajouterRefoulement(refoulement);
|
||||
await this.ajouterRefoulement(refoulement, `une queue ${item.name}`);
|
||||
await item.delete();
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async ajouterRefoulement(value = 1) {
|
||||
let refoulement = this.system.reve.refoulement.value + value;
|
||||
let total = await RdDDice.rollTotal("1d20");
|
||||
if (total <= refoulement) {
|
||||
async ajouterRefoulement(value = 1, refouler) {
|
||||
const refoulement = this.system.reve.refoulement.value + value;
|
||||
const roll = new Roll("1d20");
|
||||
await roll.evaluate({ async: true });
|
||||
await roll.toMessage({ flavor: `${this.name} refoule ${refouler} pour ${value} points de refoulement (total: ${refoulement})` });
|
||||
if (roll.total <= refoulement) {
|
||||
refoulement = 0;
|
||||
await this.ajouterSouffle({ chat: true });
|
||||
}
|
||||
await this.update({ "system.reve.refoulement.value": refoulement });
|
||||
return refoulement == 0 ? "souffle" : "none";
|
||||
return roll;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
@ -289,9 +289,8 @@ export class RdDTMRDialog extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async refouler() {
|
||||
this._tellToGM(this.actor.name + " a refoulé : " + this.currentRencontre.name);
|
||||
await this.actor.ajouterRefoulement(this.currentRencontre.refoulement ?? 1, `une rencontre ${this.currentRencontre.name}`);
|
||||
await this.actor.deleteTMRRencontreAtPosition(); // Remove the stored rencontre if necessary
|
||||
await this.actor.ajouterRefoulement(this.currentRencontre.refoulement ?? 1);
|
||||
this.updateTokens();
|
||||
console.log("-> refouler", this.currentRencontre)
|
||||
this.updateValuesDisplay();
|
||||
|
Loading…
Reference in New Issue
Block a user