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 => {