Melee attacks

This commit is contained in:
Neill Cox 2024-05-05 17:13:49 +10:00
parent 9de7b72c02
commit 5d5af7328c
5 changed files with 57 additions and 3 deletions

View file

@ -85,7 +85,10 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
case 'skills':
this.#handleSkillAction(actor, actionId)
break
}
case 'melee':
this.#handleMeleeAction(actor, actionId)
break
}
}
/**
@ -136,6 +139,18 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
doRoll({ actor, formula, targetmods, prefix, thing, chatthing, origtarget: target, optionalArgs: opt })
}
async #handleMeleeAction(actor, actionId) {
/* Melee attacks are done using the otf method. Grab the otf and pass it to the function. */
let GURPS = globalThis.GURPS;
debugger;
let otf = actionId;
GURPS.executeOTF(otf, actor=actor);
// 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;