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

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

export class EquipmentDataModel extends BaseItem {

    static defineSchema() {
        return {
            quantity: new NumberField({required: true, integer: true, initial: 1}),
            category: new ArrayField(new StringField({required: true})),
            description: new HTMLField(),
            weight: new NumberField({required: true}),
            price: new StringField(),

            breakFactor: new NumberField({required: false}),
            iniModifier: new NumberField({required: false}),
            attackModifier: new NumberField({required: false}),
            parryModifier: new NumberField({required: false}),

            meleeAttackModifier: new NumberField({integer: true}),
            meleeAttackModifierIncrement: new NumberField({integer: true}),
            meleeSkills: new ArrayField(
                new StringField({required: true}),
            ),
            meleeAttackDamage: new StringField(),

            rangedSkills: new ArrayField(
                new StringField({required: true}),
            ),
            rangedRangeModifier: new StringField({required: false}),
            rangeRangeDamageModifier: new StringField({required: false}),
            rangedAttackDamage: new StringField(),
            rangedReloadTime: new NumberField({required: false}),

            armorValue: new NumberField({required: false}),
            armorHandicap: new NumberField({required: false}),
        }
    }

}
