Rollable damages + protection

This commit is contained in:
2022-01-16 22:06:49 +01:00
parent 69b6fbca6b
commit 831b192691
8 changed files with 197 additions and 304 deletions

View File

@ -1,11 +1,11 @@
import { BoLDefaultRoll } from "../controllers/bol-rolls.js";
export class BoLUtility {
/* -------------------------------------------- */
static async init() {
this.attackStore = {};
Hooks.on('renderChatLog', (log, html, data) => BoLUtility.chatListeners(html));
this.attackStore = {}
}
/* -------------------------------------------- */
@ -25,6 +25,16 @@ export class BoLUtility {
return it;
}
/* -------------------------------------------- */
static storeRoll(roll) {
this.lastRoll = roll
}
/* -------------------------------------------- */
static getLastRoll() {
return this.lastRoll
}
/* -------------------------------------------- */
static createDirectOptionList(min, max) {
let options = {};
@ -121,9 +131,13 @@ export class BoLUtility {
}
});
html.on("click", '.hero-reroll', event => {
html.on("click", '.hero-reroll', event => {
event.preventDefault();
ui.notifications.warn("Not implemented up to now");
let rollData = BoLUtility.getLastRoll()
rollData.actor.subHeroPoints(1)
let r = new BoLDefaultRoll( rollData )
r.roll();
} );
html.on("click", '.damage-handling', event => {

View File

@ -30,9 +30,15 @@ export const preloadHandlebarsTemplates = async function () {
"systems/bol/templates/item/parts/properties/feature/flaw-properties.hbs",
"systems/bol/templates/item/parts/properties/feature/origin-properties.hbs",
"systems/bol/templates/item/parts/properties/feature/race-properties.hbs",
// DIALOGS
"systems/bol/templates/roll/parts/roll-dialog-modifiers.hbs",
"systems/bol/templates/roll/parts/roll-dialog-attribute.hbs"
"systems/bol/templates/roll/parts/roll-dialog-attribute.hbs",
"systems/bol/templates/dialogs/aptitude-roll-part.hbs",
"systems/bol/templates/dialogs/attribute-roll-part.hbs",
"systems/bol/templates/dialogs/mod-roll-part.hbs",
"systems/bol/templates/dialogs/adv-roll-part.hbs",
"systems/bol/templates/dialogs/career-roll-part.hbs",
];
// Load the template parts