Migration complète vers DataModels Foundry VTT

- Ajout de 14 DataModels (10 Items + 3 Acteurs)
  * Items: equipment, weapon, trait, specialization, maneuver, scar, annency, boheme, contact, confrontation
  * Acteurs: pc, npc, annency

- Corrections d'initialisation
  * Ordre d'initialisation corrigé (CONFIG.dataModels avant game.system)
  * Import dynamique des DataModels pour éviter timing issues
  * Helper functions pour éviter réutilisation de champs

- Documentation complète
  * AUDIT_DATAMODELS.md: Rapport d'audit complet (85+ champs vérifiés)
  * MIGRATION_DATAMODELS.md: Guide de migration
  * FIX_INIT_ERROR.md: Résolution des erreurs
  * BABELE_ERROR_ANALYSIS.md: Analyse erreur Babele
  * RESUME_MIGRATION.md: Résumé complet
  * modules/models/README.md: Documentation des DataModels

- template.json marqué comme DEPRECATED
- changelog.md mis à jour

Note: Erreur Babele/LibWrapper non résolue (problème de module externe)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 11:32:29 +01:00
parent e47ad95a38
commit f130f24a23
24 changed files with 1276 additions and 4 deletions

16
modules/models/weapon.js Normal file
View File

@@ -0,0 +1,16 @@
/**
* Data model pour les armes
*/
export default class EcrymeWeaponDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({ initial: "" }),
weight: new fields.NumberField({ initial: 0, integer: true, min: 0 }),
cost: new fields.NumberField({ initial: 0, integer: true, min: 0 }),
costunit: new fields.StringField({ initial: "" }),
weapontype: new fields.StringField({ initial: "melee", choices: { melee: "Mêlée", ranged: "Distance" } }),
effect: new fields.NumberField({ initial: 0, integer: true })
};
}
}