Updating attribute calculation to look at all equipment #8188 (#8202)

* Taking all equipped items into account when calculating attributes instead of just head, weapon, sheild, and armor. closes #8185

* Refactored the stat calculations a bit so that all stat calculations are handled in the same location in the same way to try and reduce duplicate logic.
This commit also adds a number of tests to test this new behavior.

* spelling fixes
This commit is contained in:
Travis
2017-02-07 13:04:12 -06:00
committed by Keith Holliday
parent ffd36465c9
commit f8cfdfa37d
5 changed files with 120 additions and 141 deletions

View File

@@ -74,18 +74,6 @@
return display;
}
function levelBonus(level) {
// Level bonus is derived by taking the level, subtracting one,
// taking the smaller of it or maxLevel (100),
// dividing that by two and then raising it to a whole number
var levelOrMaxLevel = Math.min((level - 1), Shared.maxLevel);
var levelDividedByTwo = levelOrMaxLevel / 2;
var bonus = Math.ceil(levelDividedByTwo );
return bonus;
}
function mountMasterProgress(mounts) {
var dropMountsFound = Shared.count.mountMasterProgress(mounts);
var display = _formatOutOfTotalDisplay(dropMountsFound, TOTAL_NUMBER_OF_DROP_ANIMALS);
@@ -114,12 +102,9 @@
return {
beastMasterProgress: beastMasterProgress,
classBonus: classBonus,
equipmentStatBonus: equipmentStatBonus,
expDisplay: expDisplay,
goldDisplay: goldDisplay,
hpDisplay: hpDisplay,
levelBonus: levelBonus,
mountMasterProgress: mountMasterProgress,
mpDisplay: mpDisplay,
totalCount: totalCount