From 8770b29a5e248397c2de49b479b073fe058d3d21 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Tue, 6 Apr 2021 23:43:53 +0200 Subject: [PATCH] Ajout Item nourritureboisson --- module/rdd-compendium-organiser.js | 2 +- module/rdd-utility.js | 5 +- template.json | 14 ++++- templates/item-nourritureboisson-sheet.html | 64 +++++++++++++++++++++ 4 files changed, 82 insertions(+), 3 deletions(-) create mode 100644 templates/item-nourritureboisson-sheet.html diff --git a/module/rdd-compendium-organiser.js b/module/rdd-compendium-organiser.js index 1655b87d..7ee331a6 100644 --- a/module/rdd-compendium-organiser.js +++ b/module/rdd-compendium-organiser.js @@ -14,7 +14,7 @@ const typeDisplayName = { "ombre": "Ombre de Thanatos", "souffle": "Souffle de Dragon", "tete": "Tête de Dragon", - "ingredient": "Ingrédient", + "nourritureboisson": "Nourriture & boisson", "rencontresTMR": "Rencontre des TMR", "competencecreature": "Compétence de créature", "nombreastral": "Nombre astral", diff --git a/module/rdd-utility.js b/module/rdd-utility.js index 2b552514..4265bb8f 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -129,6 +129,7 @@ export class RdDUtility { 'systems/foundryvtt-reve-de-dragon/templates/item-ombre-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/item-monnaie-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/item-meditation-sheet.html', + 'systems/foundryvtt-reve-de-dragon/templates/item-nourritureboisson-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/competence-carac-defaut.html', 'systems/foundryvtt-reve-de-dragon/templates/competence-base.html', 'systems/foundryvtt-reve-de-dragon/templates/enum-aspect-tarot.html', @@ -248,6 +249,7 @@ export class RdDUtility { formData.tetes = this.checkNull(formData.itemsByType['tete']); formData.taches = this.checkNull(formData.itemsByType['tache']); formData.monnaie = this.checkNull(formData.itemsByType['monnaie']); + formData.nourritureboissons = this.checkNull(formData.itemsByType['nourritureboisson']); formData.meditations = this.checkNull(formData.itemsByType['meditation']); formData.chants = this.checkNull(formData.itemsByType['chant']); formData.danses = this.checkNull(formData.itemsByType['danse']); @@ -263,7 +265,8 @@ export class RdDUtility { .concat(formData.livres) .concat(formData.potions) .concat(formData.herbes) - .concat(formData.ingredients); + .concat(formData.ingredients) + .concat(formData.nourritureboissons); formData.competences = (formData.itemsByType.competence ?? []).concat(formData.itemsByType.competencecreature ?? []); } diff --git a/template.json b/template.json index 98fbdca9..6a4da18b 100644 --- a/template.json +++ b/template.json @@ -576,7 +576,7 @@ "Item": { "types": ["objet", "arme", "armure", "conteneur", "competence", "sort", "herbe", "ingredient", "livre", "potion", "munition", "rencontresTMR", "queue", "ombre", "souffle", "tete", "competencecreature", "tarot", "monnaie", "nombreastral", "tache", "meditation", "casetmr", "recettealchimique", - "musique", "chant", "danse", "jeu", "recettecuisine", "maladie", "poison", "oeuvre" ], + "musique", "chant", "danse", "jeu", "recettecuisine", "maladie", "poison", "oeuvre", "nourritureboisson" ], "objet": { "description": "", "quantite": 1, @@ -854,6 +854,18 @@ "remedes": "", "dommages":"", "description": "" + }, + "nourritureboisson": { + "description": "", + "sust": 0, + "boisson": false, + "desaltere": 0, + "alcoolise": false, + "force": 0, + "qualite": 0, + "encombrement": 0, + "quantite": 1, + "cout": 0 } } } diff --git a/templates/item-nourritureboisson-sheet.html b/templates/item-nourritureboisson-sheet.html new file mode 100644 index 00000000..ff11e4fd --- /dev/null +++ b/templates/item-nourritureboisson-sheet.html @@ -0,0 +1,64 @@ +
+
+ +
+

+
+
+ + {{!-- Sheet Body --}} +
+
+ + +
+
+ + +
+ {{#if data.boisson}} +
+ + +
+
+ + +
+ {{#if data.alcoolise}} +
+ + +
+ {{/if}} + {{/if}} +
+ {{#if (lt data.qualite 0)}} + + {{else}} + + {{/if}} + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} +
+
+
+ +
\ No newline at end of file