mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
[Feature] Beastform Compendium (#434)
* Various fixes * Added fixes to make beastforms work * . * Added all SRD beastforms
This commit is contained in:
parent
0fe6c4066a
commit
187a0dc090
80 changed files with 6189 additions and 89 deletions
|
|
@ -94,10 +94,13 @@ export default class DHBeastform extends BaseDataItem {
|
|||
return false;
|
||||
}
|
||||
|
||||
const features = await this.parent.parent.createEmbeddedDocuments(
|
||||
'Item',
|
||||
this.features.map(x => x.toObject())
|
||||
);
|
||||
const beastformFeatures = [];
|
||||
for (let featureData of this.features) {
|
||||
const feature = await foundry.utils.fromUuid(featureData.uuid);
|
||||
beastformFeatures.push(feature.toObject());
|
||||
}
|
||||
|
||||
const features = await this.parent.parent.createEmbeddedDocuments('Item', beastformFeatures);
|
||||
|
||||
const extraEffects = await this.parent.parent.createEmbeddedDocuments(
|
||||
'ActiveEffect',
|
||||
|
|
@ -152,12 +155,14 @@ export default class DHBeastform extends BaseDataItem {
|
|||
_onCreate(_data, _options, userId) {
|
||||
if (userId !== game.user.id) return;
|
||||
|
||||
this.parent.createEmbeddedDocuments('ActiveEffect', [
|
||||
{
|
||||
type: 'beastform',
|
||||
name: game.i18n.localize('DAGGERHEART.ITEMS.Beastform.beastformEffect'),
|
||||
img: 'icons/creatures/abilities/paw-print-pair-purple.webp'
|
||||
}
|
||||
]);
|
||||
if (!this.parent.effects.find(x => x.type === 'beastform')) {
|
||||
this.parent.createEmbeddedDocuments('ActiveEffect', [
|
||||
{
|
||||
type: 'beastform',
|
||||
name: game.i18n.localize('DAGGERHEART.ITEMS.Beastform.beastformEffect'),
|
||||
img: 'icons/creatures/abilities/paw-print-pair-purple.webp'
|
||||
}
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue