Nouveaux items Arme et Armure (DataModel + feuille + CSS)

Items:
- CelestopolWeapon : degats (0/1/2/X), portee (contact/courte/longue), description
- CelestopolArmure : protection (1-2), malus (0-2), description

Config:
- WEAPON_DAMAGE_TYPES et WEAPON_RANGE_TYPES ajoutés dans system.mjs
- Enregistrement des DataModels, sheets et templates dans fvtt-celestopol.mjs
- system.json : types weapon et armure avec htmlFields

UI:
- weapon.hbs : badge de dégâts avec hint, sélecteurs portée/dégâts
- armure.hbs : blocs protection + malus art-déco
- items.less : styles .weapon et .armure

i18n: clés Weapon.*, Armure.*, Sheet.weapon, Sheet.armure

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-03-29 17:03:23 +02:00
parent be323e6f68
commit 5a8b151451
11 changed files with 321 additions and 14 deletions

View File

@@ -10,6 +10,8 @@ import {
CelestopolAnomaly,
CelestopolAspect,
CelestopolEquipment,
CelestopolWeapon,
CelestopolArmure,
} from "./module/models/_module.mjs"
import {
CelestopolActor,
@@ -23,6 +25,8 @@ import {
CelestopolAnomalySheet,
CelestopolAspectSheet,
CelestopolEquipmentSheet,
CelestopolWeaponSheet,
CelestopolArmureSheet,
} from "./module/applications/_module.mjs"
/* ─── Init hook ──────────────────────────────────────────────────────────── */
@@ -41,6 +45,8 @@ Hooks.once("init", () => {
CONFIG.Item.dataModels.anomaly = CelestopolAnomaly
CONFIG.Item.dataModels.aspect = CelestopolAspect
CONFIG.Item.dataModels.equipment = CelestopolEquipment
CONFIG.Item.dataModels.weapon = CelestopolWeapon
CONFIG.Item.dataModels.armure = CelestopolArmure
// ── Document classes ────────────────────────────────────────────────────
CONFIG.Actor.documentClass = CelestopolActor
@@ -90,6 +96,16 @@ Hooks.once("init", () => {
makeDefault: true,
label: "CELESTOPOL.Sheet.equipment",
})
foundry.documents.collections.Items.registerSheet(SYSTEM_ID, CelestopolWeaponSheet, {
types: ["weapon"],
makeDefault: true,
label: "CELESTOPOL.Sheet.weapon",
})
foundry.documents.collections.Items.registerSheet(SYSTEM_ID, CelestopolArmureSheet, {
types: ["armure"],
makeDefault: true,
label: "CELESTOPOL.Sheet.armure",
})
// ── Handlebars helpers ───────────────────────────────────────────────────
_registerHandlebarsHelpers()
@@ -197,6 +213,8 @@ function _preloadTemplates() {
`${base}/anomaly.hbs`,
`${base}/aspect.hbs`,
`${base}/equipment.hbs`,
`${base}/weapon.hbs`,
`${base}/armure.hbs`,
`${base}/roll-dialog.hbs`,
`${base}/chat-message.hbs`,
`${base}/partials/item-scores.hbs`,