566 sorcerer class (#581)

* add sorcerer subclass

* fix rogue not being in yet

* Fixed so subclasses can be dragged to sheet from compendium

---------

Co-authored-by: psitacus <walther.johnson@ucalgary.ca>
Co-authored-by: WBHarry <williambjrklund@gmail.com>
This commit is contained in:
Psitacus 2025-08-04 18:46:13 -06:00 committed by GitHub
parent 353f3a9e1e
commit 481652bf3f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 1405 additions and 2 deletions

View file

@ -42,6 +42,7 @@ export default class DHSubclass extends BaseDataItem {
async _preCreate(data, options, user) {
if (this.actor?.type === 'character') {
const dataUuid = data.uuid ?? data._stats?.compendiumSource ?? `Item.${data._id}`;
if (this.actor.system.class.subclass) {
if (this.actor.system.multiclass.subclass) {
ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.subclassesAlreadyPresent'));
@ -53,7 +54,7 @@ export default class DHSubclass extends BaseDataItem {
return false;
}
if (multiclass.system.subclasses.every(x => x.uuid !== (data.uuid ?? `Item.${data._id}`))) {
if (multiclass.system.subclasses.every(x => x.uuid !== dataUuid)) {
ui.notifications.error(
game.i18n.localize('DAGGERHEART.UI.Notifications.subclassNotInMulticlass')
);
@ -68,7 +69,7 @@ export default class DHSubclass extends BaseDataItem {
ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.missingClass'));
return false;
}
if (actorClass.system.subclasses.every(x => x.uuid !== (data.uuid ?? `Item.${data._id}`))) {
if (actorClass.system.subclasses.every(x => x.uuid !== dataUuid)) {
ui.notifications.error(game.i18n.localize('DAGGERHEART.UI.Notifications.subclassNotInClass'));
return false;
}