From da24ff723249a874179d59ec0b6e6cd9191e4127 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 18 Dec 2020 00:45:20 +0100 Subject: [PATCH] =?UTF-8?q?Echec=20total=20t=C3=A2che=20augmente=20la=20di?= =?UTF-8?q?fficult=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/actor.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/module/actor.js b/module/actor.js index c62e0a69..585a47cf 100644 --- a/module/actor.js +++ b/module/actor.js @@ -1133,7 +1133,7 @@ export class RdDActor extends Actor { action: r => this._appliquerAjoutExperience(r) }; } - + /* -------------------------------------------- */ async _appliquerAjoutExperience(rollData) { let xpResult = this.appliquerExperience( rollData.rolled, rollData.selectedCarac.label, (rollData.competence) ? rollData.competence.data.name: undefined ); @@ -1389,6 +1389,7 @@ export class RdDActor extends Actor { label: 'Jet de Tâche ' + tache.name, callbacks: [ this.createCallbackExperience(), + { condition: r=> r.rolled.isETotal, action: r => this._tacheETotal(r)}, { action: r => this._tacheResult(r) } ] } ); @@ -1418,6 +1419,11 @@ export class RdDActor extends Actor { }, this.name); } + _tacheETotal(rollData) { + rollData.tache.data.difficulte --; + this.updateEmbeddedEntity( "OwnedItem", rollData.tache); + } + /* -------------------------------------------- */ _competenceResult(rollData) { ChatUtility.chatWithRollMode({