From 25742d811fcfc2dbb5cb453ec4d1ed44334a320f Mon Sep 17 00:00:00 2001 From: sladecraven Date: Sun, 15 Nov 2020 12:26:19 +0100 Subject: [PATCH] Gestion des jets en points de reve actuels --- module/actor-sheet.js | 8 ++++++-- module/actor.js | 11 ++++++++++- system.json | 2 +- templates/actor-sheet.html | 15 ++++++++++++--- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/module/actor-sheet.js b/module/actor-sheet.js index fe9a2470..2f56abe0 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -274,8 +274,12 @@ export class RdDActorSheet extends ActorSheet { let compName = event.currentTarget.text; this.actor.rollCompetence( compName); }); - - // Roll Weapon + // Points de reve actuel + html.find('.ptreve-actuel a').click((event) => { + this.actor.rollCarac( 'reveActuel' ); + }); + + // Roll Weapon1 html.find('.arme-label a').click((event) => { let armeName = event.currentTarget.text; this.actor.rollArme( armeName); diff --git a/module/actor.js b/module/actor.js index 18f284c9..9130e7c2 100644 --- a/module/actor.js +++ b/module/actor.js @@ -764,8 +764,17 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ async rollCarac( caracName ) { + let carac; + if ( caracName == "reveActuel") { // Fake carac for Reve Actuel + carac = {type: "number", + value: this.data.data.reve.reve.value, + label: "Rêve Actuel" + } + } else { + carac = this.data.data.carac[caracName];// Per default + } let rollData = { - selectedCarac: this.data.data.carac[caracName], + selectedCarac: carac, ajustementsConditions: CONFIG.RDD.ajustementsConditions, difficultesLibres: CONFIG.RDD.difficultesLibres, etat: this.data.data.compteurs.etat.value, diff --git a/system.json b/system.json index 132188c0..7bf342ab 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "name": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", "description": "Rêve de Dragon RPG for FoundryVTT", - "version": "0.9.45", + "version": "0.9.46", "minimumCoreVersion": "0.7.5", "compatibleCoreVersion": "0.7.6", "templateVersion": 46, diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 16bd8387..15871aec 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -396,10 +396,19 @@
    -
  1. Points de Rêve actuels :
  2. +
  3. + Points de Rêve actuels : + +
  4. {{#if data.isGM}} -
  5. Position en TMR :
  6. -
  7. Refoulement :
  8. +
  9. + Position en TMR : + +
  10. +
  11. + Refoulement : + +
  12. {{else}}
  13. Position en TMR : {{data.reve.tmrpos.coord}}
  14. Refoulement : {{data.reve.refoulement.value}}