outfitters: add defense, components, etc

- add defense column, with mouse overs for max def, and defense
  up skill calculation for total max in mouseover
- add armor components to row mouse over, with totals in total
  row mouse over
- add row to resist table for resist skills, and include in totals
- refactor updating of skill totals and other number dicts
This commit is contained in:
Bryce Allen
2015-08-12 01:50:10 -05:00
parent a2008a0461
commit 4fd8c4c3a1
3 changed files with 157 additions and 40 deletions

View File

@@ -251,6 +251,38 @@ function set_horn_melodies_title(weapon_data) {
}
function get_object_as_text(obj) {
/*
var max_len = 0;
$.each(obj, function(k, v) {
if (k.length > max_len)
max_len = k.length
});
*/
var keys = Object.keys(obj);
keys.sort();
var lines = [];
$.each(keys, function(i, key) {
//var space = Array(2 + max_len - key.length).join(" ");
lines.push(key + " " + obj[key]);
});
return lines.join(", ");
}
function object_add_values(dst_obj, src_obj) {
// update dst_obj with values from src_obj, adding them together if
// the key is already in dst_obj
$.each(src_obj, function(k, v) {
if (k in dst_obj) {
dst_obj[k] += v;
} else {
dst_obj[k] = v;
}
});
}
function get_calculating_palico_setup(weapon_data) {
// NB: load_calculating_palico_data must be called first
var name = weapon_data["name"];