mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-23 16:03:39 +02:00
.
This commit is contained in:
parent
6bf0fffcb7
commit
d44c704a40
2 changed files with 13 additions and 3 deletions
|
|
@ -97,6 +97,11 @@ export default class DHBeastform extends BaseDataItem {
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|
||||||
|
get beastformAttackData() {
|
||||||
|
const effect = this.parent.effects.find(x => x.type === 'beastform');
|
||||||
|
return DHBeastform.getBeastformAttackData(effect);
|
||||||
|
}
|
||||||
|
|
||||||
static getBeastformAttackData(effect) {
|
static getBeastformAttackData(effect) {
|
||||||
if (!effect) return null;
|
if (!effect) return null;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,13 +41,18 @@ export default class DhTooltipManager extends foundry.helpers.interaction.Toolti
|
||||||
|
|
||||||
if (effectData.type === 'beastform') {
|
if (effectData.type === 'beastform') {
|
||||||
const beastformData = {
|
const beastformData = {
|
||||||
features: effectItem.parent.items.filter(x => effectItem.system.featureIds.includes(x.id)),
|
features: [],
|
||||||
advantageOn: effectData.system.advantageOn,
|
advantageOn: effectData.system.advantageOn,
|
||||||
beastformAttackData: game.system.api.data.items.DHBeastform.getBeastformAttackData(effectItem)
|
beastformAttackData: game.system.api.data.items.DHBeastform.getBeastformAttackData(effectItem)
|
||||||
};
|
};
|
||||||
for (const feature of beastformData.features) {
|
|
||||||
feature.enrichedDescription = await feature.system.getEnrichedDescription();
|
const features = effectItem.parent.items.filter(x => effectItem.system.featureIds.includes(x.id));
|
||||||
|
for (const feature of features) {
|
||||||
|
const featureData = feature.toObject();
|
||||||
|
featureData.enrichedDescription = await feature.system.getEnrichedDescription();
|
||||||
|
beastformData.features.push(featureData);
|
||||||
}
|
}
|
||||||
|
|
||||||
effect.description = await foundry.applications.handlebars.renderTemplate(
|
effect.description = await foundry.applications.handlebars.renderTemplate(
|
||||||
'systems/daggerheart/templates/ui/tooltip/parts/beastformData.hbs',
|
'systems/daggerheart/templates/ui/tooltip/parts/beastformData.hbs',
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue