/**
 * Data model pour les personnages
 */
export default class PersonnageDataModel extends foundry.abstract.TypeDataModel {
  static defineSchema() {
    const fields = foundry.data.fields;
    return {
      // Template biodata
      biodata: new fields.SchemaField({
        name: new fields.StringField({ initial: "" }),
        activite: new fields.StringField({ initial: "" }),
        nomhumain: new fields.StringField({ initial: "" }),
        activites: new fields.StringField({ initial: "" }),
        fortune: new fields.StringField({ initial: "0" }),
        traitscaracteres: new fields.StringField({ initial: "" }),
        tailledemasquee: new fields.StringField({ initial: "" }),
        taillemasquee: new fields.StringField({ initial: "" }),
        poidsmasquee: new fields.StringField({ initial: "" }),
        poidsdemasquee: new fields.StringField({ initial: "" }),
        apparencemasquee: new fields.StringField({ initial: "" }),
        apparencedemasquee: new fields.StringField({ initial: "" }),
        titrefamille: new fields.StringField({ initial: "" }),
        langues: new fields.StringField({ initial: "" }),
        factionfeerique: new fields.StringField({ initial: "" }),
        typetaille: new fields.StringField({ initial: "" }),
        age: new fields.StringField({ initial: "0" }),
        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: "" }),
        revesetranges: new fields.HTMLField({ initial: "" }),
        secretsdecouverts: new fields.HTMLField({ initial: "" }),
        questions: new fields.HTMLField({ initial: "" }),
        habitat: new fields.HTMLField({ initial: "" }),
        notes: new fields.HTMLField({ initial: "" }),
        statut: new fields.StringField({ initial: "" }),
        playernotes: new fields.HTMLField({ initial: "" }),
        gmnotes: new fields.HTMLField({ initial: "" }),
        magie: new fields.BooleanField({ initial: false })
      }),
      // Template core
      subactors: new fields.ArrayField(new fields.StringField(), { initial: [] }),
      caracteristiques: new fields.SchemaField({
        agi: new fields.SchemaField({
          label: new fields.StringField({ initial: "Agilité" }),
          labelnorm: new fields.StringField({ initial: "agilite" }),
          abbrev: new fields.StringField({ initial: "agi" }),
          kind: new fields.StringField({ initial: "physical" }),
          value: new fields.NumberField({ initial: 1, integer: true }),
          rang: new fields.NumberField({ initial: 0, integer: true }),
          max: new fields.NumberField({ initial: 1, integer: true })
        }),
        con: new fields.SchemaField({
          label: new fields.StringField({ initial: "Constitution" }),
          labelnorm: new fields.StringField({ initial: "constitution" }),
          abbrev: new fields.StringField({ initial: "con" }),
          kind: new fields.StringField({ initial: "physical" }),
          value: new fields.NumberField({ initial: 1, integer: true }),
          rang: new fields.NumberField({ initial: 0, integer: true }),
          max: new fields.NumberField({ initial: 1, integer: true })
        }),
        for: new fields.SchemaField({
          label: new fields.StringField({ initial: "Force" }),
          labelnorm: new fields.StringField({ initial: "force" }),
          abbrev: new fields.StringField({ initial: "for" }),
          kind: new fields.StringField({ initial: "physical" }),
          value: new fields.NumberField({ initial: 1, integer: true }),
          rang: new fields.NumberField({ initial: 0, integer: true }),
          max: new fields.NumberField({ initial: 1, integer: true })
        }),
        prec: new fields.SchemaField({
          label: new fields.StringField({ initial: "Précision" }),
          labelnorm: new fields.StringField({ initial: "precision" }),
          abbrev: new fields.StringField({ initial: "prec" }),
          kind: new fields.StringField({ initial: "physical" }),
          value: new fields.NumberField({ initial: 1, integer: true }),
          rang: new fields.NumberField({ initial: 0, integer: true }),
          max: new fields.NumberField({ initial: 1, integer: true })
        }),
        esp: new fields.SchemaField({
          label: new fields.StringField({ initial: "Esprit" }),
          labelnorm: new fields.StringField({ initial: "esprit" }),
          abbrev: new fields.StringField({ initial: "esp" }),
          kind: new fields.StringField({ initial: "mental" }),
          value: new fields.NumberField({ initial: 1, integer: true }),
          rang: new fields.NumberField({ initial: 0, integer: true }),
          max: new fields.NumberField({ initial: 1, integer: true })
        }),
        per: new fields.SchemaField({
          label: new fields.StringField({ initial: "Perception" }),
          labelnorm: new fields.StringField({ initial: "perception" }),
          abbrev: new fields.StringField({ initial: "per" }),
          kind: new fields.StringField({ initial: "mental" }),
          value: new fields.NumberField({ initial: 1, integer: true }),
          rang: new fields.NumberField({ initial: 0, integer: true }),
          max: new fields.NumberField({ initial: 1, integer: true })
        }),
        pres: new fields.SchemaField({
          label: new fields.StringField({ initial: "Prestance" }),
          labelnorm: new fields.StringField({ initial: "pres" }),
          abbrev: new fields.StringField({ initial: "pres" }),
          kind: new fields.StringField({ initial: "mental" }),
          value: new fields.NumberField({ initial: 1, integer: true }),
          rang: new fields.NumberField({ initial: 0, integer: true }),
          max: new fields.NumberField({ initial: 1, integer: true })
        }),
        san: new fields.SchemaField({
          label: new fields.StringField({ initial: "Sang-Froid" }),
          labelnorm: new fields.StringField({ initial: "sangfroid" }),
          abbrev: new fields.StringField({ initial: "san" }),
          kind: new fields.StringField({ initial: "mental" }),
          value: new fields.NumberField({ initial: 1, integer: true }),
          rang: new fields.NumberField({ initial: 0, integer: true }),
          max: new fields.NumberField({ initial: 1, integer: true })
        })
      }),
      statutmasque: new fields.StringField({ initial: "masque" }),
      rang: new fields.SchemaField({
        tricherie: new fields.SchemaField({
          label: new fields.StringField({ initial: "Tricherie" }),
          value: new fields.NumberField({ initial: 0, integer: true }),
          max: new fields.NumberField({ initial: 0, integer: true })
        }),
        feerie: new fields.SchemaField({
          label: new fields.StringField({ initial: "Féerie" }),
          value: new fields.NumberField({ initial: 0, integer: true }),
          max: new fields.NumberField({ initial: 0, integer: true })
        }),
        masque: new fields.SchemaField({
          label: new fields.StringField({ initial: "Masque" }),
          value: new fields.NumberField({ initial: 0, integer: true }),
          max: new fields.NumberField({ initial: 0, integer: true })
        }),
        heritage: new fields.SchemaField({
          label: new fields.StringField({ initial: "Héritage" }),
          value: new fields.StringField({ initial: "0" }),
          max: new fields.NumberField({ initial: 0, integer: true }),
          scenarios: new fields.NumberField({ initial: 0, integer: true })
        })
      }),
      pv: new fields.SchemaField({
        value: new fields.NumberField({ initial: 0, integer: true }),
        max: new fields.NumberField({ initial: 0, integer: true }),
        mod: new fields.NumberField({ initial: 0, integer: true })
      }),
      competences: new fields.SchemaField({
        aventurier: new fields.SchemaField({
          label: new fields.StringField({ initial: "Aventurier" }),
          niveau: new fields.NumberField({ initial: 0, integer: true }),
          rang: new fields.NumberField({ initial: 0, integer: true }),
          pp: new fields.NumberField({ initial: 0, integer: true })
        }),
        combattant: new fields.SchemaField({
          label: new fields.StringField({ initial: "Combattant" }),
          niveau: new fields.NumberField({ initial: 0, integer: true }),
          rang: new fields.NumberField({ initial: 0, integer: true }),
          pp: new fields.NumberField({ initial: 0, integer: true })
        }),
        erudit: new fields.SchemaField({
          label: new fields.StringField({ initial: "Erudit" }),
          niveau: new fields.NumberField({ initial: 0, integer: true }),
          rang: new fields.NumberField({ initial: 0, integer: true }),
          pp: new fields.NumberField({ initial: 0, integer: true })
        }),
        gentleman: new fields.SchemaField({
          label: new fields.StringField({ initial: "Gentleman" }),
          niveau: new fields.NumberField({ initial: 0, integer: true }),
          rang: new fields.NumberField({ initial: 0, integer: true }),
          pp: new fields.NumberField({ initial: 0, integer: true })
        }),
        roublard: new fields.SchemaField({
          label: new fields.StringField({ initial: "Roublard" }),
          niveau: new fields.NumberField({ initial: 0, integer: true }),
          rang: new fields.NumberField({ initial: 0, integer: true }),
          pp: new fields.NumberField({ initial: 0, integer: true })
        }),
        savant: new fields.SchemaField({
          label: new fields.StringField({ initial: "Savant" }),
          niveau: new fields.NumberField({ initial: 0, integer: true }),
          rang: new fields.NumberField({ initial: 0, integer: true }),
          pp: new fields.NumberField({ initial: 0, integer: true })
        })
      }),
      magie: new fields.SchemaField({
        pointsame: new fields.SchemaField({
          value: new fields.NumberField({ initial: 0, integer: true }),
          max: new fields.NumberField({ initial: 0, integer: true })
        })
      }),
      experience: new fields.SchemaField({
        value: new fields.StringField({ initial: "0" }),
        pourtricher: new fields.StringField({ initial: "0" })
      }),
      combat: new fields.SchemaField({
        esquive: new fields.SchemaField({
          masquee: new fields.NumberField({ initial: 0, integer: true }),
          demasquee: new fields.NumberField({ initial: 0, integer: true })
        }),
        parade: new fields.SchemaField({
          masquee: new fields.NumberField({ initial: 0, integer: true }),
          demasquee: new fields.NumberField({ initial: 0, integer: true }),
          value: new fields.NumberField({ initial: 0, integer: true })
        }),
        resistancephysique: new fields.SchemaField({
          value: new fields.NumberField({ initial: 0, integer: true })
        }),
        resistancepsychique: new fields.SchemaField({
          value: new fields.NumberField({ initial: 0, integer: true })
        }),
        protection: new fields.SchemaField({
          value: new fields.NumberField({ initial: 0, integer: true })
        }),
        effetssecondaires: new fields.StringField({ initial: "" }),
        dissimulation: new fields.SchemaField({
          value: new fields.NumberField({ initial: 0, integer: true })
        }),
        initiative: new fields.SchemaField({
          masquee: new fields.NumberField({ initial: 0, integer: true }),
          demasquee: new fields.NumberField({ initial: 0, integer: true })
        }),
        corpsacorps: new fields.SchemaField({
          masquee: new fields.NumberField({ initial: 0, integer: true }),
          demasquee: new fields.NumberField({ initial: 0, integer: true })
        }),
        tir: new fields.SchemaField({
          masquee: new fields.NumberField({ initial: 0, integer: true }),
          demasquee: new fields.NumberField({ initial: 0, integer: true })
        })
      })
    };
  }
}
