25 lines
1015 B
JavaScript
25 lines
1015 B
JavaScript
import { SYSTEM } from "../config/system.mjs"
|
|
import { CATEGORY } from "../config/skill.mjs"
|
|
export default class LethalFantasySkill extends foundry.abstract.TypeDataModel {
|
|
static defineSchema() {
|
|
const fields = foundry.data.fields
|
|
const schema = {}
|
|
const requiredInteger = { required: true, nullable: false, integer: true }
|
|
|
|
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
|
schema.category = new fields.StringField({ required: true, initial: "layperson", choices: SYSTEM.SKILL_CATEGORY })
|
|
schema.base = new fields.StringField({ required: true, initial: "WIS" })
|
|
schema.bonus = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
|
|
schema.cost = new fields.NumberField({ ...requiredInteger,required: true, initial: 0, min: 0 })
|
|
|
|
return schema
|
|
}
|
|
|
|
/** @override */
|
|
static LOCALIZATION_PREFIXES = ["LETHALFANTASY.Skill"]
|
|
|
|
get skillCategory() {
|
|
return game.i18n.localize(CATEGORY[this.category].label)
|
|
}
|
|
}
|