Get the base functions set up that are required for the roll shortcut

This commit is contained in:
Eldritch-Oliver 2025-10-05 23:47:52 -06:00
parent 92e844341d
commit 7c0fb75e0f

View file

@ -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
};