IMplémentation de la ajorité des remarques de Nepherius

This commit is contained in:
2026-04-06 17:48:30 +02:00
parent a3f7b11f82
commit 1022597bf8
51 changed files with 1900 additions and 443 deletions

View File

@@ -17,6 +17,7 @@ import {
CelestopolActor,
CelestopolItem,
CelestopolChatMessage,
CelestopolCombat,
CelestopolRoll,
} from "./module/documents/_module.mjs"
import {
@@ -47,8 +48,11 @@ Hooks.once("init", () => {
}
}
// Expose SYSTEM constants in game.system namespace
game.celestopol = { SYSTEM }
// Expose SYSTEM constants + utilities globales
game.celestopol = {
SYSTEM,
rollMoonStandalone: (actor = null) => CelestopolRoll.rollMoonStandalone(actor),
}
// ── DataModels ──────────────────────────────────────────────────────────
CONFIG.Actor.dataModels.character = CelestopolCharacter
@@ -64,8 +68,13 @@ Hooks.once("init", () => {
CONFIG.Actor.documentClass = CelestopolActor
CONFIG.Item.documentClass = CelestopolItem
CONFIG.ChatMessage.documentClass = CelestopolChatMessage
CONFIG.Combat.documentClass = CelestopolCombat
CONFIG.Dice.rolls.push(CelestopolRoll)
// ── Initiative déterministe (pas de dé) ─────────────────────────────────
// Formule de secours si Combat.rollInitiative est appelé sans passer par notre override
CONFIG.Combat.initiative = { formula: "@initiative", decimals: 0 }
// ── Token display defaults ───────────────────────────────────────────────
CONFIG.Actor.trackableAttributes = {
character: {
@@ -131,8 +140,6 @@ Hooks.once("init", () => {
/* ─── Ready hook ─────────────────────────────────────────────────────────── */
/* ─── Ready hook ─────────────────────────────────────────────────────────── */
Hooks.once("ready", () => {
console.log(`${SYSTEM_ID} | System ready`)
@@ -279,6 +286,14 @@ function _registerHandlebarsHelpers() {
// Helper : add two numbers
Handlebars.registerHelper("add", (a, b) => a + b)
// Helper : vrai si le dot lvl correspond au seuil de résistance de la spécialisation
Handlebars.registerHelper("isResThreshold", (skillId, lvl) => {
for (const group of Object.values(SYSTEM.SKILLS)) {
if (group[skillId]) return group[skillId].resThreshold === lvl
}
return false
})
Handlebars.registerHelper("let", function(value, options) {
return options.fn({ value })
})
@@ -318,6 +333,8 @@ function _preloadTemplates() {
`${base}/npc-main.hbs`,
`${base}/npc-competences.hbs`,
`${base}/npc-blessures.hbs`,
`${base}/npc-equipement.hbs`,
`${base}/npc-biographie.hbs`,
`${base}/anomaly.hbs`,
`${base}/aspect.hbs`,
`${base}/equipment.hbs`,
@@ -325,6 +342,7 @@ function _preloadTemplates() {
`${base}/armure.hbs`,
`${base}/roll-dialog.hbs`,
`${base}/chat-message.hbs`,
`${base}/moon-standalone.hbs`,
`${base}/partials/item-scores.hbs`,
])
}