Add calculation for equipment stat bonus

This commit is contained in:
Blade Barringer
2015-07-18 07:44:49 -05:00
parent 841923e054
commit e5428f29c1
2 changed files with 41 additions and 3 deletions

View File

@@ -7,7 +7,7 @@ var expect = chai.expect;
var statCalc = require('../../common/script/methods/statCalculations');
describe('stat calculation functions', function() {
describe('calculateLevelStatBonus', function() {
describe('levelBonus', function() {
it('calculates bonus as half of level for even numbered level under 100', function() {
var level = 50;
var bonus = statCalc.levelBonus(level);
@@ -32,4 +32,25 @@ describe('stat calculation functions', function() {
expect(bonus).to.eql(0);
});
});
describe('equipmentStatBonus', function() {
it('tallies up stats from euqipment that is equipped', function() {
var equippedGear = {
"weapon" : "weapon_special_1",
"shield" : "shield_special_1",
"head" : "head_special_1",
"armor" : "armor_special_1"
};
var strStat = statCalc.equipmentStatBonus('str', equippedGear);
var conStat = statCalc.equipmentStatBonus('con', equippedGear);
var intStat = statCalc.equipmentStatBonus('int', equippedGear);
var perStat = statCalc.equipmentStatBonus('per', equippedGear);
expect(strStat).to.eql(24);
expect(conStat).to.eql(24);
expect(intStat).to.eql(24);
expect(perStat).to.eql(24);
});
});
});