mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
* 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user