From f8f889e9f9da1042289fa1d0692a19e2071550f5 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 5 Oct 2024 15:13:29 +0200 Subject: [PATCH] =?UTF-8?q?Jets=20de=20vie/endurance/r=C3=AAve=20actuel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/actor-sheet.js | 2 +- .../export-scriptarium/actor-encart-sheet.js | 3 ++ module/actor/export-scriptarium/mapping.js | 45 ++++++++++--------- .../export-scriptarium/actor-encart-sheet.hbs | 6 +-- .../export-scriptarium/carac-compteur.hbs | 19 ++++++++ .../carac-derivee-compteur.hbs | 19 ++++++++ .../export-scriptarium/carac-derivee.hbs | 10 ++++- templates/actor/export-scriptarium/carac.hbs | 8 +++- templates/actor/header-compteurs.html | 2 +- 9 files changed, 86 insertions(+), 28 deletions(-) create mode 100644 templates/actor/export-scriptarium/carac-compteur.hbs create mode 100644 templates/actor/export-scriptarium/carac-derivee-compteur.hbs diff --git a/module/actor-sheet.js b/module/actor-sheet.js index cba5cf81..1a9d1567 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -218,7 +218,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet { } // Points de reve actuel - this.html.find('.ptreve-actuel a').click(async event => this.actor.rollCarac('reve-actuel', true)) + this.html.find('.roll-reve-actuel').click(async event => this.actor.rollCarac('reve-actuel', true)) this.html.find('.empoignade-label a').click(async event => RdDEmpoignade.onAttaqueEmpoignadeFromItem(RdDSheetUtility.getItem(event, this.actor))) this.html.find('.arme-label a').click(async event => this.actor.rollArme(foundry.utils.duplicate(this._getEventArmeCombat(event)))) diff --git a/module/actor/export-scriptarium/actor-encart-sheet.js b/module/actor/export-scriptarium/actor-encart-sheet.js index 9fbbc6d1..8b997b95 100644 --- a/module/actor/export-scriptarium/actor-encart-sheet.js +++ b/module/actor/export-scriptarium/actor-encart-sheet.js @@ -10,7 +10,9 @@ export class RdDActorExportSheet extends RdDActorSheet { await loadTemplates([ "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/arme.hbs", "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac.hbs", + "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-compteur.hbs", "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee.hbs", + "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee-compteur.hbs", "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/competences.hbs", "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/esquive.hbs", "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/protection.hbs", @@ -46,6 +48,7 @@ export class RdDActorExportSheet extends RdDActorSheet { return Object.fromEntries(Mapping.getMapping().map(it => [it.column, { colName: it.colName ?? it.column, column: it.column, + rollClass: it.rollClass, value: it.getter(this.actor, context) }])) } diff --git a/module/actor/export-scriptarium/mapping.js b/module/actor/export-scriptarium/mapping.js index baa94bc2..3ffa059c 100644 --- a/module/actor/export-scriptarium/mapping.js +++ b/module/actor/export-scriptarium/mapping.js @@ -57,35 +57,38 @@ const MAPPING_BASE = [ { column: "metier", colName: 'Métier', getter: (actor, context) => actor.system.metier }, { column: "biographie", colName: 'Biographie', getter: (actor, context) => actor.system.biographie }, { column: "taille", getter: (actor, context) => actor.system.carac.taille.value }, - { column: "apparence", getter: (actor, context) => actor.system.carac.apparence.value }, - { column: "constitution", getter: (actor, context) => actor.system.carac.constitution.value }, - { column: "force", getter: (actor, context) => actor.system.carac.force.value }, - { column: "agilite", colName: 'Agilité', getter: (actor, context) => actor.system.carac.agilite.value }, - { column: "dexterite", colName: 'Dextérité', getter: (actor, context) => actor.system.carac.dexterite.value }, - { column: "vue", getter: (actor, context) => actor.system.carac.vue.value }, - { column: "ouie", colName: 'Ouïe', getter: (actor, context) => actor.system.carac.ouie.value }, - { column: "odoratgout", colName: 'Odo-goût', getter: (actor, context) => actor.system.carac.odoratgout.value }, - { column: "volonte", colName: 'Volonté', getter: (actor, context) => actor.system.carac.volonte.value }, - { column: "intellect", getter: (actor, context) => actor.system.carac.intellect.value }, - { column: "empathie", getter: (actor, context) => actor.system.carac.empathie.value }, - { column: "reve", colName: 'Rêve', getter: (actor, context) => actor.system.carac.reve.value }, - { column: "chance", getter: (actor, context) => actor.system.carac.chance.value }, - { column: "melee", colName: 'Mêlée', getter: (actor, context) => actor.system.carac.melee.value }, - { column: "tir", getter: (actor, context) => actor.system.carac.tir.value }, - { column: "lancer", getter: (actor, context) => actor.system.carac.lancer.value }, - { column: "derobee", colName: 'Dérobée', getter: (actor, context) => actor.system.carac.derobee.value }, + { column: "apparence", rollClass: 'roll-carac', getter: (actor, context) => actor.system.carac.apparence.value }, + { column: "constitution", rollClass: 'roll-carac', getter: (actor, context) => actor.system.carac.constitution.value }, + { column: "force", rollClass: 'roll-carac', getter: (actor, context) => actor.system.carac.force.value }, + { column: "agilite", rollClass: 'roll-carac', colName: 'Agilité', getter: (actor, context) => actor.system.carac.agilite.value }, + { column: "dexterite", rollClass: 'roll-carac', colName: 'Dextérité', getter: (actor, context) => actor.system.carac.dexterite.value }, + { column: "vue", rollClass: 'roll-carac', getter: (actor, context) => actor.system.carac.vue.value }, + { column: "ouie", rollClass: 'roll-carac', colName: 'Ouïe', getter: (actor, context) => actor.system.carac.ouie.value }, + { column: "odoratgout", rollClass: 'roll-carac', colName: 'Odo-goût', getter: (actor, context) => actor.system.carac.odoratgout.value }, + { column: "volonte", rollClass: 'roll-carac', colName: 'Volonté', getter: (actor, context) => actor.system.carac.volonte.value }, + { column: "intellect", rollClass: 'roll-carac', getter: (actor, context) => actor.system.carac.intellect.value }, + { column: "empathie", rollClass: 'roll-carac', getter: (actor, context) => actor.system.carac.empathie.value }, + { column: "reve", rollClass: 'roll-carac', colName: 'Rêve', getter: (actor, context) => actor.system.carac.reve.value }, + { column: "chance", rollClass: 'roll-carac', getter: (actor, context) => actor.system.carac.chance.value }, + { column: "melee", rollClass: 'roll-carac', colName: 'Mêlée', getter: (actor, context) => actor.system.carac.melee.value }, + { column: "tir", rollClass: 'roll-carac', getter: (actor, context) => actor.system.carac.tir.value }, + { column: "lancer", rollClass: 'roll-carac', getter: (actor, context) => actor.system.carac.lancer.value }, + { column: "derobee", rollClass: 'roll-carac', colName: 'Dérobée', getter: (actor, context) => actor.system.carac.derobee.value }, { column: "vie", getter: (actor, context) => actor.system.sante.vie.max }, + { column: "endurance", getter: (actor, context) => actor.system.sante.endurance.max }, { column: "plusdom", colName: '+dom', getter: (actor, context) => actor.system.attributs.plusdom.value }, { column: "protectionnaturelle", colName: 'Protection naturelle', getter: (actor, context) => actor.system.attributs.protection.value > 0 ? actor.system.attributs.protection.value : '' }, - { column: "endurance", getter: (actor, context) => actor.system.sante.endurance.max }, { column: "description", getter: (actor, context) => Mapping.getDescription(actor) }, { column: "armure", getter: (actor, context) => Mapping.getArmure(actor, context) }, { column: "protectionarmure", colName: 'Protection', getter: (actor, context) => Mapping.getProtectionArmure(actor, context) }, { column: "malus_armure", getter: (actor, context) => Mapping.getMalusArmure(actor, context) }, + { column: "reve_actuel", rollClass: 'roll-reve-actuel', colName: 'Rêve actuel', getter: (actor, context) => actor.system.reve.reve.value }, + { column: "vie_actuel", rollClass: 'jet-vie', getter: (actor, context) => actor.system.sante.vie.value }, + { column: "endurance_actuel", rollClass: 'jet-vie', getter: (actor, context) => actor.system.sante.endurance.value }, { column: "esquive", getter: (actor, context) => Mapping.getEsquive(context) }, { column: "esquive_armure", getter: (actor, context) => Mapping.getEsquiveArmure(context) }, { column: "competences", getter: (actor, context) => Mapping.getCompetences(actor, CATEGORIES_COMPETENCES) }, - { column: "draconic", getter: (actor, context) => Mapping.getCompetences(actor, CATEGORIES_DRACONIC) }, + { column: "draconic", getter: (actor, context) => Mapping.getCompetences(actor, CATEGORIES_DRACONIC) }, ] const MAPPING_ARMES = TABLEAU_ARMES.map(i => ColumnMappingFactory.createMappingArme('name', i)) @@ -212,7 +215,7 @@ export class Mapping { } static prepareSorts(actor) { - const codeVoies = Mapping.getCompetencesCategorie(actor, CATEGORIES_DRACONIC) + const codeVoies = Mapping.getCompetencesCategorie(actor, CATEGORIES_DRACONIC) .map(it => RdDItemSort.getVoieCode(it)) return actor.itemTypes[ITEM_TYPES.sort].map(it => Mapping.prepareSort(it, codeVoies)) @@ -263,7 +266,7 @@ export class Mapping { const poids = actor.system.poids const cheveux = actor.system.cheveux ? `cheveux ${actor.system.cheveux}` : undefined const yeux = actor.system.yeux ? `yeux ${actor.system.yeux}` : undefined - const beaute = actor.system.beaute ? `Beauté ${actor.system.beaute}` : undefined + const beaute = actor.system.beaute ? `beauté ${actor.system.beaute}` : undefined const list = [race, hn, age, taille, poids, cheveux, yeux, beaute] return Misc.join(list.filter(it => it), ', ') } diff --git a/templates/actor/export-scriptarium/actor-encart-sheet.hbs b/templates/actor/export-scriptarium/actor-encart-sheet.hbs index 8b9e713f..3b5cccca 100644 --- a/templates/actor/export-scriptarium/actor-encart-sheet.hbs +++ b/templates/actor/export-scriptarium/actor-encart-sheet.hbs @@ -26,7 +26,7 @@ {{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac.hbs" carac=export.volonte}} {{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac.hbs" carac=export.empathie}} {{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac.hbs" carac=export.intellect}} - {{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac.hbs" carac=export.reve}} + {{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-compteur.hbs" carac=export.reve actuel=export.reve_actuel}} {{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac.hbs" carac=export.chance}}
@@ -34,8 +34,8 @@ {{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee.hbs" carac=export.tir}} {{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee.hbs" carac=export.lancer}} {{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee.hbs" carac=export.derobee}} - {{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee.hbs" carac=export.vie}} - {{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee.hbs" carac=export.endurance}} + {{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee-compteur.hbs" carac=export.vie actuel=export.vie_actuel}} + {{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee-compteur.hbs" carac=export.endurance actuel=export.vie_actuel}} {{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee.hbs" carac=export.plusdom}} {{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/protection.hbs" export}}
diff --git a/templates/actor/export-scriptarium/carac-compteur.hbs b/templates/actor/export-scriptarium/carac-compteur.hbs new file mode 100644 index 00000000..faafc9b9 --- /dev/null +++ b/templates/actor/export-scriptarium/carac-compteur.hbs @@ -0,0 +1,19 @@ +
+
+ {{#if carac.rollClass}} + + {{upper carac.colName}} + + {{else}} + {{upper carac.colName}} + {{/if}} +
+ +
diff --git a/templates/actor/export-scriptarium/carac-derivee-compteur.hbs b/templates/actor/export-scriptarium/carac-derivee-compteur.hbs new file mode 100644 index 00000000..6cca1bc4 --- /dev/null +++ b/templates/actor/export-scriptarium/carac-derivee-compteur.hbs @@ -0,0 +1,19 @@ +
+
+ {{#if carac.rollClass}} + + {{upperFirst carac.colName}} + + {{else}} + {{upperFirst carac.colName}} + {{/if}} +
+ +
diff --git a/templates/actor/export-scriptarium/carac-derivee.hbs b/templates/actor/export-scriptarium/carac-derivee.hbs index d850534c..eab6d2fc 100644 --- a/templates/actor/export-scriptarium/carac-derivee.hbs +++ b/templates/actor/export-scriptarium/carac-derivee.hbs @@ -1,4 +1,12 @@
-
{{upperFirst carac.colName}}
+
+ {{#if carac.rollClass}} + + {{upperFirst carac.colName}} + + {{else}} + {{upperFirst carac.colName}} + {{/if}} +
{{carac.value}}
diff --git a/templates/actor/export-scriptarium/carac.hbs b/templates/actor/export-scriptarium/carac.hbs index 94a64c06..776ed1c3 100644 --- a/templates/actor/export-scriptarium/carac.hbs +++ b/templates/actor/export-scriptarium/carac.hbs @@ -1,4 +1,10 @@
-
{{upper carac.colName}}
+
+ {{#if carac.rollClass}} + {{upper carac.colName}} + {{else}} + {{upper carac.colName}} + {{/if}} +
{{carac.value}}
diff --git a/templates/actor/header-compteurs.html b/templates/actor/header-compteurs.html index 23d0f0aa..89904278 100644 --- a/templates/actor/header-compteurs.html +++ b/templates/actor/header-compteurs.html @@ -30,7 +30,7 @@