From 1e9ef6d2e2b79bf35c20d7e3611e261cd8e067f3 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Wed, 4 Sep 2013 15:49:39 -0400 Subject: [PATCH] re-build. was getting revive errors for some reason --- dist/habitrpg-shared.js | 76 ++++++++++------------------------------- 1 file changed, 18 insertions(+), 58 deletions(-) diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index d9a0a535ef..fad0977d84 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -7347,7 +7347,6 @@ if(typeof module != 'undefined' && module.exports){ obj.revive = function(user, options) { var candidate, loseThisItem, owned, paths; - if (options == null) { options = {}; } @@ -7397,7 +7396,6 @@ if(typeof module != 'undefined' && module.exports){ obj.tnl = function(level) { var value; - if (level >= 100) { value = 0; } else { @@ -7417,7 +7415,6 @@ if(typeof module != 'undefined' && module.exports){ obj.expModifier = function(value, weaponStr, level, priority) { var exp, str, strMod, totalStr; - if (priority == null) { priority = '!'; } @@ -7440,7 +7437,6 @@ if(typeof module != 'undefined' && module.exports){ obj.hpModifier = function(value, armorDef, helmDef, shieldDef, level, priority) { var def, defMod, hp, totalDef; - if (priority == null) { priority = '!'; } @@ -7459,7 +7455,6 @@ if(typeof module != 'undefined' && module.exports){ obj.gpModifier = function(value, modifier, priority, streak, user) { var afterStreak, streakBonus, val; - if (priority == null) { priority = '!'; } @@ -7486,7 +7481,6 @@ if(typeof module != 'undefined' && module.exports){ obj.taskDeltaFormula = function(currentValue, direction) { var delta; - if (currentValue < -47.27) { currentValue = -47.27; } else if (currentValue > 21.27) { @@ -7505,8 +7499,7 @@ if(typeof module != 'undefined' && module.exports){ randomDrop = function(user, delta, priority, streak, options) { - var acceptableDrops, chanceMultiplier, drop, paths, rarity, reachedDropLimit, _base, _base1, _base2, _ref1, _ref2, _ref3, _ref4; - + var acceptableDrops, chanceMultiplier, drop, paths, rarity, reachedDropLimit, _base, _base1, _base2, _ref1; if (streak == null) { streak = 0; } @@ -7514,7 +7507,7 @@ if(typeof module != 'undefined' && module.exports){ options = {}; } paths = options.paths || {}; - if ((_ref1 = (_base = user.items).lastDrop) == null) { + if ((_base = user.items).lastDrop == null) { _base.lastDrop = { date: +moment().subtract('d', 1), count: 0 @@ -7528,11 +7521,11 @@ if(typeof module != 'undefined' && module.exports){ chanceMultiplier = Math.abs(delta); chanceMultiplier *= obj.priorityValue(priority); chanceMultiplier += streak; - if (((_ref2 = user.flags) != null ? _ref2.dropsEnabled : void 0) && Math.random() < (.05 * chanceMultiplier)) { + if (((_ref1 = user.flags) != null ? _ref1.dropsEnabled : void 0) && Math.random() < (.05 * chanceMultiplier)) { rarity = Math.random(); if (rarity > .5) { drop = helpers.randomVal(pets); - ((_ref3 = (_base1 = user.items).eggs) != null ? _ref3 : _base1.eggs = []).push(drop); + ((_base1 = user.items).eggs != null ? (_base1 = user.items).eggs : _base1.eggs = []).push(drop); paths['items.eggs'] = true; drop.type = 'Egg'; drop.dialog = "You've found a " + drop.text + " Egg! " + drop.notes; @@ -7548,12 +7541,11 @@ if(typeof module != 'undefined' && module.exports){ acceptableDrops = ['Base', 'White', 'Desert']; } acceptableDrops = hatchingPotions.filter(function(hatchingPotion) { - var _ref4; - - return _ref4 = hatchingPotion.name, __indexOf.call(acceptableDrops, _ref4) >= 0; + var _ref2; + return _ref2 = hatchingPotion.name, __indexOf.call(acceptableDrops, _ref2) >= 0; }); drop = helpers.randomVal(acceptableDrops); - ((_ref4 = (_base2 = user.items).hatchingPotions) != null ? _ref4 : _base2.hatchingPotions = []).push(drop.name); + ((_base2 = user.items).hatchingPotions != null ? (_base2 = user.items).hatchingPotions : _base2.hatchingPotions = []).push(drop.name); paths['items.hatchingPotions'] = true; drop.type = 'HatchingPotion'; drop.dialog = "You've found a " + drop.text + " Hatching Potion! " + drop.notes; @@ -7566,8 +7558,7 @@ if(typeof module != 'undefined' && module.exports){ }; obj.score = function(user, task, direction, options) { - var addPoints, calculateDelta, cron, delta, exp, gp, hp, lvl, num, paths, priority, streak, subtractPoints, times, type, value, _ref1, _ref2, _ref3, _ref4; - + var addPoints, calculateDelta, cron, delta, exp, gp, hp, lvl, num, paths, priority, streak, subtractPoints, times, type, value, _ref1, _ref2, _ref3; if (options == null) { options = {}; } @@ -7598,7 +7589,6 @@ if(typeof module != 'undefined' && module.exports){ } return _.times(times, function() { var nextDelta; - nextDelta = obj.taskDeltaFormula(value, direction); if (adjustvalue) { value += nextDelta; @@ -7608,7 +7598,6 @@ if(typeof module != 'undefined' && module.exports){ }; addPoints = function() { var weaponStr; - weaponStr = items.getItem('weapon', user.items.weapon).strength; exp += obj.expModifier(delta, weaponStr, user.stats.lvl, priority) / 2; if (streak) { @@ -7619,7 +7608,6 @@ if(typeof module != 'undefined' && module.exports){ }; subtractPoints = function() { var armorDef, headDef, shieldDef; - armorDef = items.getItem('armor', user.items.armor).defense; headDef = items.getItem('head', user.items.head).defense; shieldDef = items.getItem('shield', user.items.shield).defense; @@ -7634,7 +7622,7 @@ if(typeof module != 'undefined' && module.exports){ subtractPoints(); } if (task.value !== value) { - ((_ref4 = task.history) != null ? _ref4 : task.history = []).push({ + (task.history != null ? task.history : task.history = []).push({ date: +(new Date), value: value }); @@ -7702,8 +7690,7 @@ if(typeof module != 'undefined' && module.exports){ updateStats = function(user, newStats, options) { - var gp, paths, tnl, _ref1; - + var gp, paths, tnl; if (options == null) { options = {}; } @@ -7746,7 +7733,7 @@ if(typeof module != 'undefined' && module.exports){ paths['stats.lvl'] = true; paths['stats.gp'] = true; paths['stats.hp'] = true; - if ((_ref1 = user.flags) == null) { + if (user.flags == null) { user.flags = {}; } if (!user.flags.customizationsNotification && (user.stats.exp > 10 || user.stats.lvl > 1)) { @@ -7784,8 +7771,7 @@ if(typeof module != 'undefined' && module.exports){ obj.cron = function(user, options) { - var daysMissed, expTally, lvl, now, paths, todoTally, _base, _base1, _ref1, _ref2, _ref3, _ref4; - + var daysMissed, expTally, lvl, now, paths, todoTally, _base, _base1, _ref1; if (options == null) { options = {}; } @@ -7808,8 +7794,7 @@ if(typeof module != 'undefined' && module.exports){ } todoTally = 0; user.todos.concat(user.dailys).forEach(function(task) { - var absVal, completed, id, repeat, scheduleMisses, type, _ref2; - + var absVal, completed, id, repeat, scheduleMisses, type; if (!task) { return; } @@ -7820,7 +7805,6 @@ if(typeof module != 'undefined' && module.exports){ scheduleMisses = 0; _.times(daysMissed, function(n) { var thatDay; - thatDay = moment(now).subtract('days', n + 1); if (helpers.shouldDo(thatDay, repeat, user.preferences)) { return scheduleMisses++; @@ -7837,7 +7821,7 @@ if(typeof module != 'undefined' && module.exports){ } switch (type) { case 'daily': - ((_ref2 = task.history) != null ? _ref2 : task.history = []).push({ + (task.history != null ? task.history : task.history = []).push({ date: +(new Date), value: task.value }); @@ -7859,7 +7843,7 @@ if(typeof module != 'undefined' && module.exports){ return paths["tasks." + task.id + ".value"] = true; } }); - ((_ref2 = (_base = ((_ref3 = user.history) != null ? _ref3 : user.history = {})).todos) != null ? _ref2 : _base.todos = []).push({ + ((_base = (user.history != null ? user.history : user.history = {})).todos != null ? (_base = (user.history != null ? user.history : user.history = {})).todos : _base.todos = []).push({ date: now, value: todoTally }); @@ -7869,7 +7853,7 @@ if(typeof module != 'undefined' && module.exports){ lvl++; expTally += obj.tnl(lvl); } - ((_ref4 = (_base1 = user.history).exp) != null ? _ref4 : _base1.exp = []).push({ + ((_base1 = user.history).exp != null ? (_base1 = user.history).exp : _base1.exp = []).push({ date: now, value: expTally }); @@ -7899,7 +7883,6 @@ var process=require("__browserify_process");(function() { sanitizeOptions = function(o) { var dayStart, now, timezoneOffset, _ref; - dayStart = o.dayStart && (0 <= (_ref = +o.dayStart) && _ref <= 24) ? +o.dayStart : 0; timezoneOffset = o.timezoneOffset ? +o.timezoneOffset : +moment().zone(); now = o.now ? moment(o.now).zone(timezoneOffset) : moment(+(new Date)).zone(timezoneOffset); @@ -7912,7 +7895,6 @@ var process=require("__browserify_process");(function() { startOfWeek = function(options) { var o; - if (options == null) { options = {}; } @@ -7922,7 +7904,6 @@ var process=require("__browserify_process");(function() { startOfDay = function(options) { var o; - if (options == null) { options = {}; } @@ -7947,7 +7928,6 @@ var process=require("__browserify_process");(function() { daysSince = function(yesterday, options) { var o; - if (options == null) { options = {}; } @@ -7964,7 +7944,6 @@ var process=require("__browserify_process");(function() { shouldDo = function(day, repeat, options) { var o, selected, yesterday; - if (options == null) { options = {}; } @@ -7989,7 +7968,6 @@ var process=require("__browserify_process");(function() { uuid = function() { return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) { var r, v; - r = Math.random() * 16 | 0; v = (c === "x" ? r : r & 0x3 | 0x8); return v.toString(16); @@ -7999,8 +7977,7 @@ var process=require("__browserify_process");(function() { module.exports = { uuid: uuid, taskDefaults: function(task, filters) { - var defaults, self, _ref; - + var defaults, self; if (filters == null) { filters = {}; } @@ -8029,14 +8006,13 @@ var process=require("__browserify_process");(function() { }) }; _.defaults(task, defaults); - if ((_ref = task.value) == null) { + if (task.value == null) { task.value = task.type === 'reward' ? 10 : 0; } return task; }, newUser: function(isDerby) { var defaultTags, defaultTasks, guid, newUser, repeat, tag, task, userSchema, _i, _j, _len, _len1; - if (isDerby == null) { isDerby = false; } @@ -8199,7 +8175,6 @@ var process=require("__browserify_process");(function() { dotSet: function(path, val, obj) { var arr, err; - if (~path.indexOf('undefined')) { return; } @@ -8223,7 +8198,6 @@ var process=require("__browserify_process");(function() { }, dotGet: function(path, obj) { var err; - if (~path.indexOf('undefined')) { return void 0; } @@ -8253,7 +8227,6 @@ var process=require("__browserify_process");(function() { randomVal: function(obj) { var count, key, result, val; - result = void 0; count = 0; for (key in obj) { @@ -8280,7 +8253,6 @@ var process=require("__browserify_process");(function() { username: function(auth, override) { var fb, _ref; - if (override) { return override; } @@ -8305,7 +8277,6 @@ var process=require("__browserify_process");(function() { encodeiCalLink: function(uid, apiToken) { var loc, _ref; - loc = (typeof window !== "undefined" && window !== null ? window.location.host : void 0) || (typeof process !== "undefined" && process !== null ? (_ref = process.env) != null ? _ref.BASE_URL : void 0 : void 0) || ''; return encodeURIComponent("http://" + loc + "/v1/users/" + uid + "/calendar.ics?apiToken=" + apiToken); }, @@ -8315,7 +8286,6 @@ var process=require("__browserify_process");(function() { equipped: function(type, item, preferences, backerTier) { var armorSet, gender; - if (item == null) { item = 0; } @@ -8412,7 +8382,6 @@ var process=require("__browserify_process");(function() { taskClasses: function(task, filters, dayStart, lastCron, showCompleted, main) { var classes, completed, enabled, filter, repeat, type, value, _ref; - if (showCompleted == null) { showCompleted = false; } @@ -8506,7 +8475,6 @@ var process=require("__browserify_process");(function() { appliedTags: function(userTags, taskTags) { var arr; - arr = []; _.each(userTags, function(t) { if (t == null) { @@ -8527,7 +8495,6 @@ var process=require("__browserify_process");(function() { }, totalStr: function(level, weapon) { var str; - if (weapon == null) { weapon = 0; } @@ -8539,7 +8506,6 @@ var process=require("__browserify_process");(function() { }, totalDef: function(level, armor, head, shield) { var totalDef; - if (armor == null) { armor = 0; } @@ -8560,7 +8526,6 @@ var process=require("__browserify_process");(function() { }, itemStat: function(type, item) { var i; - if (item == null) { item = 0; } @@ -8584,7 +8549,6 @@ var process=require("__browserify_process");(function() { hydrate: function(spec) { var hydrated, keys, _this = this; - if (_.isObject(spec) && !_.isArray(spec)) { hydrated = {}; keys = _.keys(spec).concat(_.keys(spec.__proto__)); @@ -8961,7 +8925,6 @@ try { module.exports.buyItem = function(user, type, options) { var nextItem; - if (options == null) { options = {}; } @@ -8994,11 +8957,9 @@ try { module.exports.updateStore = function(user) { var changes; - changes = {}; _.each(['weapon', 'armor', 'shield', 'head'], function(type) { var i, showNext, _ref, _ref1, _ref2; - i = ~~(((_ref = user.items) != null ? _ref[type] : void 0) || 0) + 1; showNext = true; if (i === items[type].length - 1) { @@ -9026,7 +8987,6 @@ try { module.exports.getItem = function(type, index) { var i; - if (index == null) { index = 0; }