From 7c0fb75e0f6c9bc84fb273ef089fe224451db3ff Mon Sep 17 00:00:00 2001 From: Eldritch-Oliver Date: Sun, 5 Oct 2025 23:47:52 -0600 Subject: [PATCH] Get the base functions set up that are required for the roll shortcut --- module/Apps/DelveDiceHUD.mjs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/module/Apps/DelveDiceHUD.mjs b/module/Apps/DelveDiceHUD.mjs index 2be2f59..a486e4b 100644 --- a/module/Apps/DelveDiceHUD.mjs +++ b/module/Apps/DelveDiceHUD.mjs @@ -6,6 +6,7 @@ import { Logger } from "../utils/Logger.mjs"; const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api; const { ContextMenu } = foundry.applications.ux; +const { Roll } = foundry.dice; const { FatePath } = gameTerms; const CompassRotations = { @@ -39,6 +40,7 @@ export class DelveDiceHUD extends HandlebarsApplicationMixin(ApplicationV2) { actions: { tourDelta: this.#tourDelta, setFate: this.#setFate, + hasteRoll: this.#hasteRoll, }, }; @@ -215,6 +217,12 @@ export class DelveDiceHUD extends HandlebarsApplicationMixin(ApplicationV2) { this._difficulty = value; game.settings.set(`ripcrypt`, `dc`, value); }; + + /** @this {DelveDiceHUD} */ + static async #hasteRoll() { + // TODO: if not GM, send socket request to GM + await this.rollForHaste(); + }; // #endregion // #region Public API @@ -255,5 +263,10 @@ export class DelveDiceHUD extends HandlebarsApplicationMixin(ApplicationV2) { this.#animateSandsTo(newSands); game.settings.set(`ripcrypt`, `sandsOfFate`, newSands); }; + + static async rollForHaste() { + const roll = new Roll(`1d8xo=1`); + await roll.evaluate(); + }; // #endregion };