Something experimenting

This commit is contained in:
Nikhil Nagarajan 2025-11-08 16:02:12 -05:00
parent a23061a8be
commit eaf4e3b78f
3 changed files with 62 additions and 11 deletions

View file

@ -19,6 +19,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
actions: {
toggleVault: CharacterSheet.#toggleVault,
rollAttribute: CharacterSheet.#rollAttribute,
toggleHitpoints: CharacterSheet.#toggleHitPoints,
toggleHope: CharacterSheet.#toggleHope,
toggleLoadoutView: CharacterSheet.#toggleLoadoutView,
openPack: CharacterSheet.#openPack,
@ -727,6 +728,17 @@ export default class CharacterSheet extends DHBaseActorSheet {
this.render();
}
/**
* Toggles a hitpoint resource value.
* @type {ApplicationClickAction}
*/
static async #toggleHitPoints(_, button) {
const hitPointsValue = Number.parseInt(button.dataset.value);
const newValue = this.document.system.resources.hitPoints.value >= hitPointsValue ? hitPointsValue - 1 : hitPointsValue;
await this.document.update({ 'system.resources.hitPoints.value': newValue });
this.render();
}
/**
* Toggles a hope resource value.
* @type {ApplicationClickAction}