import BaseItem from "./base-item.mjs";

const {ArrayField, NumberField, StringField, HTMLField} = foundry.data.fields;

export class VornachteileDataModel extends BaseItem {

    static defineSchema() {
        return {
            name: new StringField({required: true}),
            description: new HTMLField(),

            // Optional Fields
            value: new ArrayField(new StringField(), {required: false}),
            regenerationASP: new ArrayField(new NumberField({integer: true}), {required: false}),
            regenerationLEP: new ArrayField(new NumberField({integer: true}), {required: false}),
            inRollRegeneration: new ArrayField(new NumberField({integer: true}), {required: false}),
            koRollRegeneration: new ArrayField(new NumberField({integer: true}), {required: false}),
            modGrosseRegeneration: new ArrayField(new NumberField({integer: true}), {required: false}),
            maxASP: new ArrayField(new NumberField({integer: true}), {required: false}),
            auswahl: new ArrayField(new StringField({required: false})),
            talente: new ArrayField(new StringField(), {required: false}),
            talentBonus: new NumberField({required: false, integer: true}),
            attribute: new ArrayField(new StringField(), {required: false}),
            attributBonus: new NumberField({required: false, integer: true}),
            ritualBonus: new NumberField({integer: true}),
            wundschwellenModifikator: new NumberField({integer: true}),
            inBonus: new NumberField(new NumberField({integer: true}), {required: false}),
            fkBonus: new NumberField(new NumberField({integer: true}), {required: false}),
            zauberBonus: new NumberField({integer: true, required: false}),
            gsMod: new ArrayField(new NumberField({integer: true}), {required: false}),
            ausweichenMod: new ArrayField(new NumberField({integer: true}), {required: false}),
            beVoraussetzung: new ArrayField(new NumberField({integer: true}), {required: false}),
            maxLEP: new ArrayField(new NumberField({integer: true}), {required: false}),
            maxMR: new ArrayField(new NumberField({integer: true}), {required: false}),
        }
        /*

         name: String,             // Name of Vornachteil will be used for rendering and referencing by other Items
         description: HTMLString,  // only used for rendering
         variant: [String]?,       // variant name of Vornachteil e.g. "Mut" in the case of "Herausragende Eigenschaft"
         levels: [Number]?,        // available levels e.g. 1, 2 in the case of "Flink"
         mods: [
            {
                level: Number?,    // in reference to level of the Vornachteil, is null when it does not have any levels or is the only modification
                field: String,     // Reference to Actor Data e.g. "FF" maps to "FF.mod"
                value: Number,     // value of the Modification e.g. "+2" maps to 2
                requirement: {
                    field: String     // Reference to Actor Data e.g. "BE" maps "be.aktuell"
                    operation: String // Supported: "<=", ">"
                    value: Number     // Target Value the referenced field has to compare against
                }?                 // optional when the mod does not have an active requirement
            }
         ]

         */
    }

}
