Various fixes and add rune support

This commit is contained in:
2026-03-30 23:38:45 +02:00
parent 2bf737a3ef
commit fb04448ab0
18 changed files with 506 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
import { SYSTEM } from "../config/system.mjs"
import { CLASS_RESTRICTION_CHOICES, SYSTEM } from "../config/system.mjs"
export default class OathHammerArmor extends foundry.abstract.TypeDataModel {
static defineSchema() {
@@ -39,7 +39,10 @@ export default class OathHammerArmor extends foundry.abstract.TypeDataModel {
schema.isCursed = new fields.BooleanField({ initial: false })
schema.magicEffect = new fields.HTMLField({ required: false, textSearch: true })
// Class/lineage restriction, e.g. "Dwarves only" (empty = no restriction)
schema.classRestriction = new fields.StringField({ required: true, nullable: false, initial: "" })
schema.classRestriction = new fields.StringField({ required: false, nullable: true, initial: null, choices: CLASS_RESTRICTION_CHOICES })
// Attached runic spells (max 2; each is a snapshot of the spell item)
schema.runes = new fields.ArrayField(new fields.ObjectField(), { required: true, initial: [] })
return schema
}