From 5daf15901acdd124a1bd102f83a0d31c89157565 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 16 Sep 2022 02:20:00 +0200 Subject: [PATCH 1/4] Correction erreur xp restant --- module/actor.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/module/actor.js b/module/actor.js index f1496e1f..6085a5f9 100644 --- a/module/actor.js +++ b/module/actor.js @@ -929,26 +929,27 @@ export class RdDActor extends Actor { if (!competence) { return; } + const stress = this.system.compteurs.experience.value; const niveau = Number(competence.system.niveau); - const stressTransforme = this.system.compteurs.experience.value; - const xpRequis = RdDItemCompetence.getCompetenceNextXp(niveau) - competence.system.xp; - if (stressTransforme <= 0 || niveau >= competence.system.niveau_archetype || xpRequis <= 0) { + const xpSuivant = RdDItemCompetence.getCompetenceNextXp(niveau); + const xpRequis = xpSuivant - competence.system.xp; + if (stress <= 0 || niveau >= competence.system.niveau_archetype) { ui.notifications.info(`La compétence ne peut pas augmenter! - stress disponible: ${stressTransforme} + stress disponible: ${stress} expérience requise: ${xpRequis} niveau : ${niveau} archétype : ${competence.system.niveau_archetype}`); return; } - const xpUtilise = Math.min(stressTransforme, xpRequis); - const gainNiveau = xpUtilise >= xpRequis ? 1 : 0; + const xpUtilise = Math.max(0, Math.min(stress, xpRequis)); + const gainNiveau = (xpUtilise >= xpRequis || xpRequis <=0) ? 1 : 0; const nouveauNiveau = niveau + gainNiveau; - const nouveauXp = gainNiveau > 0 ? Math.max(competence.system.xp - xpRequis, 0) : (competence.system.xp + xpUtilise); + const nouveauXp = gainNiveau > 0 ? Math.max(competence.system.xp - xpSuivant, 0) : (competence.system.xp + xpUtilise); await competence.update({ "system.xp": nouveauXp, "system.niveau": nouveauNiveau, }); - const stressTransformeRestant = Math.max(0, stressTransforme - xpUtilise); + const stressTransformeRestant = Math.max(0, stress - xpUtilise); await this.update({ "system.compteurs.experience.value": stressTransformeRestant }); this.updateExperienceLog('Dépense stress', xpUtilise, `Stress en ${competence.name} ${gainNiveau ? "pour passer à " + nouveauNiveau : ""}`); } From 8f1ee315ef45999ecdc638c856c456392830be57 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 16 Sep 2022 02:20:46 +0200 Subject: [PATCH 2/4] =?UTF-8?q?Template=20en-t=C3=AAte=20standard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/rdd-utility.js | 1 + templates/header-item.html | 6 + templates/item-arme-sheet.html | 7 +- templates/item-armure-sheet.html | 58 ++++--- templates/item-casetmr-sheet.html | 41 ++--- templates/item-chant-sheet.html | 34 ++-- templates/item-competencecreature-sheet.html | 90 +++++------ templates/item-conteneur-sheet.html | 78 +++++----- templates/item-danse-sheet.html | 68 ++++---- templates/item-gemme-sheet.html | 10 +- templates/item-ingredient-sheet.html | 9 +- templates/item-jeu-sheet.html | 65 ++++---- templates/item-meditation-sheet.html | 154 +++++++++---------- templates/item-monnaie-sheet.html | 50 +++--- templates/item-munition-sheet.html | 50 +++--- templates/item-musique-sheet.html | 34 ++-- templates/item-nombreastral-sheet.html | 47 +++--- templates/item-nourritureboisson-sheet.html | 10 +- templates/item-objet-sheet.html | 58 +++---- templates/item-ombre-sheet.html | 26 ++-- templates/item-possession-sheet.html | 44 ++---- templates/item-queue-sheet.html | 26 ++-- templates/item-recettealchimique-sheet.html | 66 ++++---- templates/item-recettecuisine-sheet.html | 68 ++++---- templates/item-rencontresTMR-sheet.html | 19 +-- templates/item-sort-sheet.html | 150 +++++++++--------- templates/item-souffle-sheet.html | 18 +-- templates/item-tache-sheet.html | 134 ++++++++-------- templates/item-tarot-sheet.html | 44 +++--- templates/item-tete-sheet.html | 18 +-- 30 files changed, 636 insertions(+), 847 deletions(-) create mode 100644 templates/header-item.html diff --git a/module/rdd-utility.js b/module/rdd-utility.js index 991c7506..3ceecdac 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -130,6 +130,7 @@ export class RdDUtility { 'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-liens-vehicules.html', 'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-editor-notes-mj.html', //Items + 'systems/foundryvtt-reve-de-dragon/templates/header-item.html', 'systems/foundryvtt-reve-de-dragon/templates/item-competence-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/item-competencecreature-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/item-arme-sheet.html', diff --git a/templates/header-item.html b/templates/header-item.html new file mode 100644 index 00000000..3638564a --- /dev/null +++ b/templates/header-item.html @@ -0,0 +1,6 @@ +
+ +
+

+
+
diff --git a/templates/item-arme-sheet.html b/templates/item-arme-sheet.html index c6e27293..94e79fe5 100644 --- a/templates/item-arme-sheet.html +++ b/templates/item-arme-sheet.html @@ -1,10 +1,5 @@
-
- -
-

-
-
+ {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} {{!-- Sheet Body --}}
diff --git a/templates/item-armure-sheet.html b/templates/item-armure-sheet.html index 5bb8e062..96aebe11 100644 --- a/templates/item-armure-sheet.html +++ b/templates/item-armure-sheet.html @@ -1,35 +1,29 @@ -
- -
-

-
-
- - {{!-- Sheet Body --}} -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} - {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} -
- + {{!-- Sheet Body --}} +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-casetmr-sheet.html b/templates/item-casetmr-sheet.html index 7f6216c3..c5c8292b 100644 --- a/templates/item-casetmr-sheet.html +++ b/templates/item-casetmr-sheet.html @@ -1,27 +1,20 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
-
- - -
-
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} + {{!-- Sheet Body --}} +
+
+ + +
+
+ + +
- {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-chant-sheet.html b/templates/item-chant-sheet.html index c854406a..7fbd9714 100644 --- a/templates/item-chant-sheet.html +++ b/templates/item-chant-sheet.html @@ -1,24 +1,16 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
-
- - -
-
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} + {{!-- Sheet Body --}} +
+
+ + +
+
+ + +
- {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-competencecreature-sheet.html b/templates/item-competencecreature-sheet.html index 174fd57b..2e912a9a 100644 --- a/templates/item-competencecreature-sheet.html +++ b/templates/item-competencecreature-sheet.html @@ -1,52 +1,44 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} + {{!-- Sheet Body --}} +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
- {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-conteneur-sheet.html b/templates/item-conteneur-sheet.html index f0621121..5087516a 100644 --- a/templates/item-conteneur-sheet.html +++ b/templates/item-conteneur-sheet.html @@ -1,47 +1,39 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
-
- - -
-
- - -
-
- - -
-
- - -
- {{#if isOwned}} -
- -
    -
  • - Nom - Q. - Enc. - Actions -
  • - {{buildContenu this}} -
-
- {{/if}} + {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} + {{!-- Sheet Body --}} +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ {{#if isOwned}} +
+ +
    +
  • + Nom + Q. + Enc. + Actions +
  • + {{buildContenu this}} +
+
+ {{/if}} - {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-danse-sheet.html b/templates/item-danse-sheet.html index 956dd877..59e0f358 100644 --- a/templates/item-danse-sheet.html +++ b/templates/item-danse-sheet.html @@ -1,41 +1,33 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} + {{!-- Sheet Body --}} +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
- {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-gemme-sheet.html b/templates/item-gemme-sheet.html index 79b45b3d..f7151737 100644 --- a/templates/item-gemme-sheet.html +++ b/templates/item-gemme-sheet.html @@ -1,11 +1,5 @@
-
- -
-

-
-
- + {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} {{!-- Sheet Body --}}
@@ -50,7 +44,5 @@
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} -
-
\ No newline at end of file diff --git a/templates/item-ingredient-sheet.html b/templates/item-ingredient-sheet.html index 27b6d7e7..f9e273d8 100644 --- a/templates/item-ingredient-sheet.html +++ b/templates/item-ingredient-sheet.html @@ -1,10 +1,5 @@
-
- -
-

-
-
+ {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} {{!-- Sheet Body --}}
@@ -48,7 +43,5 @@ {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} -
-
\ No newline at end of file diff --git a/templates/item-jeu-sheet.html b/templates/item-jeu-sheet.html index 9b2bb091..e562b5c1 100644 --- a/templates/item-jeu-sheet.html +++ b/templates/item-jeu-sheet.html @@ -1,39 +1,32 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
-
- - -
-
- - -
-
- - -
-
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} - {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{!-- Sheet Body --}} +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-meditation-sheet.html b/templates/item-meditation-sheet.html index 48cd1b5d..21db9a13 100644 --- a/templates/item-meditation-sheet.html +++ b/templates/item-meditation-sheet.html @@ -1,84 +1,76 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - {{#if isGM}} - - {{else}} - - {{/if}} -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} + {{!-- Sheet Body --}} +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + {{#if isGM}} + + {{else}} + + {{/if}} +
- {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-monnaie-sheet.html b/templates/item-monnaie-sheet.html index 246d35d8..a105d6c0 100644 --- a/templates/item-monnaie-sheet.html +++ b/templates/item-monnaie-sheet.html @@ -1,32 +1,24 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
-
- - -
-
- - {{#if isGM}} - - {{else}} - - {{/if}} -
-
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} + {{!-- Sheet Body --}} +
+
+ + +
+
+ + {{#if isGM}} + + {{else}} + + {{/if}} +
+
+ + +
- {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-munition-sheet.html b/templates/item-munition-sheet.html index 723ed15c..149515f1 100644 --- a/templates/item-munition-sheet.html +++ b/templates/item-munition-sheet.html @@ -1,32 +1,24 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
-
- - -
-
- - -
-
- - -
-
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} + {{!-- Sheet Body --}} +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
- {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-musique-sheet.html b/templates/item-musique-sheet.html index b49496b8..7fbd9714 100644 --- a/templates/item-musique-sheet.html +++ b/templates/item-musique-sheet.html @@ -1,24 +1,16 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
-
- - -
-
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} + {{!-- Sheet Body --}} +
+
+ + +
+
+ + +
- {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-nombreastral-sheet.html b/templates/item-nombreastral-sheet.html index 86f8a9a0..d48bbfcc 100644 --- a/templates/item-nombreastral-sheet.html +++ b/templates/item-nombreastral-sheet.html @@ -1,30 +1,23 @@
-
- -
-

-
-
+ {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} + {{!-- Sheet Body --}} +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
- {{!-- Sheet Body --}} -
-
- - -
-
- - -
-
- - -
-
- - -
- -
- +
diff --git a/templates/item-nourritureboisson-sheet.html b/templates/item-nourritureboisson-sheet.html index c19bb669..9f1933dc 100644 --- a/templates/item-nourritureboisson-sheet.html +++ b/templates/item-nourritureboisson-sheet.html @@ -1,11 +1,5 @@
-
- -
-

-
-
- + {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} {{!-- Sheet Body --}}
@@ -55,7 +49,5 @@
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} -
-
\ No newline at end of file diff --git a/templates/item-objet-sheet.html b/templates/item-objet-sheet.html index 7d812a86..2737332c 100644 --- a/templates/item-objet-sheet.html +++ b/templates/item-objet-sheet.html @@ -1,36 +1,28 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} + {{!-- Sheet Body --}} +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
- {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-ombre-sheet.html b/templates/item-ombre-sheet.html index 663b6373..542c39c5 100644 --- a/templates/item-ombre-sheet.html +++ b/templates/item-ombre-sheet.html @@ -1,20 +1,12 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
-
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} + {{!-- Sheet Body --}} +
+
+ + +
- {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-possession-sheet.html b/templates/item-possession-sheet.html index 8676271f..57cb0977 100644 --- a/templates/item-possession-sheet.html +++ b/templates/item-possession-sheet.html @@ -1,29 +1,19 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
-
- - -
-
- - -
-
- - -
- - - {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} + {{!-- Sheet Body --}} +
+
+ + +
+
+ + +
+
+ + +
+ {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-queue-sheet.html b/templates/item-queue-sheet.html index 663b6373..542c39c5 100644 --- a/templates/item-queue-sheet.html +++ b/templates/item-queue-sheet.html @@ -1,20 +1,12 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
-
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} + {{!-- Sheet Body --}} +
+
+ + +
- {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-recettealchimique-sheet.html b/templates/item-recettealchimique-sheet.html index b0149575..b476b22b 100644 --- a/templates/item-recettealchimique-sheet.html +++ b/templates/item-recettealchimique-sheet.html @@ -1,44 +1,36 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
-
- - + {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} + {{!-- Sheet Body --}} +
+
+ + +
+
+ +
+ {{editor system.manipulation_update target="system.manipulation" button=true owner=owner editable=editable}}
-
- -
- {{editor system.manipulation_update target="system.manipulation" button=true owner=owner editable=editable}} -
+
+
+ +
+ {{editor system.utilisation target="system.utilisation" button=true owner=owner editable=editable}}
-
- -
- {{editor system.utilisation target="system.utilisation" button=true owner=owner editable=editable}} -
+
+
+ +
+ {{editor system.enchantement target="system.enchantement" button=true owner=owner editable=editable}}
-
- -
- {{editor system.enchantement target="system.enchantement" button=true owner=owner editable=editable}} -
-
-
- -
- {{editor system.sureffet target="system.sureffet" button=true owner=owner editable=editable}} -
+
+
+ +
+ {{editor system.sureffet target="system.sureffet" button=true owner=owner editable=editable}}
+
- {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-recettecuisine-sheet.html b/templates/item-recettecuisine-sheet.html index 5db2f1f4..4b2a7370 100644 --- a/templates/item-recettecuisine-sheet.html +++ b/templates/item-recettecuisine-sheet.html @@ -1,42 +1,34 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
-
- - -
-
- - -
system -
- - -
-
- - -
-
- - -
-
- -
- {{editor system.ingredients target="system.ingredients" button=true owner=owner editable=editable}} -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} + {{!-- Sheet Body --}} +
+
+ + +
+
+ + +
system +
+ + +
+
+ + +
+
+ + +
+
+ +
+ {{editor system.ingredients target="system.ingredients" button=true owner=owner editable=editable}}
+
- {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-rencontresTMR-sheet.html b/templates/item-rencontresTMR-sheet.html index 66fd689b..7cbaf61a 100644 --- a/templates/item-rencontresTMR-sheet.html +++ b/templates/item-rencontresTMR-sheet.html @@ -1,16 +1,7 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
- - {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} + {{!-- Sheet Body --}} +
+ {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-sort-sheet.html b/templates/item-sort-sheet.html index 7edd1940..d36c53ce 100644 --- a/templates/item-sort-sheet.html +++ b/templates/item-sort-sheet.html @@ -1,82 +1,74 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
- {{#if owner}} - {{#each bonusCaseList as |bcData key|}} -
- - - -
- {{/each}} - {{/if}} + {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} + {{!-- Sheet Body --}} +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ {{#if owner}} + {{#each bonusCaseList as |bcData key|}} +
+ + + +
+ {{/each}} + {{/if}} - {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-souffle-sheet.html b/templates/item-souffle-sheet.html index 086876d8..328f252c 100644 --- a/templates/item-souffle-sheet.html +++ b/templates/item-souffle-sheet.html @@ -1,16 +1,8 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} + {{!-- Sheet Body --}} +
- {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-tache-sheet.html b/templates/item-tache-sheet.html index e0455353..cd64c489 100644 --- a/templates/item-tache-sheet.html +++ b/templates/item-tache-sheet.html @@ -1,80 +1,72 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
-
- - -
-
- - + {{#select system.carac}} + {{#each caracList as |carac key|}} + + {{/each}} + {{/select}}
-
- - -
-
- - -
-
- - -
- {{#if isGM}} -
- - -
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ {{#if isGM}} +
+ + +
+
+ + +
+ {{else}}
+ {{#if system.cacher_points_de_tache}} + + {{else}} + {{/if}}
- {{else}} -
- - {{#if system.cacher_points_de_tache}} - - {{else}} - - {{/if}} -
- {{/if}} -
-
- - -
-
- - -
-
- - -
+ {{/if}} +
+
+ + +
+
+ + +
+
+ + +
- {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-tarot-sheet.html b/templates/item-tarot-sheet.html index 5e2ab701..3dda13be 100644 --- a/templates/item-tarot-sheet.html +++ b/templates/item-tarot-sheet.html @@ -1,29 +1,21 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
-
-
- - -
-
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} + {{!-- Sheet Body --}} +
+
+
+ + +
+
+ + +
- {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
diff --git a/templates/item-tete-sheet.html b/templates/item-tete-sheet.html index 086876d8..63a8c886 100644 --- a/templates/item-tete-sheet.html +++ b/templates/item-tete-sheet.html @@ -1,16 +1,8 @@
-
- -
-

-
-
- - {{!-- Sheet Body --}} -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}} + {{!-- Sheet Body --}} +
- {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} +
From e1ca7ab73819729954be1f3a2ce8fbe5bf79bbbe Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 16 Sep 2022 02:22:09 +0200 Subject: [PATCH 3/4] =?UTF-8?q?Am=C3=A9lioration=20des=20monnaies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On peut maintenant supprimer es monnaies tant qu'on garde une monnaie pour chaque valeur de base --- module/actor.js | 1 - module/item-monnaie.js | 17 ++++++++++++----- module/rdd-utility.js | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/module/actor.js b/module/actor.js index 6085a5f9..b4bfe9c4 100644 --- a/module/actor.js +++ b/module/actor.js @@ -200,7 +200,6 @@ export class RdDActor extends Actor { async checkMonnaiePresence() { // Ajout opportuniste si les pièces n'existent pas. if (!this.items) return; // Sanity check during import let manquantes = Monnaie.monnaiesManquantes(this.itemTypes['monnaie']); - //console.log("Manque : ", manquantes); if (manquantes.length > 0) { await this.createEmbeddedDocuments('Item', manquantes, { renderSheet: false }); } diff --git a/module/item-monnaie.js b/module/item-monnaie.js index bff8385c..077d4d2a 100644 --- a/module/item-monnaie.js +++ b/module/item-monnaie.js @@ -22,12 +22,19 @@ const MONNAIES_STANDARD = [ system: { quantite: 0, valeur_deniers: 1000, encombrement: 0.004, description: "" } } ] +const VALEURS_STANDARDS = MONNAIES_STANDARD.map(it =>it.system.valeur_deniers); export class Monnaie { - static isSystemMonnaie(item) { - let present = MONNAIES_STANDARD.find(monnaie => monnaie.system.valeur_deniers == item?.system?.valeur_deniers); - return present; + static isSystemMonnaie(item, items) { + if (item.type == 'monnaie') { + const valeur = item.system.valeur_deniers; + if (VALEURS_STANDARDS.includes(valeur)) { + const monnaiesDeValeur = items.filter(it => it.type == 'monnaie' && it.system.valeur_deniers == valeur) + return monnaiesDeValeur.length<=1; + } + } + return false; } static monnaiesData() { @@ -40,10 +47,10 @@ export class Monnaie { static monnaiesManquantes(disponibles) { const manquantes = MONNAIES_STANDARD.filter(standard => !disponibles.find(disponible => Monnaie.deValeur(disponible, standard.system?.valeur_deniers))); - if (manquantes.length>0) { + if (manquantes.length > 0) { console.error('monnaiesManquantes', manquantes, ' avec monnaies', disponibles, MONNAIES_STANDARD); } - return []; //manquantes; + return manquantes; } static deValeur(monnaie, valeur) { diff --git a/module/rdd-utility.js b/module/rdd-utility.js index 3ceecdac..04bcb0c9 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -861,7 +861,7 @@ export class RdDUtility { let itemId = li.data("item-id"); let objet = actorSheet.actor.getObjet(itemId); - if (objet.type == 'monnaie' && Monnaie.isSystemMonnaie(objet)) { + if (Monnaie.isSystemMonnaie(objet, actorSheet.actor.items)) { ui.notifications.warn("Suppression des monnaies de base impossible"); return; } From c8c13d626c717ffe9d53c8c0c11fe3585d8c5560 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 16 Sep 2022 02:41:54 +0200 Subject: [PATCH 4/4] Fix drop item sans actor --- module/rdd-sheet-utility.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/rdd-sheet-utility.js b/module/rdd-sheet-utility.js index 1289aef1..9f52b7b6 100644 --- a/module/rdd-sheet-utility.js +++ b/module/rdd-sheet-utility.js @@ -26,7 +26,7 @@ export class RdDSheetUtility { destId: destItemId, targetActorId: actorId, itemId: item.id, - sourceActorId: item.actor.id, + sourceActorId: item.actor?.id, srcId: objetVersConteneur[item.id], onEnleverConteneur: () => { delete objetVersConteneur[item.id]; }, onAjouterDansConteneur: (itemId, conteneurId) => { objetVersConteneur[itemId] = conteneurId; }