From d15d0989a3baa4b09cccdf63a0953e8ac5fdd83d Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 1 May 2026 23:56:17 +0200 Subject: [PATCH] =?UTF-8?q?Remise=20=C3=A0=20z=C3=A9ro=20du=20refoulement?= =?UTF-8?q?=20apr=C3=A8s=20souffle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 1 + module/actor.js | 16 +++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/changelog.md b/changelog.md index 9c75d290..029e6826 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ - Les bon moments sont affichés en tooltip sur le moral - Les modifications de coeurs fonctionnent de nouveau +- Le refoulement est remis à zéro après avoir refoulé et reçu un souffle ## 13.0.36 - Les rêveries d'Illisys diff --git a/module/actor.js b/module/actor.js index 3b0a1d15..7858b80c 100644 --- a/module/actor.js +++ b/module/actor.js @@ -972,7 +972,7 @@ export class RdDActor extends RdDBaseActorSang { /* -------------------------------------------- */ async actionRefoulement(item) { - const refoulement = item?.system.refoulement ?? 0; + const refoulement = item?.system.refoulement ?? 0 if (refoulement > 0) { RdDConfirm.confirmer({ settingConfirmer: "confirmation-refouler", @@ -980,8 +980,8 @@ export class RdDActor extends RdDBaseActorSang { title: 'Confirmer la refoulement', buttonLabel: 'Refouler', onAction: async () => { - await this.ajouterRefoulement(refoulement, `une queue ${item.name}`); - await item.delete(); + await this.ajouterRefoulement(refoulement, `une queue ${item.name}`) + await item.delete() } }); } @@ -989,16 +989,18 @@ export class RdDActor extends RdDBaseActorSang { /* -------------------------------------------- */ async ajouterRefoulement(value = 1, refouler) { - let refoulement = this.system.reve.refoulement.value + value + const refoulement = this.system.reve.refoulement.value + value const roll = new Roll("1d20") await roll.evaluate() await roll.toMessage({ flavor: `${this.name} refoule ${refouler} pour ${value} points de refoulement (total: ${refoulement})` }) if (roll.total <= refoulement) { - refoulement = 0 + await this.update({ "system.reve.refoulement.value": 0 }) await this.ajouterSouffle({ chat: true }) } - await this.update({ "system.reve.refoulement.value": refoulement }) - return roll; + else{ + await this.update({ "system.reve.refoulement.value": refoulement }) + } + return roll } /* -------------------------------------------- */