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(""),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user