Files
fvtt-celestopol/module/config/system.mjs
LeRatierBretonnier f9ddcdf9da 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>
2026-03-28 18:15:06 +01:00

149 lines
8.2 KiB
JavaScript

export const SYSTEM_ID = "fvtt-celestopol"
export const ASCII = `
░█▀▀░█▀▀░█░░░█▀▀░█▀▀░▀█▀░█▀█░█▀█░█▀█░█░░
░█░░░█▀▀░█░░░█▀▀░▀▀█░░█░░█░█░█▀▀░█░█░█░░
░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀▀▀░░▀░░▀▀▀░▀░░░▀▀▀░▀▀▀
░░░░░░░░░░░░░░░░░░1922░░░░░░░░░░░░░░░░░░░
`
/** Les 4 attributs principaux (stats). Chacun a une résistance (res) et 4 domaines. */
export const STATS = {
ame: { id: "ame", label: "CELESTOPOL.Stat.ame" },
corps: { id: "corps", label: "CELESTOPOL.Stat.corps" },
coeur: { id: "coeur", label: "CELESTOPOL.Stat.coeur" },
esprit: { id: "esprit", label: "CELESTOPOL.Stat.esprit" },
}
/** Domaines groupées par attribut. */
export const SKILLS = {
ame: {
artifice: { id: "artifice", label: "CELESTOPOL.Skill.artifice", stat: "ame" },
attraction: { id: "attraction", label: "CELESTOPOL.Skill.attraction", stat: "ame" },
coercition: { id: "coercition", label: "CELESTOPOL.Skill.coercition", stat: "ame" },
faveur: { id: "faveur", label: "CELESTOPOL.Skill.faveur", stat: "ame" },
},
corps: {
echauffouree: { id: "echauffouree", label: "CELESTOPOL.Skill.echauffouree", stat: "corps" },
effacement: { id: "effacement", label: "CELESTOPOL.Skill.effacement", stat: "corps" },
mobilite: { id: "mobilite", label: "CELESTOPOL.Skill.mobilite", stat: "corps" },
prouesse: { id: "prouesse", label: "CELESTOPOL.Skill.prouesse", stat: "corps" },
},
coeur: {
appreciation: { id: "appreciation", label: "CELESTOPOL.Skill.appreciation", stat: "coeur" },
arts: { id: "arts", label: "CELESTOPOL.Skill.arts", stat: "coeur" },
inspiration: { id: "inspiration", label: "CELESTOPOL.Skill.inspiration", stat: "coeur" },
traque: { id: "traque", label: "CELESTOPOL.Skill.traque", stat: "coeur" },
},
esprit: {
instruction: { id: "instruction", label: "CELESTOPOL.Skill.instruction", stat: "esprit" },
mtechnologique: { id: "mtechnologique", label: "CELESTOPOL.Skill.mtechnologique", stat: "esprit" },
raisonnement: { id: "raisonnement", label: "CELESTOPOL.Skill.raisonnement", stat: "esprit" },
traitement: { id: "traitement", label: "CELESTOPOL.Skill.traitement", stat: "esprit" },
},
}
/** Liste plate de tous les domaines (utile pour les DataModels d'items). */
export const ALL_SKILLS = Object.values(SKILLS).flatMap(group => Object.values(group))
/** Types d'anomalies (pouvoirs paranormaux). */
export const ANOMALY_TYPES = {
none: { id: "none", label: "CELESTOPOL.Anomaly.none" },
entropie: { id: "entropie", label: "CELESTOPOL.Anomaly.entropie" },
communicationaveclesmorts:{ id: "communicationaveclesmorts",label: "CELESTOPOL.Anomaly.communicationaveclesmorts" },
illusion: { id: "illusion", label: "CELESTOPOL.Anomaly.illusion" },
suggestion: { id: "suggestion", label: "CELESTOPOL.Anomaly.suggestion" },
tarotdivinatoire: { id: "tarotdivinatoire", label: "CELESTOPOL.Anomaly.tarotdivinatoire" },
telekinesie: { id: "telekinesie", label: "CELESTOPOL.Anomaly.telekinesie" },
telepathie: { id: "telepathie", label: "CELESTOPOL.Anomaly.telepathie" },
voyageastral: { id: "voyageastral", label: "CELESTOPOL.Anomaly.voyageastral" },
}
/**
* Définitions des anomalies : compétences applicables pour l'usage Technique.
* "lune" est une clé spéciale désignant le dé de lune (Entropie).
* Les autres clés correspondent aux identifiants de domaine dans SKILLS.
*/
export const ANOMALY_DEFINITIONS = {
none: { technicalSkills: [] },
entropie: { technicalSkills: ["lune"] },
communicationaveclesmorts:{ technicalSkills: ["instruction", "mtechnologique", "raisonnement", "traitement"] },
telekinesie: { technicalSkills: ["echauffouree", "effacement", "mobilite", "prouesse"] },
telepathie: { technicalSkills: ["appreciation", "attraction", "echauffouree", "faveur"] },
tarotdivinatoire: { technicalSkills: ["appreciation", "arts", "inspiration", "traque"] },
illusion: { technicalSkills: ["coercition", "echauffouree", "effacement", "traque"] },
suggestion: { technicalSkills: ["artifice", "attraction", "coercition", "faveur"] },
voyageastral: { technicalSkills: ["appreciation", "mtechnologique", "traitement", "traque"] },
}
/** Factions du monde de Célestopol. */
export const FACTIONS = {
pinkerton: { id: "pinkerton", label: "CELESTOPOL.Faction.pinkerton" },
police: { id: "police", label: "CELESTOPOL.Faction.police" },
okhrana: { id: "okhrana", label: "CELESTOPOL.Faction.okhrana" },
lunanovatek: { id: "lunanovatek", label: "CELESTOPOL.Faction.lunanovatek" },
oto: { id: "oto", label: "CELESTOPOL.Faction.oto" },
syndicats: { id: "syndicats", label: "CELESTOPOL.Faction.syndicats" },
vorovskoymir:{ id: "vorovskoymir",label: "CELESTOPOL.Faction.vorovskoymir" },
cour: { id: "cour", label: "CELESTOPOL.Faction.cour" },
}
/** Niveaux de blessures avec leur malus associé. */
export const WOUND_LEVELS = [
{ id: 0, label: "CELESTOPOL.Wound.none", malus: 0 },
{ id: 1, label: "CELESTOPOL.Wound.anodin", malus: 0 },
{ id: 2, label: "CELESTOPOL.Wound.derisoire", malus: 0 },
{ id: 3, label: "CELESTOPOL.Wound.negligeable", malus: -1 },
{ id: 4, label: "CELESTOPOL.Wound.superficiel", malus: -1 },
{ id: 5, label: "CELESTOPOL.Wound.leger", malus: -2 },
{ id: 6, label: "CELESTOPOL.Wound.modere", malus: -2 },
{ id: 7, label: "CELESTOPOL.Wound.grave", malus: -3 },
{ id: 8, label: "CELESTOPOL.Wound.dramatique", malus: -999 },
]
/** Seuils de difficulté pour les jets de dés. */
export const DIFFICULTY_CHOICES = {
unknown: { id: "unknown", label: "CELESTOPOL.Difficulty.unknown", value: 0 },
facile: { id: "facile", label: "CELESTOPOL.Difficulty.facile", value: 5 },
normal: { id: "normal", label: "CELESTOPOL.Difficulty.normal", value: 7 },
difficile:{ id: "difficile", label: "CELESTOPOL.Difficulty.difficile", value: 9 },
ardu: { id: "ardu", label: "CELESTOPOL.Difficulty.ardu", value: 11 },
extreme: { id: "extreme", label: "CELESTOPOL.Difficulty.extreme", value: 13 },
}
/** Phases de la lune (dé de lune). */
export const MOON_DICE_PHASES = {
none: { id: "none", label: "CELESTOPOL.Moon.none", bonus: 0 },
nouvellelune: { id: "nouvellelune", label: "CELESTOPOL.Moon.nouvellelune", bonus: 0 },
premiercroissant: { id: "premiercroissant", label: "CELESTOPOL.Moon.premiercroissant", bonus: 1 },
premierquartier: { id: "premierquartier", label: "CELESTOPOL.Moon.premierquartier", bonus: 1 },
lunegibbeuse: { id: "lunegibbeuse", label: "CELESTOPOL.Moon.lunegibbeuse", bonus: 2 },
lunevoutee: { id: "lunevoutee", label: "CELESTOPOL.Moon.lunevoutee", bonus: 2 },
derniercroissant: { id: "derniercroissant", label: "CELESTOPOL.Moon.derniercroissant", bonus: 1 },
dernierquartier: { id: "dernierquartier", label: "CELESTOPOL.Moon.dernierquartier", bonus: 1 },
pleinelune: { id: "pleinelune", label: "CELESTOPOL.Moon.pleinelune", bonus: 3 },
}
/** Types d'équipements. */
export const EQUIPMENT_TYPES = {
autre: { id: "autre", label: "CELESTOPOL.Equipment.autre" },
arme: { id: "arme", label: "CELESTOPOL.Equipment.arme" },
protection:{ id: "protection",label: "CELESTOPOL.Equipment.protection" },
vehicule: { id: "vehicule", label: "CELESTOPOL.Equipment.vehicule" },
}
export const SYSTEM = {
id: SYSTEM_ID,
ASCII,
STATS,
SKILLS,
ALL_SKILLS,
ANOMALY_TYPES,
ANOMALY_DEFINITIONS,
FACTIONS,
WOUND_LEVELS,
DIFFICULTY_CHOICES,
MOON_DICE_PHASES,
EQUIPMENT_TYPES,
}