mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
[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:
parent
ab76d9e91d
commit
b241b36653
140 changed files with 1490 additions and 1201 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue