diff --git a/Ironsworn/Ironsworn.html b/Ironsworn/Ironsworn.html
index 55798821b8..61e13af24a 100644
--- a/Ironsworn/Ironsworn.html
+++ b/Ironsworn/Ironsworn.html
@@ -6095,7 +6095,7 @@
When you attempt something risky or react to an imminent threat, envision your action and roll. If you act...
- - With speed, agility, or precision: Roll +edge.`
+ - With speed, agility, or precision: Roll +edge.
- With charm, loyalty, or courage: Roll +heart.
- With aggressive action, forceful defense, strength, or endurance: Roll +iron.
- With deception, stealth, or trickery: Roll +shadow.
@@ -27655,7 +27655,7 @@ on('change:close_changelog', function() {
'changelog_2.2.1': 'on',
});
});
- const progressStrings = [
+ const stdProgress = [
'one',
'two',
'three',
@@ -27668,13 +27668,26 @@ on('change:close_changelog', function() {
'ten'
]
+const vowProgress = [
+ '0',
+ '1',
+ '2',
+ '3',
+ '4',
+ '5',
+ '6',
+ '7',
+ '8',
+ '9'
+]
+
function getCurrentProgress (progressValues) {
let total = 0
progressValues.map(x =>{ total = x + total })
return total
}
-function updateProgressValues (newValue) {
+function updateProgressValues (newValue, progressStrings) {
let progressNumber = 0
for (; newValue > 0;) {
let updateValue = (newValue < 4) ? newValue : 4
@@ -27687,10 +27700,10 @@ function updateProgressValues (newValue) {
}
}
-function updateProgress (mark, progressArray) {
+function updateProgress (mark, progressArray, progressStrings) {
let newValue = mark + getCurrentProgress(progressArray)
let finalValue = (newValue < 40) ? newValue : 40
- updateProgressValues(finalValue)
+ updateProgressValues(finalValue, progressStrings)
}
function chosenDifficulty (rank) {
@@ -27712,6 +27725,8 @@ function chosenDifficulty (rank) {
on('change:repeating_progress:mark_progress change:repeating_vow:mark_progress change:repeating_sites:mark_progress', function(values) {
const type = values.sourceAttribute.match(/repeating_(.*?)_/)[1]
+ const progressStrings = type === 'vow' ? vowProgress : stdProgress
+
getAttrs([
`repeating_${type}_rank`,
`repeating_${type}_progress_${progressStrings[0]}`,
@@ -27740,12 +27755,14 @@ on('change:repeating_progress:mark_progress change:repeating_vow:mark_progress c
]
const rank = parseInt(attrValues[`repeating_${type}_rank`])
const mark = chosenDifficulty(rank)
- updateProgress(mark, progress)
+ updateProgress(mark, progress, progressStrings)
});
});
on('change:repeating_progress:clear_progress change:repeating_vow:clear_progress change:repeating_sites:clear_progress', function(values) {
const type = values.sourceAttribute.match(/repeating_(.*?)_/)[1]
+ const progressStrings = type === 'vow' ? vowProgress : stdProgress
+
setAttrs({
['repeating_' + type + '_progress_' + progressStrings[0]]: '0',
['repeating_' + type + '_progress_' + progressStrings[1]]: '0',
diff --git a/Ironsworn/src/app/workers/scripts/progress.js b/Ironsworn/src/app/workers/scripts/progress.js
index ba589cbd82..7e873db948 100644
--- a/Ironsworn/src/app/workers/scripts/progress.js
+++ b/Ironsworn/src/app/workers/scripts/progress.js
@@ -1,4 +1,4 @@
-const progressStrings = [
+const stdProgress = [
'one',
'two',
'three',
@@ -11,13 +11,26 @@ const progressStrings = [
'ten'
]
+const vowProgress = [
+ '0',
+ '1',
+ '2',
+ '3',
+ '4',
+ '5',
+ '6',
+ '7',
+ '8',
+ '9'
+]
+
function getCurrentProgress (progressValues) {
let total = 0
progressValues.map(x =>{ total = x + total })
return total
}
-function updateProgressValues (newValue) {
+function updateProgressValues (newValue, progressStrings) {
let progressNumber = 0
for (; newValue > 0;) {
let updateValue = (newValue < 4) ? newValue : 4
@@ -30,10 +43,10 @@ function updateProgressValues (newValue) {
}
}
-function updateProgress (mark, progressArray) {
+function updateProgress (mark, progressArray, progressStrings) {
let newValue = mark + getCurrentProgress(progressArray)
let finalValue = (newValue < 40) ? newValue : 40
- updateProgressValues(finalValue)
+ updateProgressValues(finalValue, progressStrings)
}
function chosenDifficulty (rank) {
@@ -55,6 +68,8 @@ function chosenDifficulty (rank) {
on('change:repeating_progress:mark_progress change:repeating_vow:mark_progress change:repeating_sites:mark_progress', function(values) {
const type = values.sourceAttribute.match(/repeating_(.*?)_/)[1]
+ const progressStrings = type === 'vow' ? vowProgress : stdProgress
+
getAttrs([
`repeating_${type}_rank`,
`repeating_${type}_progress_${progressStrings[0]}`,
@@ -83,12 +98,14 @@ on('change:repeating_progress:mark_progress change:repeating_vow:mark_progress c
]
const rank = parseInt(attrValues[`repeating_${type}_rank`])
const mark = chosenDifficulty(rank)
- updateProgress(mark, progress)
+ updateProgress(mark, progress, progressStrings)
});
});
on('change:repeating_progress:clear_progress change:repeating_vow:clear_progress change:repeating_sites:clear_progress', function(values) {
const type = values.sourceAttribute.match(/repeating_(.*?)_/)[1]
+ const progressStrings = type === 'vow' ? vowProgress : stdProgress
+
setAttrs({
['repeating_' + type + '_progress_' + progressStrings[0]]: '0',
['repeating_' + type + '_progress_' + progressStrings[1]]: '0',