[Fix] ItemLink Fix (#1032)

* .

* .

* Removed outcommented code

* Raised to minor version

* Added confirmation on import of old character data
This commit is contained in:
WBHarry 2025-08-22 01:38:07 +02:00 committed by GitHub
parent 218f180fa0
commit 523ecb506b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 122 additions and 81 deletions

View file

@ -1,5 +1,4 @@
import BaseDataItem from './base.mjs';
import { ActionField, ActionsField } from '../fields/actionField.mjs';
export default class DHFeature extends BaseDataItem {
/** @inheritDoc */
@ -30,24 +29,7 @@ export default class DHFeature extends BaseDataItem {
nullable: true,
initial: null
}),
originId: new fields.StringField({ nullable: true, initial: null }),
identifier: new fields.StringField()
};
}
get spellcastingModifier() {
let traitValue = 0;
if (this.actor && this.originId && ['class', 'subclass'].includes(this.originItemType)) {
if (this.originItemType === 'subclass') {
traitValue =
this.actor.system.traits[this.actor.items.get(this.originId).system.spellcastingTrait]?.value ?? 0;
} else {
const { value: multiclass, subclass } = this.actor.system.multiclass;
const selectedSubclass = multiclass?.id === this.originId ? subclass : this.actor.system.class.subclass;
traitValue = this.actor.system.traits[selectedSubclass.system.spellcastingTrait]?.value ?? 0;
}
}
return traitValue;
}
}