export default class AwECreature extends foundry.abstract.TypeDataModel {
  static defineSchema() {
    const fields = foundry.data.fields
    const requiredInteger = { required: true, nullable: false, integer: true }
    const schema = {}

    schema.description = new fields.HTMLField({ required: true, textSearch: true })

    schema.level = new fields.NumberField({ ...requiredInteger, initial: 1, min: 1 })
    schema.stride = new fields.NumberField({ ...requiredInteger, initial: 5, min: 0 })

    schema.hp = new fields.SchemaField({
      value: new fields.NumberField({ ...requiredInteger, initial: 10, min: 0 }),
      max: new fields.NumberField({ ...requiredInteger, initial: 10, min: 0 })
    })

    // Raw attribute values (mod = value directly, no boosts)
    schema.attributes = new fields.SchemaField({
      agility: new fields.SchemaField({
        mod: new fields.NumberField({ ...requiredInteger, initial: 2 }),
        dc: new fields.NumberField({ ...requiredInteger, initial: 12 })
      }),
      fitness: new fields.SchemaField({
        mod: new fields.NumberField({ ...requiredInteger, initial: 2 }),
        dc: new fields.NumberField({ ...requiredInteger, initial: 12 })
      }),
      awareness: new fields.SchemaField({
        mod: new fields.NumberField({ ...requiredInteger, initial: 2 }),
        dc: new fields.NumberField({ ...requiredInteger, initial: 12 })
      }),
      influence: new fields.SchemaField({
        mod: new fields.NumberField({ ...requiredInteger, initial: 2 }),
        dc: new fields.NumberField({ ...requiredInteger, initial: 12 })
      })
    })

    // Eureka Rubric
    schema.eurekaClaims = new fields.StringField({ initial: "", required: false, nullable: true })
    schema.eurekaEvidence = new fields.StringField({ initial: "", required: false, nullable: true })
    schema.eurekaThreshold1 = new fields.StringField({ initial: "", required: false, nullable: true })
    schema.eurekaThreshold2 = new fields.StringField({ initial: "", required: false, nullable: true })
    schema.eurekaHints = new fields.StringField({ initial: "", required: false, nullable: true })

    return schema
  }
}
