/**
 * Data model pour les personnages
 */
export default class PersonnageDataModel extends foundry.abstract.TypeDataModel {
  static defineSchema() {
    const fields = foundry.data.fields;
    return {
      biodata: new fields.SchemaField({
        nom: new fields.StringField({ initial: "" }),
        archetype: new fields.StringField({ initial: "" }),
        profession: new fields.StringField({ initial: "" }),
        royaume: new fields.StringField({ initial: "" }),
        age: new fields.NumberField({ initial: 0, integer: true }),
        taille: new fields.NumberField({ initial: 0, integer: true }),
        poids: new fields.NumberField({ initial: 0, integer: true }),
        don: new fields.StringField({ initial: "" }),
        faiblesse: new fields.StringField({ initial: "" }),
        pointlegende: new fields.NumberField({ initial: 0, integer: true }),
        renomee: new fields.NumberField({ initial: 0, integer: true }),
        description: new fields.HTMLField({ initial: "" }),
        notes: new fields.HTMLField({ initial: "" }),
        tiragerunes: new fields.StringField({ initial: "" }),
        gmnotes: new fields.HTMLField({ initial: "" })
      }),
      carac: new fields.SchemaField({
        corps: new fields.SchemaField({
          label: new fields.StringField({ initial: "Corps" }),
          carac: new fields.SchemaField({
            puissance: new fields.SchemaField({
              value: new fields.NumberField({ initial: 0, integer: true }),
              label: new fields.StringField({ initial: "Puissance" }),
              categorie: new fields.StringField({ initial: "corps" }),
              abbrev: new fields.StringField({ initial: "pui" })
            }),
            vigueur: new fields.SchemaField({
              value: new fields.NumberField({ initial: 0, integer: true }),
              label: new fields.StringField({ initial: "Vigueur" }),
              categorie: new fields.StringField({ initial: "corps" }),
              abbrev: new fields.StringField({ initial: "vig" })
            }),
            agilite: new fields.SchemaField({
              value: new fields.NumberField({ initial: 0, integer: true }),
              label: new fields.StringField({ initial: "Agilité" }),
              categorie: new fields.StringField({ initial: "corps" }),
              abbrev: new fields.StringField({ initial: "agi" })
            })
          })
        }),
        esprit: new fields.SchemaField({
          label: new fields.StringField({ initial: "Esprit" }),
          carac: new fields.SchemaField({
            intellect: new fields.SchemaField({
              value: new fields.NumberField({ initial: 0, integer: true }),
              label: new fields.StringField({ initial: "Intellect" }),
              categorie: new fields.StringField({ initial: "esprit" }),
              abbrev: new fields.StringField({ initial: "int" })
            }),
            perception: new fields.SchemaField({
              value: new fields.NumberField({ initial: 0, integer: true }),
              label: new fields.StringField({ initial: "Perception" }),
              categorie: new fields.StringField({ initial: "esprit" }),
              abbrev: new fields.StringField({ initial: "per" })
            }),
            tenacite: new fields.SchemaField({
              value: new fields.NumberField({ initial: 0, integer: true }),
              label: new fields.StringField({ initial: "Tenacité" }),
              categorie: new fields.StringField({ initial: "esprit" }),
              abbrev: new fields.StringField({ initial: "ten" })
            })
          })
        }),
        ame: new fields.SchemaField({
          label: new fields.StringField({ initial: "Ame" }),
          carac: new fields.SchemaField({
            charisme: new fields.SchemaField({
              value: new fields.NumberField({ initial: 0, integer: true }),
              label: new fields.StringField({ initial: "Charisme" }),
              categorie: new fields.StringField({ initial: "ame" }),
              abbrev: new fields.StringField({ initial: "cha" })
            }),
            communication: new fields.SchemaField({
              value: new fields.NumberField({ initial: 0, integer: true }),
              label: new fields.StringField({ initial: "Communication" }),
              categorie: new fields.StringField({ initial: "ame" }),
              abbrev: new fields.StringField({ initial: "com" })
            }),
            instinct: new fields.SchemaField({
              value: new fields.NumberField({ initial: 0, integer: true }),
              label: new fields.StringField({ initial: "Instinct" }),
              categorie: new fields.StringField({ initial: "ame" }),
              abbrev: new fields.StringField({ initial: "ins" })
            })
          })
        })
      }),
      furor: new fields.SchemaField({
        value: new fields.NumberField({ initial: 1, integer: true }),
        max: new fields.NumberField({ initial: 1, integer: true }),
        label: new fields.StringField({ initial: "Furor" })
      }),
      xp: new fields.SchemaField({
        total: new fields.NumberField({ initial: 1, integer: true }),
        current: new fields.NumberField({ initial: 1, integer: true }),
        label: new fields.StringField({ initial: "XP" })
      }),
      renommee: new fields.SchemaField({
        value: new fields.NumberField({ initial: 1, integer: true }),
        label: new fields.StringField({ initial: "Renommée" })
      }),
      status: new fields.SchemaField({
        epuise: new fields.BooleanField({ initial: false }),
        blesse: new fields.BooleanField({ initial: false }),
        meurtri: new fields.BooleanField({ initial: false })
      }),
      caracsecondaire: new fields.SchemaField({
        reaction: new fields.SchemaField({
          value: new fields.NumberField({ initial: 0, integer: true }),
          max: new fields.NumberField({ initial: 0, integer: true }),
          label: new fields.StringField({ initial: "Réaction" }),
          abbrev: new fields.StringField({ initial: "rea" })
        }),
        defensephy: new fields.SchemaField({
          value: new fields.NumberField({ initial: 0, integer: true }),
          bonusmalus: new fields.NumberField({ initial: 0, integer: true }),
          max: new fields.NumberField({ initial: 0, integer: true }),
          label: new fields.StringField({ initial: "Défense Physique" }),
          abbrev: new fields.StringField({ initial: "dp" })
        }),
        defensemen: new fields.SchemaField({
          value: new fields.NumberField({ initial: 0, integer: true }),
          bonusmalus: new fields.NumberField({ initial: 0, integer: true }),
          max: new fields.NumberField({ initial: 0, integer: true }),
          label: new fields.StringField({ initial: "Défense Mentale" }),
          abbrev: new fields.StringField({ initial: "dm" })
        }),
        deplacement: new fields.SchemaField({
          value: new fields.NumberField({ initial: 0, integer: true }),
          max: new fields.NumberField({ initial: 0, integer: true }),
          label: new fields.StringField({ initial: "Déplacement" }),
          abbrev: new fields.StringField({ initial: "dep" })
        }),
        capaenc: new fields.SchemaField({
          value: new fields.NumberField({ initial: 0, integer: true }),
          max: new fields.NumberField({ initial: 0, integer: true }),
          label: new fields.StringField({ initial: "Capacité d'Encombrement" }),
          abbrev: new fields.StringField({ initial: "cpe" })
        }),
        pv: new fields.SchemaField({
          value: new fields.NumberField({ initial: 10, integer: true }),
          max: new fields.NumberField({ initial: 10, integer: true }),
          min: new fields.NumberField({ initial: 0, integer: true }),
          label: new fields.StringField({ initial: "Points de Vie" }),
          abbrev: new fields.StringField({ initial: "pv" })
        })
      })
    };
  }
}
