import { SYSTEM } from "../config/system.mjs"
export default class HellbornRitual extends foundry.abstract.TypeDataModel {
  static defineSchema() {
    const fields = foundry.data.fields
    const requiredInteger = { required: true, nullable: false, integer: true }
    const schema = {}

    schema.ingredients = new fields.StringField({
      required: true,
      initial: "",
      textSearch: true,
    })
    schema.difficulty = new fields.NumberField({
      required: true,
      initial: 1,
      min: 1,
      ...requiredInteger,
    })
    schema.nbAttempts = new fields.NumberField({
      required: true,
      initial: 0,
      min: 0,
      ...requiredInteger,
    })
    schema.threshold = new fields.NumberField({
      required: true,
      initial: 0,
      min: 0,
      ...requiredInteger,
    })
    schema.limit = new fields.NumberField({
      required: false,
      initial: 0,
      min: 0,
      ...requiredInteger,
    })
    schema.description = new fields.HTMLField({
      required: false,
      blank: true,
      initial: "",
      textSearch: true,
    })
    schema.cost = new fields.NumberField({ required: true, initial: 0, min: 0 })

    return schema
  }

  /** @override */
  static LOCALIZATION_PREFIXES = ["HELLBORN.Ritual"]
}
