Skills working

This commit is contained in:
Neill Cox 2024-05-06 11:30:52 +10:00
parent b6c3da1127
commit 9a6fab6014
5 changed files with 63 additions and 10 deletions

View file

@ -1,6 +1,8 @@
import {doRoll} from "/systems/gurps/module/dierolls/dieroll.js"
// Do we need to use executeOTF?
export let RollHandler = null
Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
@ -79,6 +81,10 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
break
case 'attributes':
this.#handleAttributeAction(actor, actionId)
break
case 'skills':
this.#handleSkillAction(actor, actionId)
break
}
}
@ -129,5 +135,20 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
doRoll({ actor, formula, targetmods, prefix, thing, chatthing, origtarget: target, optionalArgs: opt })
}
async #handleSkillAction(actor, actionId) {
/* Skills are done using the otf method. Grab the otf and pass it to the function. */
let GURPS = globalThis.GURPS;
// actor, formula, targetmods, prefix = '', thing = '', chatthing = '', origtarget = -1, optionalArgs = {},
// executeOTF(inputstring, priv = false, event = null, actor = null) {
debugger;
let otf = actionId;
GURPS.executeOTF(otf, actor=actor);
// doRoll({ actor, formula, targetmods, prefix, thing, chatthing, origtarget: target, optionalArgs: opt })
}
}
})