[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

@ -371,6 +371,21 @@ export async function createEmbeddedItemWithEffects(actor, baseData, update) {
return doc;
}
export async function createEmbeddedItemsWithEffects(actor, baseData) {
const effectData = [];
for (let d of baseData) {
const data = d.uuid.startsWith('Compendium') ? await foundry.utils.fromUuid(d.uuid) : d;
effectData.push({
...data,
id: data.id,
uuid: data.uuid,
effects: data.effects?.map(effect => effect.toObject())
});
}
await actor.createEmbeddedDocuments('Item', effectData);
}
export const slugify = name => {
return name.toLowerCase().replaceAll(' ', '-').replaceAll('.', '');
};