Rework des fiches creature/PJ et Tinji/Loksyu

This commit is contained in:
2026-03-30 16:36:38 +02:00
parent 0689fae792
commit cab77645b7
70 changed files with 1712 additions and 1075 deletions

View File

@@ -1,4 +1,2 @@
export { default as CharacterDataModel } from "./character.js"
export { default as NpcDataModel } from "./npc.js"
export { default as TinjiDataModel } from "./tinji.js"
export { default as LoksyuDataModel } from "./loksyu.js"

View File

@@ -1,22 +0,0 @@
export default class LoksyuDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const { fields } = foundry.data
const numberField = (initial = 0, extra = {}) => new fields.NumberField({ required: true, nullable: false, integer: true, initial, ...extra })
const htmlField = (initial = "") => new fields.HTMLField({ required: true, nullable: false, initial, textSearch: true })
const polarity = () =>
new fields.SchemaField({
yin: new fields.SchemaField({ value: numberField(0, { min: 0 }) }),
yang: new fields.SchemaField({ value: numberField(0, { min: 0 }) }),
})
return {
fire: polarity(),
earth: polarity(),
metal: polarity(),
water: polarity(),
wood: polarity(),
description: htmlField(""),
}
}
}

View File

@@ -1,12 +0,0 @@
export default class TinjiDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const { fields } = foundry.data
const numberField = (initial = 0, extra = {}) => new fields.NumberField({ required: true, nullable: false, integer: true, initial, ...extra })
const htmlField = (initial = "") => new fields.HTMLField({ required: true, nullable: false, initial, textSearch: true })
return {
value: numberField(0, { min: 0 }),
description: htmlField(""),
}
}
}