[Fix] 654 - CharacterCreation DomainCard Effects (#665)

* Character creation fix and levelup style fixes

* .

* Fixed old origin logic
This commit is contained in:
WBHarry 2025-08-07 01:10:15 +02:00 committed by GitHub
parent bcedc74bf3
commit ead2f6b8f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 66 additions and 48 deletions

View file

@ -1,6 +1,6 @@
import { abilities } from '../../config/actorConfig.mjs';
import { burden } from '../../config/generalConfig.mjs';
import { createEmbeddedItemWithEffects } from '../../helpers/utils.mjs';
import { createEmbeddedItemsWithEffects, createEmbeddedItemWithEffects } from '../../helpers/utils.mjs';
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
@ -555,13 +555,7 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
await createEmbeddedItemWithEffects(this.character, this.setup.community);
await createEmbeddedItemWithEffects(this.character, this.setup.class);
await createEmbeddedItemWithEffects(this.character, this.setup.subclass);
await this.character.createEmbeddedDocuments(
'Item',
Object.values(this.setup.domainCards).map(x => ({
...x,
effects: x.effects?.map(effect => effect.toObject())
}))
);
await createEmbeddedItemsWithEffects(this.character, Object.values(this.setup.domainCards));
if (this.equipment.armor.uuid)
await createEmbeddedItemWithEffects(this.character, this.equipment.armor, {
@ -583,14 +577,9 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
if (this.equipment.inventory.choiceB.uuid)
await createEmbeddedItemWithEffects(this.character, this.equipment.inventory.choiceB);
await this.character.createEmbeddedDocuments(
'Item',
this.setup.class.system.inventory.take
.filter(x => x)
.map(x => ({
...x,
effects: x.effects?.map(effect => effect.toObject())
}))
await createEmbeddedItemsWithEffects(
this.character,
this.setup.class.system.inventory.take.filter(x => x)
);
await this.character.update({

View file

@ -44,10 +44,12 @@ export default class DhlevelUp extends HandlebarsApplicationMixin(ApplicationV2)
static PARTS = {
tabs: { template: 'systems/daggerheart/templates/levelup/tabs/tab-navigation.hbs' },
advancements: { template: 'systems/daggerheart/templates/levelup/tabs/advancements.hbs' },
advancements: {
template: 'systems/daggerheart/templates/levelup/tabs/advancements.hbs'
},
selections: {
template: 'systems/daggerheart/templates/levelup/tabs/selections.hbs',
scrollable: ['.selections']
scrollable: ['.levelup-selections-container']
},
summary: { template: 'systems/daggerheart/templates/levelup/tabs/summary.hbs' },
footer: { template: 'systems/daggerheart/templates/levelup/tabs/footer.hbs' }