From 76a5afc79ee6b32d082b4b2e4918d348871b9e87 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnier Date: Wed, 18 Feb 2026 11:35:46 +0100 Subject: [PATCH] Fix buildSkillConfig to work with DataModels Replace game.data.template.Actor reference with hardcoded skill structure. With DataModels, template.json is no longer used at runtime. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- modules/common/ecryme-utility.js | 41 +++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/modules/common/ecryme-utility.js b/modules/common/ecryme-utility.js index 642a714..1aae5f1 100644 --- a/modules/common/ecryme-utility.js +++ b/modules/common/ecryme-utility.js @@ -123,12 +123,47 @@ export class EcrymeUtility { /*-------------------------------------------- */ static buildSkillConfig() { + // Build skill configuration from DataModel structure game.system.ecryme.config.skills = {} - for (let categKey in game.data.template.Actor.templates.core.skills) { - let category = game.data.template.Actor.templates.core.skills[categKey] + + const skillCategories = { + physical: { + name: "ECRY.ui.physical", + skilllist: { + athletics: { key: "athletics", name: "ECRY.ui.athletics", max: 0, value: 0 }, + driving: { key: "driving", name: "ECRY.ui.driving", max: 0, value: 0 }, + fencing: { key: "fencing", name: "ECRY.ui.fencing", max: 0, value: 0 }, + brawling: { key: "brawling", name: "ECRY.ui.brawling", max: 0, value: 0 }, + shooting: { key: "shooting", name: "ECRY.ui.shooting", max: 0, value: 0 } + } + }, + mental: { + name: "ECRY.ui.mental", + skilllist: { + anthropomecanology: { key: "anthropomecanology", name: "ECRY.ui.anthropomecanology", max: 10, value: 0 }, + ecrymology: { key: "ecrymology", name: "ECRY.ui.ecrymology", max: 10, value: 0 }, + traumatology: { key: "traumatology", name: "ECRY.ui.traumatology", max: 10, value: 0 }, + traversology: { key: "traversology", name: "ECRY.ui.traversology", max: 10, value: 0 }, + urbatechnology: { key: "urbatechnology", name: "ECRY.ui.urbatechnology", max: 10, value: 0 } + } + }, + social: { + name: "ECRY.ui.social", + skilllist: { + quibbling: { key: "quibbling", name: "ECRY.ui.quibbling", max: 10, value: 0 }, + creativity: { key: "creativity", name: "ECRY.ui.creativity", max: 10, value: 0 }, + loquacity: { key: "loquacity", name: "ECRY.ui.loquacity", max: 10, value: 0 }, + guile: { key: "guile", name: "ECRY.ui.guile", max: 10, value: 0 }, + performance: { key: "performance", name: "ECRY.ui.performance", max: 10, value: 0 } + } + } + } + + for (let categKey in skillCategories) { + let category = skillCategories[categKey] for (let skillKey in category.skilllist) { let skill = foundry.utils.duplicate(category.skilllist[skillKey]) - skill.categKey = categKey // Auto reference the category + skill.categKey = categKey game.system.ecryme.config.skills[skillKey] = skill } }