Import initial du système

This commit is contained in:
2026-03-28 08:44:19 +01:00
parent 068fca00e5
commit f7a01900ac
105 changed files with 7362 additions and 2090 deletions

View File

@@ -86,7 +86,7 @@ export default class CharacterDataModel extends foundry.abstract.TypeDataModel {
const schema = {
concept: stringField(""),
guardian: stringField("0"),
guardian: numberField(0, { min: 0, max: 5 }),
initiative: numberField(1, { min: 0 }),
anti_initiative: numberField(24, { min: 0 }),
description: htmlField(""),
@@ -158,8 +158,8 @@ export default class CharacterDataModel extends foundry.abstract.TypeDataModel {
geomancy: magicField(),
}),
threetreasures: new fields.SchemaField({
heiyang: new fields.SchemaField({ value: numberField(0, { min: 0 }) }),
heiyin: new fields.SchemaField({ value: numberField(0, { min: 0 }) }),
heiyang: new fields.SchemaField({ value: numberField(0, { min: 0 }), max: numberField(0, { min: 0 }) }),
heiyin: new fields.SchemaField({ value: numberField(0, { min: 0 }), max: numberField(0, { min: 0 }) }),
dicelevel: new fields.SchemaField({
level0d: treasureLevel(),
level1d: treasureLevel(),

View File

@@ -21,8 +21,8 @@ export default class NpcDataModel extends foundry.abstract.TypeDataModel {
return {
type: stringField(""),
levelofthreat: numberField(0, { min: 0 }),
powerofnuisance: numberField(0, { min: 0 }),
threat: numberField(0, { min: 0, max: 4 }), // profane(0) | apprentice(1) | initiate(2) | accomplished(3) | renowned(4)
nuisance: numberField(0, { min: 0, max: 5 }), // figurant(0) | minion(1) | adversary(2) | ally(3) | boss(4) | divinity(5)
initiative: numberField(1, { min: 0 }),
anti_initiative: numberField(24, { min: 0 }),
aptitudes: new fields.SchemaField({

19
src/data/items/armor.js Normal file
View File

@@ -0,0 +1,19 @@
export default class ArmorDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const { fields } = foundry.data
const stringField = (initial = "") => new fields.StringField({ required: true, nullable: false, initial })
const htmlField = (initial = "") => new fields.HTMLField({ required: true, nullable: false, initial, textSearch: true })
const intField = (initial = 0, opts = {}) => new fields.NumberField({ required: true, nullable: false, integer: true, initial, ...opts })
return {
reference: stringField(""),
description: htmlField(""),
protectionValue: intField(0),
domain: stringField(""),
obtainLevel: intField(0, { min: 0, max: 5 }),
obtainDifficulty: intField(0, { min: 0, max: 3 }),
quantity: intField(1),
notes: htmlField(""),
}
}
}

View File

@@ -2,3 +2,7 @@ export { default as EquipmentDataModel } from "./item.js"
export { default as KungfuDataModel } from "./kungfu.js"
export { default as SpellDataModel } from "./spell.js"
export { default as SupernaturalDataModel } from "./supernatural.js"
export { default as WeaponDataModel } from "./weapon.js"
export { default as ArmorDataModel } from "./armor.js"
export { default as SanheiDataModel } from "./sanhei.js"
export { default as IngredientDataModel } from "./ingredient.js"

View File

@@ -0,0 +1,18 @@
export default class IngredientDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const { fields } = foundry.data
const stringField = (initial = "") => new fields.StringField({ required: true, nullable: false, initial })
const htmlField = (initial = "") => new fields.HTMLField({ required: true, nullable: false, initial, textSearch: true })
const intField = (initial = 0, opts = {}) => new fields.NumberField({ required: true, nullable: false, integer: true, initial, ...opts })
return {
reference: stringField(""),
description: htmlField(""),
school: stringField("all"),
obtainLevel: intField(0, { min: 0, max: 5 }),
obtainDifficulty: intField(0, { min: 0, max: 3 }),
quantity: intField(1),
notes: htmlField(""),
}
}
}

View File

@@ -6,14 +6,10 @@ export default class EquipmentDataModel extends foundry.abstract.TypeDataModel {
const htmlField = (initial = "") => new fields.HTMLField({ required: true, nullable: false, initial, textSearch: true })
return {
subtype: stringField(""),
reference: stringField(""),
description: htmlField(""),
quantity: numberField(1, { min: 0 }),
weight: numberField(0, { min: 0 }),
protection: stringField(""),
damage: stringField(""),
range: stringField(""),
notes: htmlField(""),
}
}

View File

@@ -9,16 +9,16 @@ export default class KungfuDataModel extends foundry.abstract.TypeDataModel {
new fields.SchemaField({
check: boolField(false),
name: stringField(""),
activation: stringField(""),
activation: stringField("action-attack"), // action-attack | action-defense | action-aid | action-attack-defense | reaction | dice | damage-inflicted | damage-received
technique: htmlField(""),
})
return {
reference: stringField(""),
description: htmlField(""),
orientation: stringField(""),
aspect: stringField(""),
skill: stringField(""),
orientation: stringField("yin"), // yin | yang | yinyang
aspect: stringField("metal"), // metal | eau | terre | feu | bois
skill: stringField("kungfu"), // kungfu | rangedcombat
speciality: stringField(""),
style: stringField(""),
techniques: new fields.SchemaField({

27
src/data/items/sanhei.js Normal file
View File

@@ -0,0 +1,27 @@
export default class SanheiDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const { fields } = foundry.data
const stringField = (initial = "") => new fields.StringField({ required: true, nullable: false, initial })
const htmlField = (initial = "") => new fields.HTMLField({ required: true, nullable: false, initial, textSearch: true })
const intField = (initial = 0, opts = {}) => new fields.NumberField({ required: true, nullable: false, integer: true, initial, ...opts })
const propertySchema = () => new fields.SchemaField({
name: stringField(""),
heiCost: intField(0),
heiType: stringField("yin"),
description: htmlField(""),
})
return {
reference: stringField(""),
description: htmlField(""),
heiType: stringField("yin"),
properties: new fields.SchemaField({
prop1: propertySchema(),
prop2: propertySchema(),
prop3: propertySchema(),
}),
notes: htmlField(""),
}
}
}

View File

@@ -8,7 +8,7 @@ export default class SpellDataModel extends foundry.abstract.TypeDataModel {
reference: stringField(""),
description: htmlField(""),
specialityname: stringField(""),
associatedelement: stringField(""),
associatedelement: stringField("metal"), // metal | eau | terre | feu | bois
hei: stringField(""),
realizationtimeritual: stringField(""),
realizationtimeaccelerated: stringField(""),
@@ -17,6 +17,10 @@ export default class SpellDataModel extends foundry.abstract.TypeDataModel {
effects: htmlField(""),
examples: htmlField(""),
notes: htmlField(""),
discipline: stringField("cinabre"),
heiType: stringField("yin"),
heiCost: new fields.NumberField({ required: true, nullable: false, integer: true, min: 0, initial: 1 }),
difficulty: new fields.NumberField({ required: true, nullable: false, integer: true, min: 0, initial: 1 }),
}
}
}

View File

@@ -8,6 +8,10 @@ export default class SupernaturalDataModel extends foundry.abstract.TypeDataMode
reference: stringField(""),
description: htmlField(""),
notes: htmlField(""),
heiType: stringField("yin"),
heiCost: new fields.NumberField({ required: true, nullable: false, integer: true, min: 0, initial: 0 }),
trigger: stringField(""),
effects: htmlField(""),
}
}
}

22
src/data/items/weapon.js Normal file
View File

@@ -0,0 +1,22 @@
export default class WeaponDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const { fields } = foundry.data
const stringField = (initial = "") => new fields.StringField({ required: true, nullable: false, initial })
const htmlField = (initial = "") => new fields.HTMLField({ required: true, nullable: false, initial, textSearch: true })
const intField = (initial = 0, opts = {}) => new fields.NumberField({ required: true, nullable: false, integer: true, initial, ...opts })
return {
reference: stringField(""),
description: htmlField(""),
weaponType: stringField("melee"),
material: stringField(""),
damageAspect: stringField("metal"),
damageBase: intField(1),
range: stringField("contact"), // contact | courte | mediane | longue | extreme
obtainLevel: intField(0, { min: 0, max: 5 }),
obtainDifficulty: intField(0, { min: 0, max: 3 }),
quantity: intField(1),
notes: htmlField(""),
}
}
}