[Feature] Item Description Enrichment (#1666)

* Added enrichment for Ancestries and Communities

* Fixed remainder

* Bit of padding

* Increased left padding
This commit is contained in:
WBHarry 2026-02-22 21:32:35 +01:00 committed by GitHub
parent 267de9a8cf
commit 56cc16b39a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
53 changed files with 350 additions and 54 deletions

View file

@ -113,13 +113,26 @@ export default class DHWeapon extends AttachableItem {
/**@inheritdoc */
async getDescriptionData() {
const baseDescription = this.description;
const tier = game.i18n.localize(`DAGGERHEART.GENERAL.Tiers.${this.tier}`);
const trait = game.i18n.localize(CONFIG.DH.ACTOR.abilities[this.attack.roll.trait].label);
const range = game.i18n.localize(`DAGGERHEART.CONFIG.Range.${this.attack.range}.name`);
const damage = Roll.replaceFormulaData(this.attack.damageFormula, this.parent.parent ?? this.parent);
const burden = game.i18n.localize(CONFIG.DH.GENERAL.burden[this.burden].label);
const allFeatures = CONFIG.DH.ITEM.allWeaponFeatures();
const features = this.weaponFeatures.map(x => allFeatures[x.value]);
if (!features.length) return { prefix: null, value: baseDescription, suffix: null };
const prefix = await foundry.applications.handlebars.renderTemplate(
'systems/daggerheart/templates/sheets/items/weapon/description.hbs',
{ features }
{
features,
tier,
trait,
range,
damage,
burden
}
);
return { prefix, value: baseDescription, suffix: null };