/**
 * 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: "" }),
        age: new fields.NumberField({ initial: 0, integer: true }),
        alignement: new fields.StringField({ initial: "" }),
        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: "" }),
        amemultiplier: new fields.NumberField({ initial: 2, integer: true }),
        ignoreamemalus: new fields.BooleanField({ initial: false }),
        ignoresantemalus: new fields.BooleanField({ initial: false }),
        notes: new fields.HTMLField({ initial: "" }),
        gmnotes: new fields.HTMLField({ initial: "" })
      }),
      // 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({
        base: new fields.NumberField({ initial: 0, integer: true }),
        bonus: new fields.NumberField({ initial: 0, integer: true }),
        nonletaux: new fields.NumberField({ initial: 0, integer: true }),
        letaux: new fields.NumberField({ initial: 0, integer: true }),
        malusmanuel: new fields.NumberField({ initial: 0, integer: true }),
        sequelles: new fields.StringField({ initial: "" })
      }),
      ame: new fields.SchemaField({
        fullmax: new fields.NumberField({ initial: 0, integer: true }),
        currentmax: new fields.NumberField({ initial: 0, integer: true }),
        value: new fields.NumberField({ initial: 0, integer: true }),
        traumatismes: new fields.StringField({ initial: "" })
      }),
      invocationsElementaires: new fields.ArrayField(new fields.ObjectField(), { initial: [] }),
      invocationsDemons: new fields.ArrayField(new fields.ObjectField(), { initial: [] }),
      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 }),
        defensebonus: new fields.NumberField({ initial: 0, integer: true }),
        monte: new fields.BooleanField({ initial: false })
      }),
      balance: new fields.SchemaField({
        loi: new fields.NumberField({ initial: 0, integer: true }),
        chaos: new fields.NumberField({ initial: 0, integer: true }),
        aspect: new fields.NumberField({ initial: 0, integer: true }),
        marge: new fields.NumberField({ initial: 0, integer: true }),
        pointschaos: new fields.NumberField({ initial: 0, integer: true }),
        pointsloi: new fields.NumberField({ initial: 0, integer: true })
      })
    };
  }
}