mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
[Fix] 654 - CharacterCreation DomainCard Effects (#665)
* Character creation fix and levelup style fixes * . * Fixed old origin logic
This commit is contained in:
parent
bcedc74bf3
commit
ead2f6b8f3
11 changed files with 66 additions and 48 deletions
|
|
@ -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('.', '');
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue