import { PhysicalItemData } from "./base-item.mjs";
const fields = foundry.data.fields;

export default class ArmorData extends PhysicalItemData {
    static defineSchema() {
        const schema = super.defineSchema();
        schema.equipped = new fields.BooleanField({ required: false, initial: false });
        schema.radiations = new fields.NumberField({ required: false, initial: 0, min: 0, integer: true });
        schema.protection = new fields.StringField({ required: false, blank: false, trim: true });
        // A Traveller suffers DM-1 to all checks per missing skill level in the required skill.
        schema.requireSkill = new fields.StringField({ required: false, blank: false });
        schema.requireSkillLevel = new fields.NumberField({ required: false, min: 0, integer: true });
        // Powered armour supports its own weight and is effectively weightless for encumbrance.
        schema.powered = new fields.BooleanField({ required: false, initial: false });
        schema.options = new fields.ArrayField(
            new fields.SchemaField({
                name: new fields.StringField({ required: true, blank: true, trim: true }),
                description: new fields.StringField({ required: false, blank: true, trim: true })
            })
        );
        return schema;
    }
}
