Added lookup for Horde feature

This commit is contained in:
WBHarry 2026-02-12 20:34:21 +01:00
parent f452adec00
commit a4031952d1
10 changed files with 22 additions and 15 deletions

View file

@ -41,6 +41,13 @@ export default class DHAttackAction extends DHDamageAction {
return hitPointsPart.value.getFormula(); return hitPointsPart.value.getFormula();
} }
get altDamageFormula() {
const hitPointsPart = this.damage.parts.find(x => x.applyTo === CONFIG.DH.GENERAL.healingTypes.hitPoints.id);
if (!hitPointsPart) return '0';
return hitPointsPart.valueAlt.getFormula();
}
async use(event, options) { async use(event, options) {
const result = await super.use(event, options); const result = await super.use(event, options);
if (!result.message) return; if (!result.message) return;

View file

@ -218,10 +218,10 @@
}, },
"items": [ "items": [
{ {
"name": "Horde (1d6+3)", "name": "Horde",
"type": "feature", "type": "feature",
"system": { "system": {
"description": "<p>When the @Lookup[@name] has marked half or more of their HP, their standard attack deals <strong>1d6+3</strong> physical damage instead.</p>", "description": "<p>When the @Lookup[@name] has marked half or more of their HP, their standard attack deals <strong>@Lookup[@system.attack.altDamageFormula]</strong> physical damage instead.</p>",
"resource": null, "resource": null,
"actions": {}, "actions": {},
"originItemType": null, "originItemType": null,

View file

@ -224,10 +224,10 @@
}, },
"items": [ "items": [
{ {
"name": "Horde (2d4+1)", "name": "Horde",
"type": "feature", "type": "feature",
"system": { "system": {
"description": "<p>When the @Lookup[@name] has marked half or more of their HP, their standard attack deals <strong>2d4+1</strong> physical damage instead.</p>", "description": "<p>When the @Lookup[@name] has marked half or more of their HP, their standard attack deals <strong>@Lookup[@system.attack.altDamageFormula]</strong> physical damage instead.</p>",
"resource": null, "resource": null,
"actions": {}, "actions": {},
"originItemType": null, "originItemType": null,

View file

@ -218,10 +218,10 @@
}, },
"items": [ "items": [
{ {
"name": "Horde (2d4+1)", "name": "Horde",
"type": "feature", "type": "feature",
"system": { "system": {
"description": "<p>When the @Lookup[@name] have marked half or more of their HP, their standard attack deals <strong>2d4+1</strong> physical damage instead.</p>", "description": "<p>When the @Lookup[@name] have marked half or more of their HP, their standard attack deals <strong>@Lookup[@system.attack.altDamageFormula]</strong> physical damage instead.</p>",
"resource": null, "resource": null,
"actions": {}, "actions": {},
"originItemType": null, "originItemType": null,

View file

@ -229,7 +229,7 @@
"_id": "9RduwBLYcBaiouYk", "_id": "9RduwBLYcBaiouYk",
"img": "icons/creatures/magical/humanoid-silhouette-aliens-green.webp", "img": "icons/creatures/magical/humanoid-silhouette-aliens-green.webp",
"system": { "system": {
"description": "<p>When the @Lookup[@name] have marked half or more of their HP, their standard attack deals <strong>1d4+1</strong> physical damage instead.</p>", "description": "<p>When the @Lookup[@name] have marked half or more of their HP, their standard attack deals <strong>@Lookup[@system.attack.altDamageFormula]</strong> physical damage instead.</p>",
"resource": null, "resource": null,
"actions": {}, "actions": {},
"originItemType": null, "originItemType": null,

View file

@ -229,7 +229,7 @@
"_id": "Q7DRbWjHl64CNwag", "_id": "Q7DRbWjHl64CNwag",
"img": "icons/creatures/magical/humanoid-silhouette-aliens-green.webp", "img": "icons/creatures/magical/humanoid-silhouette-aliens-green.webp",
"system": { "system": {
"description": "<p>When the @Lookup[@name] have marked half or more of their HP, their standard attack deals <strong>1d4+1</strong> physical damage instead.</p>", "description": "<p>When the @Lookup[@name] have marked half or more of their HP, their standard attack deals <strong>@Lookup[@system.attack.altDamageFormula]</strong> physical damage instead.</p>",
"resource": null, "resource": null,
"actions": {}, "actions": {},
"originItemType": null, "originItemType": null,

View file

@ -223,7 +223,7 @@
"_id": "9Zuu892SO5NmtI4w", "_id": "9Zuu892SO5NmtI4w",
"img": "icons/creatures/magical/humanoid-silhouette-aliens-green.webp", "img": "icons/creatures/magical/humanoid-silhouette-aliens-green.webp",
"system": { "system": {
"description": "<p>When the @Lookup[@name] has marked half or more of their HP, their standard attack deals <strong>1d4+1</strong> physical damage instead.</p>", "description": "<p>When the @Lookup[@name] has marked half or more of their HP, their standard attack deals <strong>@Lookup[@system.attack.altDamageFormula]</strong> physical damage instead.</p>",
"resource": null, "resource": null,
"actions": {}, "actions": {},
"originItemType": null, "originItemType": null,

View file

@ -254,12 +254,12 @@
}, },
"items": [ "items": [
{ {
"name": "Horde (1d4+2)", "name": "Horde",
"type": "feature", "type": "feature",
"_id": "4dSzqtYvH385r9Ng", "_id": "4dSzqtYvH385r9Ng",
"img": "icons/creatures/magical/humanoid-silhouette-aliens-green.webp", "img": "icons/creatures/magical/humanoid-silhouette-aliens-green.webp",
"system": { "system": {
"description": "<p>When the @Lookup[@name] has marked half or more of their HP, their standard attack deals <strong>1d4+2</strong> physical damage instead.</p>", "description": "<p>When the @Lookup[@name] has marked half or more of their HP, their standard attack deals <strong>@Lookup[@system.attack.altDamageFormula]</strong> physical damage instead.</p>",
"resource": null, "resource": null,
"actions": {}, "actions": {},
"originItemType": null, "originItemType": null,

View file

@ -218,10 +218,10 @@
}, },
"items": [ "items": [
{ {
"name": "Horde (2d6+5)", "name": "Horde",
"type": "feature", "type": "feature",
"system": { "system": {
"description": "<p>When the @Lookup[@name] has marked half or more of their HP, their standard attack deals <strong>2d6+5</strong> physical damage instead.</p>", "description": "<p>When the @Lookup[@name] has marked half or more of their HP, their standard attack deals <strong>@Lookup[@system.attack.altDamageFormula]</strong> physical damage instead.</p>",
"resource": null, "resource": null,
"actions": {}, "actions": {},
"originItemType": null, "originItemType": null,

View file

@ -218,12 +218,12 @@
}, },
"items": [ "items": [
{ {
"name": "Horde (1d4+2)", "name": "Horde",
"type": "feature", "type": "feature",
"_id": "nNJGAhWu0IuS2ybn", "_id": "nNJGAhWu0IuS2ybn",
"img": "icons/creatures/magical/humanoid-silhouette-aliens-green.webp", "img": "icons/creatures/magical/humanoid-silhouette-aliens-green.webp",
"system": { "system": {
"description": "<p>When the @Lookup[@name] have marked half or more of their HP, their standard attack deals <strong>1d4+2</strong> physical damage instead.</p>", "description": "<p>When the @Lookup[@name] have marked half or more of their HP, their standard attack deals <strong>@Lookup[@system.attack.altDamageFormula]</strong> physical damage instead.</p>",
"resource": null, "resource": null,
"actions": {}, "actions": {},
"originItemType": null, "originItemType": null,