mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
remove all changes from eslint --fix
This commit is contained in:
@@ -2,12 +2,12 @@ import content from '../content/index';
|
||||
import i18n from '../i18n';
|
||||
import _ from 'lodash';
|
||||
|
||||
module.exports = function (user, req, cb, analytics) {
|
||||
module.exports = function(user, req, cb, analytics) {
|
||||
var analyticsData, base, cl, gearOwned, item, losableItems, lostItem, lostStat;
|
||||
if (!(user.stats.hp <= 0)) {
|
||||
return typeof cb === 'function' ? cb({
|
||||
return typeof cb === "function" ? cb({
|
||||
code: 400,
|
||||
message: 'Cannot revive if not dead'
|
||||
message: "Cannot revive if not dead"
|
||||
}) : void 0;
|
||||
}
|
||||
_.merge(user.stats, {
|
||||
@@ -18,7 +18,7 @@ module.exports = function (user, req, cb, analytics) {
|
||||
if (user.stats.lvl > 1) {
|
||||
user.stats.lvl--;
|
||||
}
|
||||
lostStat = user.fns.randomVal(_.reduce(['str', 'con', 'per', 'int'], (function (m, k) {
|
||||
lostStat = user.fns.randomVal(_.reduce(['str', 'con', 'per', 'int'], (function(m, k) {
|
||||
if (user.stats[k]) {
|
||||
m[k] = k;
|
||||
}
|
||||
@@ -27,10 +27,10 @@ module.exports = function (user, req, cb, analytics) {
|
||||
if (lostStat) {
|
||||
user.stats[lostStat]--;
|
||||
}
|
||||
cl = user.stats['class'];
|
||||
gearOwned = (typeof (base = user.items.gear.owned).toObject === 'function' ? base.toObject() : void 0) || user.items.gear.owned;
|
||||
cl = user.stats["class"];
|
||||
gearOwned = (typeof (base = user.items.gear.owned).toObject === "function" ? base.toObject() : void 0) || user.items.gear.owned;
|
||||
losableItems = {};
|
||||
_.each(gearOwned, function (v, k) {
|
||||
_.each(gearOwned, function(v, k) {
|
||||
var itm;
|
||||
if (v) {
|
||||
itm = content.gear.flat['' + k];
|
||||
@@ -45,13 +45,13 @@ module.exports = function (user, req, cb, analytics) {
|
||||
if (item = content.gear.flat[lostItem]) {
|
||||
user.items.gear.owned[lostItem] = false;
|
||||
if (user.items.gear.equipped[item.type] === lostItem) {
|
||||
user.items.gear.equipped[item.type] = item.type + '_base_0';
|
||||
user.items.gear.equipped[item.type] = item.type + "_base_0";
|
||||
}
|
||||
if (user.items.gear.costume[item.type] === lostItem) {
|
||||
user.items.gear.costume[item.type] = item.type + '_base_0';
|
||||
user.items.gear.costume[item.type] = item.type + "_base_0";
|
||||
}
|
||||
}
|
||||
if (typeof user.markModified === 'function') {
|
||||
if (typeof user.markModified === "function") {
|
||||
user.markModified('items.gear');
|
||||
}
|
||||
analyticsData = {
|
||||
@@ -60,10 +60,10 @@ module.exports = function (user, req, cb, analytics) {
|
||||
gaLabel: lostItem,
|
||||
category: 'behavior'
|
||||
};
|
||||
if (analytics !== null) {
|
||||
if (analytics != null) {
|
||||
analytics.track('Death', analyticsData);
|
||||
}
|
||||
return typeof cb === 'function' ? cb((item ? {
|
||||
return typeof cb === "function" ? cb((item ? {
|
||||
code: 200,
|
||||
message: i18n.t('messageLostItem', {
|
||||
itemText: item.text(req.language)
|
||||
|
||||
Reference in New Issue
Block a user