/**
 * Data model pour les créatures
 */
export default class CreatureDataModel extends foundry.abstract.TypeDataModel {
  static defineSchema() {
    const fields = foundry.data.fields;
    return {
      // Template biodata
      biodata: new fields.SchemaField({
        name: new fields.StringField({ initial: "" }),
        age: new fields.NumberField({ initial: 0, integer: true }),
        poids: new fields.StringField({ initial: "" }),
        taille: new fields.StringField({ initial: "" }),
        cheveux: new fields.StringField({ initial: "" }),
        sexe: new fields.StringField({ initial: "" }),
        yeux: new fields.StringField({ initial: "" }),
        description: new fields.HTMLField({ initial: "" }),
        habitat: new fields.HTMLField({ initial: "" }),
        notes: new fields.HTMLField({ initial: "" }),
        statut: new fields.StringField({ initial: "" }),
        gmnotes: new fields.HTMLField({ initial: "" }),
        statutresistant: new fields.StringField({ initial: "commun" })
      }),
      // Template core
      subactors: new fields.ArrayField(new fields.StringField(), { initial: [] }),
      attributs: new fields.SchemaField({
        adr: new fields.SchemaField({
          label: new fields.StringField({ initial: "Adresse" }),
          labelnorm: new fields.StringField({ initial: "adresse" }),
          abbrev: new fields.StringField({ initial: "adr" }),
          value: new fields.NumberField({ initial: 1, integer: true })
        }),
        pui: new fields.SchemaField({
          label: new fields.StringField({ initial: "Puissance" }),
          labelnorm: new fields.StringField({ initial: "puissance" }),
          abbrev: new fields.StringField({ initial: "pui" }),
          value: new fields.NumberField({ initial: 1, integer: true })
        }),
        cla: new fields.SchemaField({
          label: new fields.StringField({ initial: "Clairvoyance" }),
          labelnorm: new fields.StringField({ initial: "clairvoyance" }),
          abbrev: new fields.StringField({ initial: "cla" }),
          value: new fields.NumberField({ initial: 1, integer: true })
        }),
        pre: new fields.SchemaField({
          label: new fields.StringField({ initial: "Présence" }),
          labelnorm: new fields.StringField({ initial: "presence" }),
          abbrev: new fields.StringField({ initial: "pre" }),
          value: new fields.NumberField({ initial: 0, integer: true })
        }),
        tre: new fields.SchemaField({
          label: new fields.StringField({ initial: "Trempe" }),
          labelnorm: new fields.StringField({ initial: "trempe" }),
          abbrev: new fields.StringField({ initial: "tre" }),
          value: new fields.NumberField({ initial: 0, integer: true })
        })
      }),
      bonneaventure: new fields.SchemaField({
        base: new fields.NumberField({ initial: 0, integer: true }),
        actuelle: new fields.NumberField({ initial: 0, integer: true })
      }),
      experience: new fields.SchemaField({
        value: new fields.NumberField({ initial: 0, integer: true })
      }),
      eclat: new fields.SchemaField({
        value: new fields.NumberField({ initial: 0, integer: true })
      }),
      sante: new fields.SchemaField({
        vigueur: new fields.NumberField({ initial: 0, integer: true }),
        etat: new fields.NumberField({ initial: 0, integer: true }),
        vigueurmodifier: new fields.NumberField({ initial: 0, integer: true }),
        nbcombativite: new fields.NumberField({ initial: 5, integer: true })
      }),
      adversite: new fields.SchemaField({
        bleue: new fields.NumberField({ initial: 0, integer: true }),
        rouge: new fields.NumberField({ initial: 0, integer: true }),
        noire: new fields.NumberField({ initial: 0, integer: true })
      }),
      vitesse: new fields.SchemaField({
        value: new fields.NumberField({ initial: 0, integer: true })
      }),
      combat: new fields.SchemaField({
        initbonus: new fields.NumberField({ initial: 0, integer: true }),
        vitessebonus: new fields.NumberField({ initial: 0, integer: true }),
        bonusdegats: new fields.NumberField({ initial: 0, integer: true }),
        attaquebonus: new fields.NumberField({ initial: 0, integer: true }),
        defensebonus: new fields.NumberField({ initial: 0, integer: true }),
        defensetotale: new fields.BooleanField({ initial: false }),
        monte: new fields.BooleanField({ initial: false })
      }),
      // Propriétés spécifiques aux créatures
      ressources: new fields.SchemaField({
        value: new fields.NumberField({ initial: 0, integer: true })
      })
    };
  }
}
