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

@ -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