System init

This commit is contained in:
2022-12-04 12:16:25 +01:00
parent 3668798fa7
commit 5b7f7dc075
64 changed files with 188 additions and 70 deletions

View File

@ -10,11 +10,11 @@ const __saveFirstToKey = { r: "reflex", f: "fortitude", w: "willpower"}
export class DarkStarsCommands {
static init() {
if (!game.system.cruciblerpg.commands) {
const crucibleCommands = new DarkStarsCommands();
crucibleCommands.registerCommand({ path: ["/rtarget"], func: (content, msg, params) => DarkStarsCommands.rollTarget(msg, params), descr: "Launch the target roll window" });
crucibleCommands.registerCommand({ path: ["/rsave"], func: (content, msg, params) => DarkStarsCommands.rollSave(msg, params), descr: "Performs a save roll" });
game.system.cruciblerpg.commands = crucibleCommands;
if (!game.system.darkstars.commands) {
const darkStarsCommands = new DarkStarsCommands();
darkStarsCommands.registerCommand({ path: ["/rtarget"], func: (content, msg, params) => DarkStarsCommands.rollTarget(msg, params), descr: "Launch the target roll window" });
darkStarsCommands.registerCommand({ path: ["/rsave"], func: (content, msg, params) => DarkStarsCommands.rollSave(msg, params), descr: "Performs a save roll" });
game.system.darkstars.commands = darkStarsCommands;
}
}
@ -51,7 +51,7 @@ export class DarkStarsCommands {
if (path.length > 0 && path[0] && command.descr && (path.length != 1 || targetTable[path[0]] == undefined)) {
return true;
}
console.warn("crucibleCommands._validateCommand failed ", targetTable, path, command);
console.warn("darkStarsCommands._validateCommand failed ", targetTable, path, command);
return false;
}