Import initial du système
This commit is contained in:
@@ -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