From 1a830d3823373efb17b4a478543ea916e03212c6 Mon Sep 17 00:00:00 2001
From: Justin Ross
`;
@@ -111,7 +115,8 @@ export class BladesActor extends Actor {
let modifier = parseInt(html.find('[name="mod"]')[0].value);
let position = html.find('[name="pos"]')[0].value;
let effect = html.find('[name="fx"]')[0].value;
- await this.rollAttribute(attribute_name, modifier, position, effect);
+ let note = html.find('[name="note"]')[0].value;
+ await this.rollAttribute(attribute_name, modifier, position, effect, note);
}
},
no: {
@@ -126,7 +131,7 @@ export class BladesActor extends Actor {
/* -------------------------------------------- */
- async rollAttribute(attribute_name = "", additional_dice_amount = 0, position, effect) {
+ async rollAttribute(attribute_name = "", additional_dice_amount = 0, position, effect, note) {
let dice_amount = 0;
if (attribute_name !== "") {
@@ -138,7 +143,7 @@ export class BladesActor extends Actor {
}
dice_amount += additional_dice_amount;
- await bladesRoll(dice_amount, attribute_name, position, effect);
+ await bladesRoll(dice_amount, attribute_name, position, effect, note);
}
/* -------------------------------------------- */
diff --git a/module/blades-roll.js b/module/blades-roll.js
index 50c0727..bcd91a6 100644
--- a/module/blades-roll.js
+++ b/module/blades-roll.js
@@ -5,7 +5,7 @@
* @param {string} position
* @param {string} effect
*/
-export async function bladesRoll(dice_amount, attribute_name = "", position = "risky", effect = "standard") {
+export async function bladesRoll(dice_amount, attribute_name = "", position = "risky", effect = "standard", note = "") {
// ChatMessage.getSpeaker(controlledToken)
let zeromode = false;
@@ -17,7 +17,7 @@ export async function bladesRoll(dice_amount, attribute_name = "", position = "r
// show 3d Dice so Nice if enabled
r.evaluate({async:true});
- await showChatRollMessage(r, zeromode, attribute_name, position, effect);
+ await showChatRollMessage(r, zeromode, attribute_name, position, effect, note);
}
/**
@@ -29,7 +29,7 @@ export async function bladesRoll(dice_amount, attribute_name = "", position = "r
* @param {string} position
* @param {string} effect
*/
-async function showChatRollMessage(r, zeromode, attribute_name = "", position = "", effect = "") {
+async function showChatRollMessage(r, zeromode, attribute_name = "", position = "", effect = "", note = "") {
let speaker = ChatMessage.getSpeaker();
let rolls = (r.terms)[0].results;
@@ -66,11 +66,11 @@ async function showChatRollMessage(r, zeromode, attribute_name = "", position =
effect_localize = 'BITD.EffectStandard'
}
- result = await renderTemplate("systems/blades-in-the-dark/templates/chat/action-roll.html", {rolls: rolls, roll_status: roll_status, attribute_label: attribute_label, position: position, position_localize: position_localize, effect: effect, effect_localize: effect_localize});
+ result = await renderTemplate("systems/blades-in-the-dark/templates/chat/action-roll.html", {rolls: rolls, roll_status: roll_status, attribute_label: attribute_label, position: position, position_localize: position_localize, effect: effect, effect_localize: effect_localize, note: note});
} else {
let stress = getBladesRollStress(rolls, zeromode);
- result = await renderTemplate("systems/blades-in-the-dark/templates/chat/resistance-roll.html", {rolls: rolls, roll_status: roll_status, attribute_label: attribute_label, stress: stress});
+ result = await renderTemplate("systems/blades-in-the-dark/templates/chat/resistance-roll.html", {rolls: rolls, roll_status: roll_status, attribute_label: attribute_label, stress: stress, note: note});
}
let messageData = {
diff --git a/templates/chat/action-roll.html b/templates/chat/action-roll.html
index ca6699d..fac21ed 100644
--- a/templates/chat/action-roll.html
+++ b/templates/chat/action-roll.html
@@ -47,7 +47,9 @@
{{{localize "BITD.RollResistance" stress=stress}}}