From 5600e37991fa757da38a5dc326bf8d3105e6b16c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-Xavier=20Guillois?= Date: Mon, 4 Sep 2023 09:44:41 +0200 Subject: [PATCH] npc sheet --- lang/en.json | 45 ++++++++++++++++--- module/system/config.mjs | 31 ++++++++++--- module/system/handlebars-manager.mjs | 36 +++++++++++++++ templates/actor/actor-npc-sheet.html | 65 ++++++++++++++++++---------- 4 files changed, 144 insertions(+), 33 deletions(-) diff --git a/lang/en.json b/lang/en.json index 55bce54..baca1fd 100644 --- a/lang/en.json +++ b/lang/en.json @@ -76,6 +76,25 @@ "morale_level": "Niveau de moral", "notes": "Notes" }, + "ADVERSITY": { + "threat": "Menace", + "experience": "Expérience", + "role": "Rôle", + "attack": "Attaque", + "damage": "Dommages", + "weapon": "Arme", + "vigor": "Vigueur", + "wounds": "Blessures", + "action": "Action", + "specialties": "Spécialité", + "rerolls": "Relances", + "contact": "Contact", + "reaction": "Réaction", + "pools":"Réserves", + "gear": "Matériel", + "protection": "Protection" + }, + "VERMINE": { "name": "Vermine", "stats": "Statistiques", @@ -163,6 +182,26 @@ "will":{ "name": "Volonté"}, "empathy":{ "name": "Empathie"} }, + "SKILLS_LEVELS": { + "beginner": "Débutant", + "proficient": "Confirmé", + "expert":"Expert", + "master":"Maître", + "legend":"Légende" + }, + "THREAT_LEVELS": { + "minor": "Mineure", + "serious": "Sérieuse", + "major":"Majeure", + "deadly":"Mortelle" + }, + "ROLE_LEVELS": { + "minor": "Mineur", + "secondaray": "Secondaire", + "important":"Important", + "major":"Majeur" + }, + "VERMINE.effect_treate": "Create Effect", "VERMINE.effect_toggle": "Toggle Effect", @@ -170,12 +209,6 @@ "VERMINE.effect_delete": "Delete Effect", "VERMINE.Add": "Ajouter", - - "VERMINE.skill_level.beginner": "Débutant", - "VERMINE.skill_level.proficient": "Confirmé", - "VERMINE.skill_level.expert": "Expert", - "VERMINE.skill_level.master": "Maître", - "VERMINE.skill_level.legend": "Légende", "TOTEMS": { "human": { diff --git a/module/system/config.mjs b/module/system/config.mjs index 50d84b8..b9d6d02 100644 --- a/module/system/config.mjs +++ b/module/system/config.mjs @@ -12,11 +12,11 @@ VERMINE.AgeTypes = { } VERMINE.SkillLevels = { - 1:{ "label":"VERMINE.skill_level.beginner", "dicePool":1, "reroll":0}, - 2:{ "label":"VERMINE.skill_level.proficient", "dicePool":1, "reroll":1}, - 3:{ "label":"VERMINE.skill_level.expert", "dicePool":2, "reroll":1}, - 4:{ "label":"VERMINE.skill_level.master", "dicePool":2, "reroll":2}, - 5:{ "label":"VERMINE.skill_level.legend", "dicePool":3, "reroll":2} + 1:{ "label":"SKILL_LEVELS.beginner", "dicePool":1, "reroll":0}, + 2:{ "label":"SKILL_LEVELS.proficient", "dicePool":1, "reroll":1}, + 3:{ "label":"SKILL_LEVELS.expert", "dicePool":2, "reroll":1}, + 4:{ "label":"SKILL_LEVELS.master", "dicePool":2, "reroll":2}, + 5:{ "label":"SKILL_LEVELS.legend", "dicePool":3, "reroll":2} } VERMINE.DifficultyLevels = { @@ -27,6 +27,27 @@ VERMINE.DifficultyLevels = { 5:{ "label":"DIFFICULTY_LEVELS.impossible", "difficulty":10} }, +VERMINE.ThreatLevels = { + 1:{ "label":"THREAT_LEVELS.minor", "attack":3, "vigor":1, "minorWound":1, "majorWound":1, "deadlyWound":1}, + 2:{ "label":"THREAT_LEVELS.serious", "attack":4, "vigor":2, "minorWound":2, "majorWound":1, "deadlyWound":1}, + 3:{ "label":"THREAT_LEVELS.major", "attack":5, "vigor":3, "minorWound":2, "majorWound":1, "deadlyWound":1}, + 4:{ "label":"THREAT_LEVELS.deadly", "attack":6, "vigor":4, "minorWound":2, "majorWound":2, "deadlyWound":2}, +} + +VERMINE.ExperienceLevels = { + 1:{ "label":"SKILL_LEVELS.beginner", "action":3, "specialties":4, "rerolls":0, "contact":"7"}, + 2:{ "label":"SKILL_LEVELS.proficient", "action":3, "specialties":5, "rerolls":0, "contact":"5 ou 7"}, + 3:{ "label":"SKILL_LEVELS.expert", "action":4, "specialties":6, "rerolls":1, "contact":"5,7 ou 9"}, + 4:{ "label":"SKILL_LEVELS.master", "action":4, "specialties":6, "rerolls":2, "contact":"3,5,7 ou 9"}, +} + +VERMINE.RoleLevels = { + 1:{ "label":"ROLE_LEVELS.minor", "reaction":3, "reaction_bonus":0, "pools":0, "gear":9, "gear_hindrance":0, "protection":1}, + 2:{ "label":"ROLE_LEVELS.secondary", "reaction":3,"reaction_bonus":1, "pools":1, "gear":9,"gear_hindrance":1, "protection":2}, + 3:{ "label":"ROLE_LEVELS.important", "reaction":3, "reaction_bonus":2, "pools":2, "gear":9,"gear_hindrance":2, "protection":3}, + 4:{ "label":"ROLE_LEVELS.major", "reaction":4, "reaction_bonus":2, "pools":4, "gear":10, "gear_hindrance":2, "protection":3}, +} + VERMINE.abilityCategories = { "physical": { "label":"VERMINE.ability_category.physical" diff --git a/module/system/handlebars-manager.mjs b/module/system/handlebars-manager.mjs index ad797e1..36352ae 100644 --- a/module/system/handlebars-manager.mjs +++ b/module/system/handlebars-manager.mjs @@ -61,6 +61,42 @@ export const registerHandlebarsHelpers = function () { }); + // return threat level information + Handlebars.registerHelper('threatLevel', function (property, level, options) { + if (level < 1 || level > 5) + return ""; + let levelData = CONFIG.VERMINE.ThreatLevels[level]; + if (property == 'label'){ + return (levelData !== undefined) ? game.i18n.localize(levelData[property]) : ""; + } else { + return (levelData !== undefined) ? levelData[property] : ""; + } + }); + + // return experience level information + Handlebars.registerHelper('experienceLevel', function (property, level, options) { + if (level < 1 || level > 5) + return ""; + let levelData = CONFIG.VERMINE.ExperienceLevels[level]; + if (property == 'label'){ + return (levelData !== undefined) ? game.i18n.localize(levelData[property]) : ""; + } else { + return (levelData !== undefined) ? levelData[property] : ""; + } + }); + + // return role level information + Handlebars.registerHelper('roleLevel', function (property, level, options) { + if (level < 1 || level > 5) + return ""; + let levelData = CONFIG.VERMINE.RoleLevels[level]; + if (property == 'label'){ + return (levelData !== undefined) ? game.i18n.localize(levelData[property]) : ""; + } else { + return (levelData !== undefined) ? levelData[property] : ""; + } + }); + // return skill level information Handlebars.registerHelper('skillLevel', function (property, level, options) { if (level < 1 || level > 5) diff --git a/templates/actor/actor-npc-sheet.html b/templates/actor/actor-npc-sheet.html index 0d43778..c742b90 100644 --- a/templates/actor/actor-npc-sheet.html +++ b/templates/actor/actor-npc-sheet.html @@ -1,42 +1,29 @@ -
+ {{!-- Sheet Header --}}

- {{!-- The grid classes are defined in scss/global/_grid.scss. To use, - use both the "grid" and "grid-Ncol" class where "N" can be any number - from 1 to 12 and will create that number of columns. --}}
- - {{!-- "flex-group-center" is also defined in the _grid.scss file - and it will add a small amount of padding, a border, and will - center all of its child elements content and text. --}}
- +
- - / - +
- +
- - / - +
- +
- - / - +
@@ -57,8 +44,42 @@ {{!-- Biography Tab --}}
- {{!-- If you want TinyMCE editors to output inline rolls when rendered, you need to pass the actor's roll data to the rollData property. --}} - {{editor system.biography target="system.biography" rollData=rollData button=true owner=owner editable=editable}} +
+
+

{{ localize 'ADVERSITY.threat'}}

+
    +
  • {{ localize 'ADVERSITY.attack'}} {{ threatLevel "attack" system.threat.value }}
  • +
  • +
  • {{ localize 'ADVERSITY.damage'}}
  • +
  • {{ localize 'ADVERSITY.weapon'}}
  • +
  • {{ localize 'ADVERSITY.vigor'}} {{ threatLevel "vigor" system.threat.value }}
  • +
  • {{ localize 'ADVERSITY.wounds'}} {{ threatLevel "minorWound" system.threat.value }}/{{ threatLevel "majorWound" system.threat.value }}/{{ threatLevel "deadlyWound" system.threat.value }}
  • +
+ +
+
+

{{ localize 'ADVERSITY.experience'}}

+
    +
  • {{ localize 'ADVERSITY.action'}} {{ experienceLevel "action" system.experience.value }}
  • +
  • {{ localize 'ADVERSITY.specialties'}} {{ experienceLevel "specialties" system.experience.value }}
  • +
  • {{ localize 'ADVERSITY.rerolls'}} {{ experienceLevel "rerolls" system.experience.value }}
  • +
  • {{ localize 'ADVERSITY.contact'}} {{ experienceLevel "contact" system.experience.value }}
  • +
+
+
+

{{ localize 'ADVERSITY.role'}}

+
    +
  • {{ localize 'ADVERSITY.reaction'}} {{ roleLevel "reaction" system.role.value }} + {{ roleLevel "reaction_bonus" system.role.value }}
  • +
  • {{ localize 'ADVERSITY.pools'}} {{ roleLevel "pools" system.role.value }}
  • +
  • {{ localize 'ADVERSITY.gear'}} {{ roleLevel "gear" system.role.value }}
  • +
  • {{ localize 'ADVERSITY.protection'}} {{ roleLevel "protection" system.role.value }}
  • +
+
+
+
+

{{ localize 'IDENTITY.notes'}}

+ {{editor system.biography target="system.biography" button=true owner=owner editable=editable}} +
{{!-- Owned Items Tab --}}