From e13b04b15d5a7e640424769791b40b975deb25b6 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Wed, 18 Nov 2020 08:13:48 +0100 Subject: [PATCH] =?UTF-8?q?Gestion=20des=20quantit=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/actor-sheet.js | 2 +- module/actor.js | 2 +- system.json | 2 +- templates/actor-inventaire-conteneur.html | 3 +++ templates/actor-sheet.html | 3 +++ templates/item-livre-sheet.html | 4 ++++ templates/item-munition-sheet.html | 4 ++++ templates/item-objet-sheet.html | 4 ++++ templates/item-potion-sheet.html | 4 ++++ 9 files changed, 25 insertions(+), 3 deletions(-) diff --git a/module/actor-sheet.js b/module/actor-sheet.js index ad2f2a3d..24a1efd9 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -142,7 +142,7 @@ export class RdDActorSheet extends ActorSheet { if (objet) { objet.estContenu = true; // Permet de filtrer ce qui est porté dans le template this.objetVersConteneur[id] = conteneur._id; - conteneur.encTotal += objet.data.encombrement; + conteneur.encTotal += objet.data.encombrement * ((objet.data.quantite)?objet.data.quantite:1); conteneur.subItems.push( objet ); } } diff --git a/module/actor.js b/module/actor.js index 12ffc4f1..b56850ef 100644 --- a/module/actor.js +++ b/module/actor.js @@ -589,7 +589,7 @@ export class RdDActor extends Actor { let totalEnc = 0; for (const item of this.data.items) { if ( item.data && item.data.encombrement ) { // Enc value filtering - totalEnc += Number(item.data.encombrement); + totalEnc += Number(item.data.encombrement) * Number(((item.data.quantite)?item.data.quantite:1)); } } this.encombrementTotal = totalEnc; diff --git a/system.json b/system.json index 044fb1d5..a3ac5878 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.54", + "version": "0.9.55", "minimumCoreVersion": "0.7.5", "compatibleCoreVersion": "0.7.6", "templateVersion": 46, diff --git a/templates/actor-inventaire-conteneur.html b/templates/actor-inventaire-conteneur.html index 6e924503..b85a3e1f 100644 --- a/templates/actor-inventaire-conteneur.html +++ b/templates/actor-inventaire-conteneur.html @@ -1,6 +1,9 @@
  • {{item.name}}

    + {{#if item.data.quantite}} +

    {{item.data.quantite}}

    + {{/if}}
    diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index c17b78bb..d11f3b94 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -466,6 +466,9 @@
  • {{item.name}}

    + {{#if item.data.quantite}} +

    {{item.data.quantite}}

    + {{/if}}
    {{#if item.data.equipe}}{{else}}{{/if}} diff --git a/templates/item-livre-sheet.html b/templates/item-livre-sheet.html index 0f67d14b..92129421 100644 --- a/templates/item-livre-sheet.html +++ b/templates/item-livre-sheet.html @@ -32,6 +32,10 @@
    +
    + + +
    diff --git a/templates/item-munition-sheet.html b/templates/item-munition-sheet.html index b59b646f..eed1dc1d 100644 --- a/templates/item-munition-sheet.html +++ b/templates/item-munition-sheet.html @@ -12,6 +12,10 @@
    +
    + + +
    diff --git a/templates/item-objet-sheet.html b/templates/item-objet-sheet.html index bb4e47b0..89a40b0f 100644 --- a/templates/item-objet-sheet.html +++ b/templates/item-objet-sheet.html @@ -12,6 +12,10 @@
    +
    + + +
    diff --git a/templates/item-potion-sheet.html b/templates/item-potion-sheet.html index 7dc6c42d..696b7ee2 100644 --- a/templates/item-potion-sheet.html +++ b/templates/item-potion-sheet.html @@ -12,6 +12,10 @@
    +
    + + +