Refonte complète du système Anomalies

- DataModel : renommage value→level (1-4), ajout usesRemaining (0-4), suppression scores/notes
- Config : ajout ANOMALY_DEFINITIONS avec compétences applicables par type (8 anomalies)
- Fiche item anomalie : header avec level/uses visuels (dots), barre de compétences applicables,
  2 onglets Description + Technique/Narratif (suppression onglet Scores)
- Fiche PJ onglet Domaines : bloc anomalie proéminent unique avec:
  - Nom + sous-type + icône
  - Dots niveau (●●○○)
  - Dots usages + bouton Utiliser + bouton Réinitialiser
  - Chips des domaines applicables
- Actions : useAnomaly (décrémente usesRemaining), resetAnomalyUses (reset au niveau)
- Contrainte : max 1 anomalie par personnage (drop + createAnomaly)
- Helpers HBS : lte, gte, lt ajoutés
- i18n : nouvelles clés Anomaly.* (level, usesRemaining, use, resetUses, etc.)
- CSS : .anomaly-block sur fiche PJ, dots animés, .anomaly-uses-row sur fiche item

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-03-28 18:15:06 +01:00
parent cff700bd3d
commit f9ddcdf9da
11 changed files with 474 additions and 41 deletions

View File

@@ -4,7 +4,7 @@ import { SYSTEM } from "../../config/system.mjs"
export class CelestopolAnomalySheet extends CelestopolItemSheet {
static DEFAULT_OPTIONS = {
classes: ["anomaly"],
position: { width: 620, height: 560 },
position: { width: 560, height: 460 },
}
static PARTS = {
main: { template: "systems/fvtt-celestopol/templates/anomaly.hbs" },
@@ -12,7 +12,16 @@ export class CelestopolAnomalySheet extends CelestopolItemSheet {
async _prepareContext() {
const ctx = await super._prepareContext()
ctx.anomalyTypes = SYSTEM.ANOMALY_TYPES
ctx.skills = SYSTEM.SKILLS
const def = SYSTEM.ANOMALY_DEFINITIONS[ctx.system.subtype] ?? SYSTEM.ANOMALY_DEFINITIONS.none
ctx.applicableSkillLabels = def.technicalSkills.map(key => {
if (key === "lune") return game.i18n.localize("CELESTOPOL.Anomaly.moonDie")
for (const skills of Object.values(SYSTEM.SKILLS)) {
if (skills[key]) return game.i18n.localize(skills[key].label)
}
return key
})
ctx.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(
this.document.system.description, { async: true })
ctx.enrichedTechnique = await foundry.applications.ux.TextEditor.implementation.enrichHTML(