Spells and ranged attacks. Partial cleanup of i18n

This commit is contained in:
Neill Cox 2024-05-06 11:37:28 +10:00
parent 1d5328a9f1
commit 4619b787e5
5 changed files with 139 additions and 12 deletions

View file

@ -85,10 +85,16 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
case 'skills':
this.#handleSkillAction(actor, actionId)
break
case 'spells':
this.#handleSpellAction(actor, actionId)
break
case 'melee':
this.#handleMeleeAction(actor, actionId)
break
}
case 'ranged':
this.#handleRangedAction(actor, actionId)
break
}
}
/**
@ -139,6 +145,27 @@ 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);
}
async #handleRangedAction(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;
@ -146,12 +173,23 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
// executeOTF(inputstring, priv = false, event = null, actor = null) {
debugger;
// debugger;
let otf = actionId;
GURPS.executeOTF(otf, actor=actor);
// doRoll({ actor, formula, targetmods, prefix, thing, chatthing, origtarget: target, optionalArgs: opt })
}
async #handleSpellAction(actor, actionId) {
/* Spells 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);
}
}
})