This commit is contained in:
WBHarry 2025-08-07 23:26:42 +02:00 committed by GitHub
parent 5045801475
commit 22283cb506
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 98 additions and 34 deletions

View file

@ -20,8 +20,8 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
class: this.character.system.class?.value ?? {},
subclass: this.character.system.class?.subclass ?? {},
experiences: {
[foundry.utils.randomID()]: { name: '', value: 2 },
[foundry.utils.randomID()]: { name: '', value: 2 }
[foundry.utils.randomID()]: { name: '', value: 2, core: true },
[foundry.utils.randomID()]: { name: '', value: 2, core: true }
},
domainCards: {
[foundry.utils.randomID()]: {},
@ -588,12 +588,21 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
this.setup.class.system.inventory.take.filter(x => x)
);
await this.character.update({
system: {
traits: this.setup.traits,
experiences: this.setup.experiences
}
});
await this.character.update(
{
system: {
traits: this.setup.traits,
experiences: {
...this.setup.experiences,
...Object.keys(this.character.system.experiences).reduce((acc, key) => {
acc[`-=${key}`] = null;
return acc;
}, {})
}
}
},
{ overwrite: true }
);
this.close();
}