Subclass now uses a simple Features field

This commit is contained in:
WBHarry 2025-07-17 19:32:46 +02:00
parent a370a97d8d
commit 9f9ed73bdf
10 changed files with 102 additions and 57 deletions

View file

@ -122,12 +122,9 @@ export default class DhCharacter extends BaseDataActor {
label: 'DAGGERHEART.GENERAL.Range.other'
})
}),
rally: new fields.ArrayField(
new fields.StringField(),
{
label: 'DAGGERHEART.CLASS.Feature.rallyDice'
}
)
rally: new fields.ArrayField(new fields.StringField(), {
label: 'DAGGERHEART.CLASS.Feature.rallyDice'
})
}),
companion: new ForeignDocumentUUIDField({ type: 'Actor', nullable: true, initial: null }),
rules: new fields.SchemaField({
@ -258,11 +255,11 @@ export default class DhCharacter extends BaseDataActor {
classFeatures.push(item);
} else if (item.system.type === CONFIG.DH.ITEM.featureTypes.subclass.id) {
const subclassState = this.class.subclass.system.featureState;
const identifier = item.system.identifier;
const subType = item.system.subType;
if (
identifier === 'foundationFeature' ||
(identifier === 'specializationFeature' && subclassState >= 2) ||
(identifier === 'masterFeature' && subclassState >= 3)
subType === CONFIG.DH.ITEM.featureSubTypes.foundation ||
(subType === CONFIG.DH.ITEM.featureSubTypes.specialization && subclassState >= 2) ||
(subType === CONFIG.DH.ITEM.featureSubTypes.mastery && subclassState >= 3)
) {
subclassFeatures.push(item);
}