[Fix] Class Feature Change (#364)

* Changed to just use a features field

* Subclass now uses a simple Features field
This commit is contained in:
WBHarry 2025-07-17 19:43:35 +02:00 committed by GitHub
parent 1d5e267285
commit 0cc1597dfe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 158 additions and 97 deletions

View file

@ -124,12 +124,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({
@ -260,11 +257,11 @@ export default class DhCharacter extends BaseDataActor {
classFeatures.push(item);
} else if (item.system.originItemType === 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);
}