From 4948c7e755e50588a7cc74484d9abdb5b09f4d17 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Wed, 15 Jan 2025 19:51:31 -0700 Subject: [PATCH] RC-102 | Armour | Protection --- langs/en-ca.json | 3 ++- module/data/Item/Armour.mjs | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) 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