diff --git a/langs/en-ca.json b/langs/en-ca.json index c27af21..5aaeccd 100644 --- a/langs/en-ca.json +++ b/langs/en-ca.json @@ -62,7 +62,8 @@ "Uncommon": "Uncommon", "Rare": "Rare", "Scarce": "Scarce" - } + }, + "protection": "Protection" }, "setting": { "abbrAccess": { diff --git a/module/data/Item/Armour.mjs b/module/data/Item/Armour.mjs index dbb1ea6..fe80576 100644 --- a/module/data/Item/Armour.mjs +++ b/module/data/Item/Armour.mjs @@ -1,9 +1,13 @@ +import { requiredInteger } from "../helpers.mjs"; + const { fields } = foundry.data; export class ArmourData extends foundry.abstract.TypeDataModel { // MARK: Schema static defineSchema() { - return {}; + return { + protection: requiredInteger({ min: 0, initial: 1 }), + }; }; // MARK: Base Data @@ -18,7 +22,15 @@ export class ArmourData extends foundry.abstract.TypeDataModel { // #region Sheet Data getFormFields(ctx) { - const fields = []; + const fields = [ + { + type: `integer`, + label: `RipCrypt.common.protection`, + value: this.protection, + path: `system.protection`, + min: 0, + }, + ]; return fields; }; // #endregion