diff --git a/module/actor/base-actor-sang-sheet.js b/module/actor/base-actor-sang-sheet.js
index 642de3a7..2d45db03 100644
--- a/module/actor/base-actor-sang-sheet.js
+++ b/module/actor/base-actor-sang-sheet.js
@@ -21,6 +21,11 @@ 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-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));
+
this.html.find('.jet-vie').click(async event => this.actor.jetDeVie())
this.html.find('.jet-endurance').click(async event => await this.jetEndurance())
diff --git a/module/item/blessure.js b/module/item/blessure.js
index 8747157e..21c04566 100644
--- a/module/item/blessure.js
+++ b/module/item/blessure.js
@@ -1,6 +1,7 @@
import { RdDItem } from "../item.js";
import { Misc } from "../misc.js";
import { RdDTimestamp } from "../time/rdd-timestamp.js";
+import { ChatUtility } from "../chat-utility.js";
const BASE_TACHE_SOIN_BLESSURE = {
type: "tache",
@@ -14,10 +15,10 @@ const TACHES_SOIN_BLESSURE = {
}
const definitionsBlessures = [
- { type: "contusion", gravite: 0, label: 'Contusion/éraflure', max: 100, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/eraflure.webp" },
- { type: "legere", gravite: 2, label: 'Légère', max: 5, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/blessure.webp" },
- { type: "grave", gravite: 4, label: 'Grave', max: 2, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/blessure.webp" },
- { type: "critique", gravite: 6, label: 'Critique', max: 1, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/blessure.webp" },
+ { type: "contusion", gravite: 0, endurance: "1d4", vie: 0, label: 'Contusion/éraflure', max: 100, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/eraflure.webp" },
+ { type: "legere", gravite: 2, endurance: "1d6", vie: 0, label: 'Légère', max: 5, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/blessure.webp" },
+ { type: "grave", gravite: 4, endurance: "2d6", vie: -2, label: 'Grave', max: 2, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/blessure.webp" },
+ { type: "critique", gravite: 6, endurance: "-100", vie: -4, label: 'Critique', max: 1, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/blessure.webp" },
{ type: "mort", gravite: 8, label: 'Mort', max: 1, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/mort.webp" }
]
@@ -40,6 +41,32 @@ export class RdDItemBlessure extends RdDItem {
}
return mergeObject(duplicate(BASE_TACHE_SOIN_BLESSURE), tache)
}
+
+ static async applyFullBlessure(actor, gravite) {
+ const definition = RdDItemBlessure.getDefinition(gravite)
+
+ let lostEndurance = 0
+ let lostVie = 0
+ if (definition.endurance) {
+ lostEndurance = new Roll(definition.endurance).roll({async: false}).total;
+ actor.santeIncDec("endurance", -Number(lostEndurance));
+ }
+ if (definition.vie) {
+ lostVie = definition.vie
+ actor.santeIncDec("vie", definition.vie)
+ }
+
+ await this.createBlessure(actor, gravite)
+
+ ChatMessage.create({
+ content: `Blessure ${definition.label} appliquée à ${actor.name}`+
+ `
Perte d'endurance : ${lostEndurance}`+
+ `
Perte de Vie : ${lostVie}`,
+ whisper: ChatUtility.getWhisperRecipientsAndGMs(actor.name)
+ });
+
+ }
+
static async createBlessure(actor, gravite, localisation = '', attacker) {
const definition = RdDItemBlessure.getDefinition(gravite)
const blessure = {
diff --git a/module/tmr-rencontres.js b/module/tmr-rencontres.js
index 94ed295c..4610d6f4 100644
--- a/module/tmr-rencontres.js
+++ b/module/tmr-rencontres.js
@@ -39,6 +39,8 @@ export class TMRRencontres {
const frequence = it => it.system.frequence[codeTerrain];
const row = await this.table.getRandom(frequence, filtreMauvaise, forcedRoll);
if (row) {
+ console.log("DORM", row);
+ //row.document.system.computedForce = new Roll(row.document.system.formula).roll({async: false}).total;
await CompendiumTableHelpers.tableRowToChatMessage(row);
}
diff --git a/templates/actor/blessures.html b/templates/actor/blessures.html
index f7506ca2..82bd1cca 100644
--- a/templates/actor/blessures.html
+++ b/templates/actor/blessures.html
@@ -1,8 +1,14 @@
-
{{linkCompendium document.pack document.id document.name}}
+ {{#if document.system.formule}} +