From 1ff0de13487d62acf23895146de9f58a0e4c6842 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 7 Dec 2024 17:21:24 +0100 Subject: [PATCH] Correction des ajouts de blessures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - la contusion n'ajoute plus de blessure légère - les pertes d'endurance fonctionnent --- module/actor/base-actor-sang-sheet.js | 2 +- module/item/blessure.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module/actor/base-actor-sang-sheet.js b/module/actor/base-actor-sang-sheet.js index 2dcd511a..2988c78b 100644 --- a/module/actor/base-actor-sang-sheet.js +++ b/module/actor/base-actor-sang-sheet.js @@ -21,7 +21,7 @@ export class RdDBaseActorSangSheet extends RdDBaseActorReveSheet { this.html.find('.creer-blessure-grave').click(async event => RdDItemBlessure.createBlessure(this.actor, 4)); this.html.find('.creer-blessure-critique').click(async event => RdDItemBlessure.createBlessure(this.actor, 6)); - this.html.find('.subir-blessure-contusion').click(async event => RdDItemBlessure.applyFullBlessure(this.actor, 2)); + this.html.find('.subir-blessure-contusion').click(async event => RdDItemBlessure.applyFullBlessure(this.actor, 0)); this.html.find('.subir-blessure-legere').click(async event => RdDItemBlessure.applyFullBlessure(this.actor, 2)); this.html.find('.subir-blessure-grave').click(async event => RdDItemBlessure.applyFullBlessure(this.actor, 4)); this.html.find('.subir-blessure-critique').click(async event => RdDItemBlessure.applyFullBlessure(this.actor, 6)); diff --git a/module/item/blessure.js b/module/item/blessure.js index b527249b..d58eb4f0 100644 --- a/module/item/blessure.js +++ b/module/item/blessure.js @@ -48,8 +48,9 @@ export class RdDItemBlessure extends RdDItem { let lostEndurance = 0 let lostVie = 0 if (definition.endurance) { - lostEndurance = await new Roll(definition.endurance).roll().total; - actor.santeIncDec("endurance", -Number(lostEndurance)); + lostEndurance = new Roll(definition.endurance) + await lostEndurance.roll(); + actor.santeIncDec("endurance", -Number(lostEndurance.total)); } if (definition.vie) { lostVie = definition.vie