RC-102 | Armour | Protection

This commit is contained in:
Oliver-Akins 2025-01-15 19:51:31 -07:00
parent 6aa89b2173
commit 4948c7e755
2 changed files with 16 additions and 3 deletions

View file

@ -62,7 +62,8 @@
"Uncommon": "Uncommon", "Uncommon": "Uncommon",
"Rare": "Rare", "Rare": "Rare",
"Scarce": "Scarce" "Scarce": "Scarce"
} },
"protection": "Protection"
}, },
"setting": { "setting": {
"abbrAccess": { "abbrAccess": {

View file

@ -1,9 +1,13 @@
import { requiredInteger } from "../helpers.mjs";
const { fields } = foundry.data; const { fields } = foundry.data;
export class ArmourData extends foundry.abstract.TypeDataModel { export class ArmourData extends foundry.abstract.TypeDataModel {
// MARK: Schema // MARK: Schema
static defineSchema() { static defineSchema() {
return {}; return {
protection: requiredInteger({ min: 0, initial: 1 }),
};
}; };
// MARK: Base Data // MARK: Base Data
@ -18,7 +22,15 @@ export class ArmourData extends foundry.abstract.TypeDataModel {
// #region Sheet Data // #region Sheet Data
getFormFields(ctx) { getFormFields(ctx) {
const fields = []; const fields = [
{
type: `integer`,
label: `RipCrypt.common.protection`,
value: this.protection,
path: `system.protection`,
min: 0,
},
];
return fields; return fields;
}; };
// #endregion // #endregion