Merge branch 'develop' into api-v3
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
export let defaultAppearancePreferences = {
|
||||
background: {},
|
||||
hair: {
|
||||
bangs: {
|
||||
0: true,
|
||||
1: true,
|
||||
2: true,
|
||||
3: true,
|
||||
},
|
||||
base: {
|
||||
0: true,
|
||||
1: true,
|
||||
3: true,
|
||||
},
|
||||
beard: {
|
||||
0: true,
|
||||
},
|
||||
color: {
|
||||
white: true,
|
||||
brown: true,
|
||||
blond: true,
|
||||
red: true,
|
||||
black: true,
|
||||
},
|
||||
flower: {
|
||||
0: true,
|
||||
1: true,
|
||||
2: true,
|
||||
3: true,
|
||||
4: true,
|
||||
5: true,
|
||||
6: true,
|
||||
},
|
||||
mustache: {
|
||||
0: true,
|
||||
},
|
||||
},
|
||||
shirt: {
|
||||
black: true,
|
||||
blue: true,
|
||||
green: true,
|
||||
pink: true,
|
||||
white: true,
|
||||
yellow: true,
|
||||
},
|
||||
size: {
|
||||
slim: true,
|
||||
broad: true,
|
||||
},
|
||||
skin: {
|
||||
/* eslint-disable quote-props */
|
||||
'ddc994': true,
|
||||
'f5a76e': true,
|
||||
'ea8349': true,
|
||||
'c06534': true,
|
||||
'98461a': true,
|
||||
'915533': true,
|
||||
'c3e1dc': true,
|
||||
'6bd049': true,
|
||||
/* eslint-enable quote-props */
|
||||
},
|
||||
};
|
||||
@@ -86,6 +86,14 @@ let armor = {
|
||||
set: 'crystalCrescent',
|
||||
canOwn: ownsItem('armor_armoire_crystalCrescentRobes'),
|
||||
},
|
||||
dragonTamerArmor: {
|
||||
text: t('armorArmoireDragonTamerArmorText'),
|
||||
notes: t('armorArmoireDragonTamerArmorNotes', { con: 15 }),
|
||||
value: 100,
|
||||
con: 15,
|
||||
set: 'dragonTamer',
|
||||
canOwn: ownsItem('armor_armoire_dragonTamerArmor'),
|
||||
},
|
||||
};
|
||||
|
||||
let eyewear = {
|
||||
@@ -250,6 +258,14 @@ let head = {
|
||||
set: 'crystalCrescent',
|
||||
canOwn: ownsItem('head_armoire_crystalCrescentHat'),
|
||||
},
|
||||
dragonTamerHelm: {
|
||||
text: t('headArmoireDragonTamerHelmText'),
|
||||
notes: t('headArmoireDragonTamerHelmNotes', { int: 15 }),
|
||||
value: 100,
|
||||
int: 15,
|
||||
set: 'dragonTamer',
|
||||
canOwn: ownsItem('head_armoire_dragonTamerHelm'),
|
||||
},
|
||||
};
|
||||
|
||||
let shield = {
|
||||
@@ -280,6 +296,14 @@ let shield = {
|
||||
set: 'royal',
|
||||
canOwn: ownsItem('shield_armoire_royalCane'),
|
||||
},
|
||||
dragonTamerShield: {
|
||||
text: t('shieldArmoireDragonTamerShieldText'),
|
||||
notes: t('shieldArmoireDragonTamerShieldNotes', { per: 15 }),
|
||||
value: 100,
|
||||
per: 15,
|
||||
set: 'dragonTamer',
|
||||
canOwn: ownsItem('shield_armoire_dragonTamerShield'),
|
||||
},
|
||||
};
|
||||
|
||||
let weapon = {
|
||||
@@ -375,6 +399,13 @@ let weapon = {
|
||||
twoHanded: true,
|
||||
canOwn: ownsItem('weapon_armoire_blueLongbow'),
|
||||
},
|
||||
glowingSpear: {
|
||||
text: t('weaponArmoireGlowingSpearText'),
|
||||
notes: t('weaponArmoireGlowingSpearNotes', { str: 15 }),
|
||||
value: 100,
|
||||
str: 15,
|
||||
canOwn: ownsItem('weapon_armoire_glowingSpear'),
|
||||
},
|
||||
};
|
||||
|
||||
let armoireSet = {
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
import mysterySets from './mystery-sets';
|
||||
|
||||
import gear from './gear';
|
||||
import { defaultAppearancePreferences } from './appearance';
|
||||
|
||||
api.mystery = mysterySets;
|
||||
|
||||
@@ -1044,7 +1045,7 @@ api.premiumHatchingPotions = {
|
||||
text: t('hatchingPotionPeppermint'),
|
||||
limited: true,
|
||||
canBuy: (function() {
|
||||
return true;
|
||||
return false;
|
||||
})
|
||||
}
|
||||
};
|
||||
@@ -1622,7 +1623,6 @@ api.quests = {
|
||||
notes: t('questEvilSanta2Notes'),
|
||||
completion: t('questEvilSanta2Completion'),
|
||||
value: 4,
|
||||
previous: 'evilsanta',
|
||||
category: 'pet',
|
||||
collect: {
|
||||
tracks: {
|
||||
@@ -3010,6 +3010,8 @@ api.questsByLevel = _.sortBy(api.quests, function(quest) {
|
||||
return quest.lvl || 0;
|
||||
});
|
||||
|
||||
api.defaultAppearancePreferences = defaultAppearancePreferences;
|
||||
|
||||
api.backgrounds = {
|
||||
backgrounds062014: {
|
||||
beach: {
|
||||
@@ -3277,6 +3279,20 @@ api.backgrounds = {
|
||||
notes: t('backgroundWinterTownNotes')
|
||||
}
|
||||
},
|
||||
backgrounds012016: {
|
||||
frozen_lake: {
|
||||
text: t('backgroundFrozenLakeText'),
|
||||
notes: t('backgroundFrozenLakeNotes')
|
||||
},
|
||||
snowman_army: {
|
||||
text: t('backgroundSnowmanArmyText'),
|
||||
notes: t('backgroundSnowmanArmyNotes')
|
||||
},
|
||||
winter_night: {
|
||||
text: t('backgroundWinterNightText'),
|
||||
notes: t('backgroundWinterNightNotes')
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
api.subscriptionBlocks = {
|
||||
|
||||
+28
-14
@@ -9,7 +9,7 @@ import {
|
||||
} from './constants';
|
||||
import * as statHelpers from './statHelpers';
|
||||
|
||||
var $w, _, api, content, i18n, moment, preenHistory, sortOrder,
|
||||
var $w, _, api, content, i18n, preenHistory, moment, sortOrder,
|
||||
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
||||
|
||||
moment = require('moment');
|
||||
@@ -120,7 +120,6 @@ preenHistory = function(history) {
|
||||
return newHistory;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
Preen 3-day past-completed To-Dos from Angular & mobile app
|
||||
*/
|
||||
@@ -2271,41 +2270,56 @@ api.wrap = function(user, main) {
|
||||
}
|
||||
})()]++;
|
||||
},
|
||||
updateStats: function(stats, req, analytics) {
|
||||
updateStats (stats, req, analytics) {
|
||||
let allocatedStatPoints;
|
||||
let totalStatPoints;
|
||||
let experienceToNextLevel;
|
||||
|
||||
if (stats.hp <= 0) {
|
||||
return user.stats.hp = 0;
|
||||
user.stats.hp = 0;
|
||||
return user.stats.hp;
|
||||
}
|
||||
|
||||
user.stats.hp = stats.hp;
|
||||
user.stats.gp = stats.gp >= 0 ? stats.gp : 0;
|
||||
|
||||
var experienceToNextLevel = api.tnl(user.stats.lvl);
|
||||
experienceToNextLevel = api.tnl(user.stats.lvl);
|
||||
|
||||
if (stats.exp >= experienceToNextLevel) {
|
||||
user.stats.exp = stats.exp;
|
||||
|
||||
while (stats.exp >= experienceToNextLevel) {
|
||||
stats.exp -= experienceToNextLevel;
|
||||
user.stats.lvl++;
|
||||
experienceToNextLevel = api.tnl(user.stats.lvl);
|
||||
user.stats.hp = 50;
|
||||
var userTotalStatPoints = user.stats.str + user.stats.int + user.stats.con + user.stats.per;
|
||||
|
||||
if (userTotalStatPoints >= MAX_STAT_POINTS) {
|
||||
continue;
|
||||
experienceToNextLevel = api.tnl(user.stats.lvl);
|
||||
user.stats.hp = MAX_HEALTH;
|
||||
allocatedStatPoints = user.stats.str + user.stats.int + user.stats.con + user.stats.per;
|
||||
totalStatPoints = allocatedStatPoints + user.stats.points;
|
||||
|
||||
if (totalStatPoints >= MAX_STAT_POINTS) {
|
||||
continue; // eslint-disable-line no-continue
|
||||
}
|
||||
if (user.preferences.automaticAllocation) {
|
||||
user.fns.autoAllocate();
|
||||
} else {
|
||||
user.stats.points = user.stats.lvl - userTotalStatPoints;
|
||||
user.stats.points = user.stats.lvl - allocatedStatPoints;
|
||||
totalStatPoints = user.stats.points + allocatedStatPoints;
|
||||
|
||||
if (totalStatPoints > MAX_STAT_POINTS) {
|
||||
user.stats.points = MAX_STAT_POINTS - allocatedStatPoints;
|
||||
}
|
||||
|
||||
if (user.stats.points < 0) {
|
||||
user.stats.points = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
user.stats.exp = stats.exp;
|
||||
if (user.flags == null) {
|
||||
user.flags = {};
|
||||
}
|
||||
user.flags = user.flags || {};
|
||||
|
||||
if (!user.flags.customizationsNotification && (user.stats.exp > 5 || user.stats.lvl > 1)) {
|
||||
user.flags.customizationsNotification = true;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ let holidayQuests = {
|
||||
text: t('questEvilSanta2Text'),
|
||||
notes: t('questEvilSanta2Notes'),
|
||||
completion: t('questEvilSanta2Completion'),
|
||||
previous: 'evilsanta',
|
||||
collect: {
|
||||
tracks: {
|
||||
text: t('questEvilSanta2CollectTracks'),
|
||||
|
||||
Reference in New Issue
Block a user