Import initial du système
This commit is contained in:
19
src/data/items/armor.js
Normal file
19
src/data/items/armor.js
Normal 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(""),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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"
|
||||
|
||||
18
src/data/items/ingredient.js
Normal file
18
src/data/items/ingredient.js
Normal 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(""),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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(""),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
27
src/data/items/sanhei.js
Normal 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(""),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 }),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
22
src/data/items/weapon.js
Normal 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(""),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user