diff options
author | Daniel Weipert <code@drogueronin.de> | 2023-08-22 15:01:03 +0200 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2023-08-22 15:01:03 +0200 |
commit | c0354b250f84d578b609a7f25d71dee7fc24e9ca (patch) | |
tree | af586e0a4c44a2f2c8df956ca3b992be15daaba3 /resources/js/formula.js | |
parent | 54e5ffaeb79f989463c144e58dfcd677b752c5a9 (diff) |
currency, save/load
Diffstat (limited to 'resources/js/formula.js')
-rw-r--r-- | resources/js/formula.js | 14 |
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; +} |