Generic roll and update items

This commit is contained in:
2022-01-13 16:13:00 +01:00
parent 9111a73555
commit b4a06a5049
13 changed files with 167 additions and 18 deletions

View File

@@ -2,6 +2,7 @@
import { PegasusActorCreate } from "./pegasus-create-char.js";
import { PegasusUtility } from "./pegasus-utility.js";
import { PegasusRollDialog } from "./pegasus-roll-dialog.js";
/* -------------------------------------------- */
export class PegasusCommands {
@@ -10,6 +11,7 @@ export class PegasusCommands {
if (!game.system.pegasus.commands) {
const pegasusCommands = new PegasusCommands();
pegasusCommands.registerCommand({ path: ["/char"], func: (content, msg, params) => pegasusCommands.createChar(msg), descr: "Create a new character" });
pegasusCommands.registerCommand({ path: ["/pool"], func: (content, msg, params) => pegasusCommands.poolRoll(msg), descr: "Generic Roll Window" });
game.system.pegasus.commands = pegasusCommands;
}
}
@@ -102,7 +104,26 @@ export class PegasusCommands {
static _chatAnswer(msg, content) {
msg.whisper = [game.user.id];
msg.content = content;
ChatMessage.create(msg);
ChatMessage.create(msg);
}
/* -------------------------------------------- */
async poolRoll( msg) {
let rollData = {
rollId:randomID(16),
alias: "Generic Roll",
rollMode: game.settings.get("core", "rollMode"),
optionsDiceList: PegasusUtility.getOptionsDiceList(),
statDicesLevel: 0,
specDicesLevel: 0,
bonusDicesLevel: 0,
hindranceDicesLevel: 0,
otherDicesLevel: 0,
}
rollData.mode = "generic"
rollData.title = `Generic Pool Roll`;
let rollDialog = await PegasusRollDialog.create( this, rollData);
rollDialog.render( true );
}
}