fix(classes) misc class fixes

This commit is contained in:
Tyler Renelle 2013-12-12 19:28:29 -07:00
parent 98be57a82c
commit 6d0a2ad5b3
2 changed files with 11 additions and 7 deletions

View file

@ -11203,6 +11203,9 @@ var process=require("__browserify_process");(function() {
if (user.stats.points > 0) {
user.stats[stat]++;
user.stats.points--;
if (stat === 'int') {
user.stats.mp++;
}
}
return typeof cb === "function" ? cb(null, req) : void 0;
},
@ -11400,7 +11403,7 @@ var process=require("__browserify_process");(function() {
return _.reduce(['per', 'con', 'str', 'int'], function(m, stat) {
m[stat] = _.reduce('stats stats.buffs items.gear.equipped.weapon items.gear.equipped.armor items.gear.equipped.head items.gear.equipped.shield'.split(' '), function(m2, path) {
var val, _ref;
val = user.dotGet(path);
val = user.fns.dotGet(path);
return m2 + (~path.indexOf('items.gear') ? (+((_ref = content.gear.flat[val]) != null ? _ref[stat] : void 0) || 0) * (~(val != null ? val.indexOf(user.stats["class"]) : void 0) ? 1.5 : 1) : +val[stat] || 0);
}, 0);
return m;

View file

@ -821,6 +821,7 @@ api.wrap = (user) ->
if user.stats.points > 0
user.stats[stat]++
user.stats.points--
user.stats.mp++ if stat is 'int' #increase their MP along with their max MP
cb? null, req
@ -974,13 +975,13 @@ api.wrap = (user) ->
get: ->
_.reduce(['per','con','str','int'], (m,stat) =>
m[stat] = _.reduce('stats stats.buffs items.gear.equipped.weapon items.gear.equipped.armor items.gear.equipped.head items.gear.equipped.shield'.split(' '), (m2,path) =>
val = user.dotGet(path)
val = user.fns.dotGet(path)
m2 +
if ~path.indexOf('items.gear')
# get the gear stat, and multiply it by 1.5 if it's class-gear
(+content.gear.flat[val]?[stat] or 0) * (if ~val?.indexOf(user.stats.class) then 1.5 else 1)
else
+val[stat] or 0
if ~path.indexOf('items.gear')
# get the gear stat, and multiply it by 1.5 if it's class-gear
(+content.gear.flat[val]?[stat] or 0) * (if ~val?.indexOf(user.stats.class) then 1.5 else 1)
else
+val[stat] or 0
, 0); m
, {})
Object.defineProperty user, 'tasks',