summaryrefslogtreecommitdiff
path: root/resources/js/formula.js
diff options
context:
space:
mode:
Diffstat (limited to 'resources/js/formula.js')
-rw-r--r--resources/js/formula.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/resources/js/formula.js b/resources/js/formula.js
index 5a3433f..7223cb8 100644
--- a/resources/js/formula.js
+++ b/resources/js/formula.js
@@ -91,3 +91,17 @@ function calculateAwardedExperience (opposingMonster, participants) {
return awardedExperienceDistribution;
}
+
+/**
+ * @param {Monster} opposingMonster
+ *
+ * @returns {number[]}
+ */
+function calculateAwardedMoney (opposingMonster) {
+ let money = opposingMonster.level * opposingMonster.moneyModifier;
+
+ const baseDecimalDiff = 2 - DB.currencies.map[Memory.state.Settings.currency].decimals;
+ money = money * Math.pow(10, baseDecimalDiff);
+
+ return money;
+}