Corrections sur factions, aspects, degats et fiches PNJs

This commit is contained in:
2026-04-11 15:02:46 +02:00
parent 36516c3b08
commit 3358dea306
44 changed files with 2308 additions and 148 deletions

View File

@@ -1,3 +1,16 @@
/**
* Célestopol 1922 — Système FoundryVTT
*
* Célestopol 1922 est un jeu de rôle édité par Antre-Monde Éditions.
* Ce système FoundryVTT est une implémentation indépendante et n'est pas
* affilié à Antre-Monde Éditions,
* mais a été réalisé avec l'autorisation d'Antre-Monde Éditions.
*
* @author LeRatierBretonnien
* @copyright 20252026 LeRatierBretonnien
* @license CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0/
*/
import CelestopolActorSheet from "./base-actor-sheet.mjs"
import { SYSTEM } from "../../config/system.mjs"
@@ -18,6 +31,7 @@ export default class CelestopolCharacterSheet extends CelestopolActorSheet {
depenseXp: CelestopolCharacterSheet.#onDepenseXp,
supprimerXpLog: CelestopolCharacterSheet.#onSupprimerXpLog,
rollMoonDie: CelestopolCharacterSheet.#onRollMoonDie,
manageFactionAspects: CelestopolCharacterSheet.#onManageFactionAspects,
},
}
@@ -58,6 +72,11 @@ export default class CelestopolCharacterSheet extends CelestopolActorSheet {
context.anomalyTypes = SYSTEM.ANOMALY_TYPES
context.factions = SYSTEM.FACTIONS
context.woundLevels = SYSTEM.WOUND_LEVELS
context.selectedPrimaryFactionId = game.celestopol?.normalizeFactionId(this.document.system.faction) || ""
context.legacyPrimaryFactionValue = this.document.system.faction && !context.selectedPrimaryFactionId
? `${this.document.system.faction}`.trim()
: ""
context.primaryFactionLabel = game.celestopol?.getFactionDisplayLabel(this.document.system.faction) || this.document.system.faction
return context
}
@@ -94,6 +113,18 @@ export default class CelestopolCharacterSheet extends CelestopolActorSheet {
case "factions":
context.tab = context.tabs.factions
context.factionAspectSummary = game.celestopol?.getFactionAspectSummary(this.document) ?? null
context.factionLegend = [
{ value: "+4", label: game.i18n.localize("CELESTOPOL.Faction.levelAllies") },
{ value: "+3", label: game.i18n.localize("CELESTOPOL.Faction.levelAmicaux") },
{ value: "+2", label: game.i18n.localize("CELESTOPOL.Faction.levelPartenaires") },
{ value: "+1", label: game.i18n.localize("CELESTOPOL.Faction.levelBienveillants") },
{ value: "0", label: game.i18n.localize("CELESTOPOL.Faction.levelNeutres") },
{ value: "-1", label: game.i18n.localize("CELESTOPOL.Faction.levelMefiants") },
{ value: "-2", label: game.i18n.localize("CELESTOPOL.Faction.levelHostiles") },
{ value: "-3", label: game.i18n.localize("CELESTOPOL.Faction.levelRivaux") },
{ value: "-4", label: game.i18n.localize("CELESTOPOL.Faction.levelEnnemis") },
]
context.factionRows = Object.entries(SYSTEM.FACTIONS).map(([id, fDef]) => {
const val = this.document.system.factions[id]?.value ?? 0
return {
@@ -177,6 +208,7 @@ export default class CelestopolCharacterSheet extends CelestopolActorSheet {
static async #onCreateArmure() {
await this.document.createEmbeddedDocuments("Item", [{
name: game.i18n.localize("TYPES.Item.armure"), type: "armure",
system: { protection: 1, malus: 1 },
}])
}
@@ -199,6 +231,10 @@ export default class CelestopolCharacterSheet extends CelestopolActorSheet {
await anomaly.update({ "system.usesRemaining": anomaly.system.level })
}
static async #onManageFactionAspects() {
await game.celestopol?.manageFactionAspects(this.document)
}
/** Ouvre un dialogue pour dépenser de l'XP. */
static async #onDepenseXp() {
const actor = this.document