diff --git a/.gitignore b/.gitignore
index f1b7204..d0d49b5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/.idea/*
+/blades-in-the-dark.lock
diff --git a/module/blades-helpers.js b/module/blades-helpers.js
index 3873b3d..ebadb0e 100644
--- a/module/blades-helpers.js
+++ b/module/blades-helpers.js
@@ -223,4 +223,35 @@ export class BladesHelpers {
/* -------------------------------------------- */
+ /**
+ * Creates options for faction clocks.
+ *
+ * @param {int[]} sizes
+ * array of possible clock sizes
+ * @param {int} default_size
+ * default clock size
+ * @param {int} current_size
+ * current clock size
+ * @returns {string}
+ * html-formatted option string
+ */
+ static createListOfClockSizes( sizes, default_size, current_size ) {
+
+ let text = ``;
+
+ sizes.forEach( size => {
+ text += ``;
+ });
+
+ return text;
+
+ }
+
}
diff --git a/module/blades-item.js b/module/blades-item.js
index 4d1d1d7..e9ec920 100644
--- a/module/blades-item.js
+++ b/module/blades-item.js
@@ -65,6 +65,16 @@ export class BladesItem extends Item {
this._prepareCohort(data);
}
+
+ if (item_data.type === "faction") {
+ if( !data.goal_1_clock_value ){ data.goal_1_clock_value = 0 }
+ if( data.goal_1_clock_max === 0 ){ data.goal_1_clock_max = 4 }
+ if( !data.goal_2_clock_value ){ data.goal_2_clock_value = 0 }
+ if( data.goal_2_clock_max === 0 ){ data.goal_2_clock_max = 4 }
+ data.size_list_1 = BladesHelpers.createListOfClockSizes( game.system.bobclocks.sizes, data.goal_1_clock_max, parseInt( data.goal_1_clock_max ) );
+ data.size_list_2 = BladesHelpers.createListOfClockSizes( game.system.bobclocks.sizes, data.goal_2_clock_max, parseInt( data.goal_2_clock_max ) );
+ }
+
}
/**
diff --git a/module/blades-roll.js b/module/blades-roll.js
index 3eb57d3..50c0727 100644
--- a/module/blades-roll.js
+++ b/module/blades-roll.js
@@ -32,16 +32,8 @@ export async function bladesRoll(dice_amount, attribute_name = "", position = "r
async function showChatRollMessage(r, zeromode, attribute_name = "", position = "", effect = "") {
let speaker = ChatMessage.getSpeaker();
- let isBelow070 = isNewerVersion('0.7.0', game.data.version);
- let rolls = [];
+ let rolls = (r.terms)[0].results;
let attribute_label = BladesHelpers.getAttributeLabel(attribute_name);
-
- // Backward Compat for rolls.
- if (isBelow070) {
- rolls = (r.parts)[0].rolls;
- } else {
- rolls = (r.terms)[0].results;
- }
// Retrieve Roll status.
let roll_status = getBladesRollStatus(rolls, zeromode);
@@ -102,16 +94,8 @@ async function showChatRollMessage(r, zeromode, attribute_name = "", position =
*/
export function getBladesRollStatus(rolls, zeromode = false) {
- // Dice API has changed in 0.7.0 so need to keep that in mind.
- let isBelow070 = isNewerVersion('0.7.0', game.data.version);
-
- let sorted_rolls = [];
// Sort roll values from lowest to highest.
- if (isBelow070) {
- sorted_rolls = rolls.map(i => i.roll).sort();
- } else {
- sorted_rolls = rolls.map(i => i.result).sort();
- }
+ let sorted_rolls = rolls.map(i => i.result).sort();
let roll_status = "failure"
@@ -167,16 +151,8 @@ export function getBladesRollStress(rolls, zeromode = false) {
var stress = 6;
- // Dice API has changed in 0.7.0 so need to keep that in mind.
- let isBelow070 = isNewerVersion('0.7.0', game.data.version);
-
- let sorted_rolls = [];
// Sort roll values from lowest to highest.
- if (isBelow070) {
- sorted_rolls = rolls.map(i => i.roll).sort();
- } else {
- sorted_rolls = rolls.map(i => i.result).sort();
- }
+ let sorted_rolls = rolls.map(i => i.result).sort();
let roll_status = "failure"
diff --git a/module/blades.js b/module/blades.js
index 6e42653..a75114f 100644
--- a/module/blades.js
+++ b/module/blades.js
@@ -29,7 +29,10 @@ Hooks.once("init", async function() {
game.blades = {
dice: bladesRoll
- }
+ };
+ game.system.bobclocks = {
+ sizes: [ 4, 6, 8 ]
+ };
CONFIG.Item.documentClass = BladesItem;
CONFIG.Actor.documentClass = BladesActor;
diff --git a/styles/blades.css b/styles/blades.css
index fc87857..49c6bdf 100644
--- a/styles/blades.css
+++ b/styles/blades.css
@@ -1072,6 +1072,13 @@
* .clock-block .clocks.clocks-4 {
position: relative;
}
+* .clock-block .clocks.clocks-4.small .blades-clock,
+* .clock-block .clocks.clocks-6.small .blades-clock,
+* .clock-block .clocks.clocks-8.small .blades-clock,
+* .clock-block .clocks.clocks-12.small .blades-clock {
+ width: 100px;
+ height: 100px;
+}
* .clock-block .clocks.clocks-4 .blades-clock {
position: relative;
padding: 0;
diff --git a/templates/items/faction.html b/templates/items/faction.html
index 4240485..b0499b4 100644
--- a/templates/items/faction.html
+++ b/templates/items/faction.html
@@ -19,8 +19,29 @@
{{#if isGM }}
- Clock {{data.goal_1_clock_max}}:
{{data.goal_1}}
- Clock {{data.goal_2_clock_max}}:
{{data.goal_2}}
+
+