[Fix] Adversary Compendium Pass (#960)

* Went over all adversaries to fix missing ranges

* Fixed translation for itemFeatures Protective

* Updated all instances of the 'Paired' WeaponFeature in the compendium

* Changed all adversary attacks to be chatDisplay=false
This commit is contained in:
WBHarry 2025-08-16 01:56:51 +02:00 committed by GitHub
parent ab76d9e91d
commit b241b36653
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
140 changed files with 1490 additions and 1201 deletions

View file

@ -1,3 +1,4 @@
import { getDocFromElement } from '../../../helpers/utils.mjs';
import DHBaseActorSheet from '../api/base-actor.mjs';
/**@typedef {import('@client/applications/_types.mjs').ApplicationClickAction} ApplicationClickAction */
@ -53,6 +54,15 @@ export default class AdversarySheet extends DHBaseActorSheet {
return context;
}
/**@inheritdoc */
_attachPartListeners(partId, htmlElement, options) {
super._attachPartListeners(partId, htmlElement, options);
htmlElement.querySelectorAll('.inventory-item-resource').forEach(element => {
element.addEventListener('change', this.updateItemResource.bind(this));
});
}
/**
* Prepare render context for the Biography part.
* @param {ApplicationRenderContext} context
@ -121,4 +131,18 @@ export default class AdversarySheet extends DHBaseActorSheet {
this.actor.diceRoll(config);
}
/* -------------------------------------------- */
/* Application Listener Actions */
/* -------------------------------------------- */
async updateItemResource(event) {
const item = await getDocFromElement(event.currentTarget);
if (!item) return;
const max = event.currentTarget.max ? Number(event.currentTarget.max) : null;
const value = max ? Math.min(Number(event.currentTarget.value), max) : event.currentTarget.value;
await item.update({ 'system.resource.value': value });
this.render();
}
}