Merged develop
This commit is contained in:
@@ -2,7 +2,7 @@ export const MAX_HEALTH = 50;
|
||||
export const MAX_LEVEL = 100;
|
||||
export const MAX_STAT_POINTS = MAX_LEVEL;
|
||||
export const ATTRIBUTES = ['str', 'int', 'per', 'con'];
|
||||
export const MAX_INCENTIVES = 100;
|
||||
export const MAX_INCENTIVES = 500;
|
||||
|
||||
export const TAVERN_ID = '00000000-0000-4000-A000-000000000000';
|
||||
export const LARGE_GROUP_COUNT_MESSAGE_CUTOFF = 5000;
|
||||
@@ -12,4 +12,6 @@ export const SUPPORTED_SOCIAL_NETWORKS = [
|
||||
{key: 'google', name: 'Google'},
|
||||
];
|
||||
|
||||
export const GUILDS_PER_PAGE = 30; // number of guilds to return per page when using pagination
|
||||
export const GUILDS_PER_PAGE = 30; // number of guilds to return per page when using pagination
|
||||
|
||||
export const PARTY_LIMIT_MEMBERS = 30;
|
||||
|
||||
@@ -97,6 +97,11 @@ let basicAchievs = {
|
||||
pluralTitleKey: 'perfectName',
|
||||
pluralTextKey: 'perfectText',
|
||||
},
|
||||
royallyLoyal: {
|
||||
icon: 'achievement-royally-loyal',
|
||||
titleKey: 'royallyLoyal',
|
||||
textKey: 'royallyLoyalText',
|
||||
},
|
||||
};
|
||||
Object.assign(achievementsData, basicAchievs);
|
||||
|
||||
@@ -107,7 +112,7 @@ let specialAchievs = {
|
||||
textKey: 'contribText',
|
||||
},
|
||||
npc: {
|
||||
icon: 'achievement-ultimate-warrior',
|
||||
icon: 'achievement-npc',
|
||||
titleKey: 'npcAchievementName',
|
||||
textKey: 'npcAchievementText',
|
||||
},
|
||||
|
||||
@@ -479,7 +479,40 @@ let backgrounds = {
|
||||
notes: t('backgroundMistiflyingCircusNotes'),
|
||||
},
|
||||
},
|
||||
backgrounds042017: {
|
||||
bug_covered_log: {
|
||||
text: t('backgroundBugCoveredLogText'),
|
||||
notes: t('backgroundBugCoveredLogNotes'),
|
||||
},
|
||||
giant_birdhouse: {
|
||||
text: t('backgroundGiantBirdhouseText'),
|
||||
notes: t('backgroundGiantBirdhouseNotes'),
|
||||
},
|
||||
mist_shrouded_mountain: {
|
||||
text: t('backgroundMistShroudedMountainText'),
|
||||
notes: t('backgroundMistShroudedMountainNotes'),
|
||||
},
|
||||
},
|
||||
backgrounds052017: {
|
||||
guardian_statues: {
|
||||
text: t('backgroundGuardianStatuesText'),
|
||||
notes: t('backgroundGuardianStatuesNotes'),
|
||||
},
|
||||
habit_city_streets: {
|
||||
text: t('backgroundHabitCityStreetsText'),
|
||||
notes: t('backgroundHabitCityStreetsNotes'),
|
||||
},
|
||||
on_tree_branch: {
|
||||
text: t('backgroundOnATreeBranchText'),
|
||||
notes: t('backgroundOnATreeBranchNotes'),
|
||||
},
|
||||
},
|
||||
incentiveBackgrounds: {
|
||||
violet: {
|
||||
text: t('backgroundVioletText'),
|
||||
notes: t('backgroundVioletNotes'),
|
||||
currency: 'loginIncentive',
|
||||
},
|
||||
blue: {
|
||||
text: t('backgroundBlueText'),
|
||||
notes: t('backgroundBlueNotes'),
|
||||
|
||||
@@ -10,13 +10,14 @@ module.exports = prefill({
|
||||
winterHairColors: {setPrice: 5, availableUntil: '2016-01-01'},
|
||||
pastelHairColors: {setPrice: 5, availableUntil: '2016-01-01'},
|
||||
rainbowHairColors: {setPrice: 5, text: t('rainbowColors')},
|
||||
shimmerHairColors: {setPrice: 5, availableUntil: '2016-05-02', text: t('shimmerColors')},
|
||||
shimmerHairColors: {setPrice: 5, availableUntil: '2017-05-02', text: t('shimmerColors')},
|
||||
hauntedHairColors: {setPrice: 5, availableUntil: '2016-11-01', text: t('hauntedColors')},
|
||||
winteryHairColors: {setPrice: 5, availableFrom: '2015-12-18', availableUntil: '2016-02-02', text: t('winteryColors')},
|
||||
rainbowSkins: {setPrice: 5, text: t('rainbowSkins')},
|
||||
animalSkins: {setPrice: 5, text: t('animalSkins')},
|
||||
pastelSkins: {setPrice: 5, availableUntil: '2016-05-02', text: t('pastelSkins')},
|
||||
pastelSkins: {setPrice: 5, availableUntil: '2017-05-02', text: t('pastelSkins')},
|
||||
spookySkins: {setPrice: 5, availableUntil: '2016-01-01', text: t('spookySkins')},
|
||||
supernaturalSkins: {setPrice: 5, availableUntil: '2016-11-01', text: t('supernaturalSkins')},
|
||||
splashySkins: {setPrice: 5, availableUntil: '2016-01-01', text: t('splashySkins')},
|
||||
winterySkins: {setPrice: 5, availableFrom: '2015-12-18', availableUntil: '2016-02-02', text: t('winterySkins')},
|
||||
});
|
||||
|
||||
@@ -64,5 +64,14 @@ module.exports = prefill({
|
||||
'shark': {price: 2, set: sets.splashySkins},
|
||||
'tropicalwater': {price: 2, set: sets.splashySkins},
|
||||
|
||||
'aurora': {price: 2, set: sets.winterySkins},
|
||||
'dapper': {price: 2, set: sets.winterySkins},
|
||||
'festive': {price: 2, set: sets.winterySkins},
|
||||
'holly': {price: 2, set: sets.winterySkins},
|
||||
'polar': {price: 2, set: sets.winterySkins},
|
||||
'sugar': {price: 2, set: sets.winterySkins},
|
||||
'snowy': {price: 2, set: sets.winterySkins},
|
||||
'winterstar': {price: 2, set: sets.winterySkins},
|
||||
|
||||
/* eslint-enable quote-props */
|
||||
});
|
||||
|
||||
@@ -27,6 +27,7 @@ export const EVENTS = {
|
||||
summer2016: { start: '2016-06-21', end: '2016-08-02' },
|
||||
fall2016: { start: '2016-09-20', end: '2016-11-02' },
|
||||
winter2017: { start: '2016-12-16', end: '2017-02-02' },
|
||||
spring2017: { start: '2017-03-21', end: '2017-05-02' },
|
||||
};
|
||||
|
||||
export const GEAR_TYPES = [
|
||||
|
||||
@@ -28,6 +28,7 @@ function hasQuestAchievementFunction (key) {
|
||||
let drops = {
|
||||
Wolf: {
|
||||
text: t('dropEggWolfText'),
|
||||
mountText: t('dropEggWolfMountText'),
|
||||
adjective: t('dropEggWolfAdjective'),
|
||||
},
|
||||
TigerCub: {
|
||||
@@ -47,18 +48,22 @@ let drops = {
|
||||
},
|
||||
Fox: {
|
||||
text: t('dropEggFoxText'),
|
||||
mountText: t('dropEggFoxMountText'),
|
||||
adjective: t('dropEggFoxAdjective'),
|
||||
},
|
||||
FlyingPig: {
|
||||
text: t('dropEggFlyingPigText'),
|
||||
mountText: t('dropEggFlyingPigMountText'),
|
||||
adjective: t('dropEggFlyingPigAdjective'),
|
||||
},
|
||||
Dragon: {
|
||||
text: t('dropEggDragonText'),
|
||||
mountText: t('dropEggDragonMountText'),
|
||||
adjective: t('dropEggDragonAdjective'),
|
||||
},
|
||||
Cactus: {
|
||||
text: t('dropEggCactusText'),
|
||||
mountText: t('dropEggCactusMountText'),
|
||||
adjective: t('dropEggCactusAdjective'),
|
||||
},
|
||||
BearCub: {
|
||||
@@ -71,66 +76,78 @@ let drops = {
|
||||
let quests = {
|
||||
Gryphon: {
|
||||
text: t('questEggGryphonText'),
|
||||
mountText: t('questEggGryphonMountText'),
|
||||
adjective: t('questEggGryphonAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('gryphon'),
|
||||
},
|
||||
Hedgehog: {
|
||||
text: t('questEggHedgehogText'),
|
||||
mountText: t('questEggHedgehogMountText'),
|
||||
adjective: t('questEggHedgehogAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('hedgehog'),
|
||||
},
|
||||
Deer: {
|
||||
text: t('questEggDeerText'),
|
||||
mountText: t('questEggDeerMountText'),
|
||||
adjective: t('questEggDeerAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('ghost_stag'),
|
||||
},
|
||||
Egg: {
|
||||
text: t('questEggEggText'),
|
||||
adjective: t('questEggEggAdjective'),
|
||||
mountText: t('questEggEggMountText'),
|
||||
adjective: t('questEggEggAdjective'),
|
||||
},
|
||||
Rat: {
|
||||
text: t('questEggRatText'),
|
||||
mountText: t('questEggRatMountText'),
|
||||
adjective: t('questEggRatAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('rat'),
|
||||
},
|
||||
Octopus: {
|
||||
text: t('questEggOctopusText'),
|
||||
mountText: t('questEggOctopusMountText'),
|
||||
adjective: t('questEggOctopusAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('octopus'),
|
||||
},
|
||||
Seahorse: {
|
||||
text: t('questEggSeahorseText'),
|
||||
mountText: t('questEggSeahorseMountText'),
|
||||
adjective: t('questEggSeahorseAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('dilatory_derby'),
|
||||
},
|
||||
Parrot: {
|
||||
text: t('questEggParrotText'),
|
||||
mountText: t('questEggParrotMountText'),
|
||||
adjective: t('questEggParrotAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('harpy'),
|
||||
},
|
||||
Rooster: {
|
||||
text: t('questEggRoosterText'),
|
||||
mountText: t('questEggRoosterMountText'),
|
||||
adjective: t('questEggRoosterAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('rooster'),
|
||||
},
|
||||
Spider: {
|
||||
text: t('questEggSpiderText'),
|
||||
mountText: t('questEggSpiderMountText'),
|
||||
adjective: t('questEggSpiderAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('spider'),
|
||||
},
|
||||
Owl: {
|
||||
text: t('questEggOwlText'),
|
||||
mountText: t('questEggOwlMountText'),
|
||||
adjective: t('questEggOwlAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('owl'),
|
||||
},
|
||||
Penguin: {
|
||||
text: t('questEggPenguinText'),
|
||||
mountText: t('questEggPenguinMountText'),
|
||||
adjective: t('questEggPenguinAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('penguin'),
|
||||
},
|
||||
TRex: {
|
||||
text: t('questEggTRexText'),
|
||||
mountText: t('questEggTRexMountText'),
|
||||
adjective: t('questEggTRexAdjective'),
|
||||
canBuy (user) {
|
||||
let questAchievements = user.achievements.quests;
|
||||
@@ -143,51 +160,61 @@ let quests = {
|
||||
},
|
||||
Rock: {
|
||||
text: t('questEggRockText'),
|
||||
mountText: t('questEggRockMountText'),
|
||||
adjective: t('questEggRockAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('rock'),
|
||||
},
|
||||
Bunny: {
|
||||
text: t('questEggBunnyText'),
|
||||
mountText: t('questEggBunnyMountText'),
|
||||
adjective: t('questEggBunnyAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('bunny'),
|
||||
},
|
||||
Slime: {
|
||||
text: t('questEggSlimeText'),
|
||||
mountText: t('questEggSlimeMountText'),
|
||||
adjective: t('questEggSlimeAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('slime'),
|
||||
},
|
||||
Sheep: {
|
||||
text: t('questEggSheepText'),
|
||||
mountText: t('questEggSheepMountText'),
|
||||
adjective: t('questEggSheepAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('sheep'),
|
||||
},
|
||||
Cuttlefish: {
|
||||
text: t('questEggCuttlefishText'),
|
||||
mountText: t('questEggCuttlefishMountText'),
|
||||
adjective: t('questEggCuttlefishAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('kraken'),
|
||||
},
|
||||
Whale: {
|
||||
text: t('questEggWhaleText'),
|
||||
mountText: t('questEggWhaleMountText'),
|
||||
adjective: t('questEggWhaleAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('whale'),
|
||||
},
|
||||
Cheetah: {
|
||||
text: t('questEggCheetahText'),
|
||||
mountText: t('questEggCheetahMountText'),
|
||||
adjective: t('questEggCheetahAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('cheetah'),
|
||||
},
|
||||
Horse: {
|
||||
text: t('questEggHorseText'),
|
||||
mountText: t('questEggHorseMountText'),
|
||||
adjective: t('questEggHorseAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('horse'),
|
||||
},
|
||||
Frog: {
|
||||
text: t('questEggFrogText'),
|
||||
mountText: t('questEggFrogMountText'),
|
||||
adjective: t('questEggFrogAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('frog'),
|
||||
},
|
||||
Snake: {
|
||||
text: t('questEggSnakeText'),
|
||||
mountText: t('questEggSnakeMountText'),
|
||||
adjective: t('questEggSnakeAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('snake'),
|
||||
},
|
||||
@@ -199,79 +226,100 @@ let quests = {
|
||||
},
|
||||
Sabretooth: {
|
||||
text: t('questEggSabretoothText'),
|
||||
mountText: t('questEggSabretoothMountText'),
|
||||
adjective: t('questEggSabretoothAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('sabretooth'),
|
||||
},
|
||||
Monkey: {
|
||||
text: t('questEggMonkeyText'),
|
||||
mountText: t('questEggMonkeyMountText'),
|
||||
adjective: t('questEggMonkeyAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('monkey'),
|
||||
},
|
||||
Snail: {
|
||||
text: t('questEggSnailText'),
|
||||
mountText: t('questEggSnailMountText'),
|
||||
adjective: t('questEggSnailAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('snail'),
|
||||
},
|
||||
Falcon: {
|
||||
text: t('questEggFalconText'),
|
||||
mountText: t('questEggFalconMountText'),
|
||||
adjective: t('questEggFalconAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('falcon'),
|
||||
},
|
||||
Treeling: {
|
||||
text: t('questEggTreelingText'),
|
||||
mountText: t('questEggTreelingMountText'),
|
||||
adjective: t('questEggTreelingAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('treeling'),
|
||||
},
|
||||
Axolotl: {
|
||||
text: t('questEggAxolotlText'),
|
||||
mountText: t('questEggAxolotlMountText'),
|
||||
adjective: t('questEggAxolotlAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('axolotl'),
|
||||
},
|
||||
Turtle: {
|
||||
text: t('questEggTurtleText'),
|
||||
mountText: t('questEggTurtleMountText'),
|
||||
adjective: t('questEggTurtleAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('turtle'),
|
||||
},
|
||||
Armadillo: {
|
||||
text: t('questEggArmadilloText'),
|
||||
mountText: t('questEggArmadilloMountText'),
|
||||
adjective: t('questEggArmadilloAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('armadillo'),
|
||||
},
|
||||
Cow: {
|
||||
text: t('questEggCowText'),
|
||||
mountText: t('questEggCowMountText'),
|
||||
adjective: t('questEggCowAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('cow'),
|
||||
},
|
||||
Beetle: {
|
||||
text: t('questEggBeetleText'),
|
||||
mountText: t('questEggBeetleMountText'),
|
||||
adjective: t('questEggBeetleAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('beetle'),
|
||||
},
|
||||
Ferret: {
|
||||
text: t('questEggFerretText'),
|
||||
mountText: t('questEggFerretMountText'),
|
||||
adjective: t('questEggFerretAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('ferret'),
|
||||
},
|
||||
Sloth: {
|
||||
text: t('questEggSlothText'),
|
||||
mountText: t('questEggSlothMountText'),
|
||||
adjective: t('questEggSlothAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('sloth'),
|
||||
},
|
||||
Triceratops: {
|
||||
text: t('questEggTriceratopsText'),
|
||||
mountText: t('questEggTriceratopsMountText'),
|
||||
adjective: t('questEggTriceratopsAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('triceratops'),
|
||||
},
|
||||
GuineaPig: {
|
||||
text: t('questEggGuineaPigText'),
|
||||
mountText: t('questEggGuineaPigMountText'),
|
||||
adjective: t('questEggGuineaPigAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('guineapig'),
|
||||
},
|
||||
Peacock: {
|
||||
text: t('questEggPeacockText'),
|
||||
mountText: t('questEggPeacockMountText'),
|
||||
adjective: t('questEggPeacockAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('peacock'),
|
||||
},
|
||||
Butterfly: {
|
||||
text: t('questEggButterflyText'),
|
||||
mountText: t('questEggButterflyMountText'),
|
||||
adjective: t('questEggButterflyAdjective'),
|
||||
canBuy: hasQuestAchievementFunction('butterfly'),
|
||||
},
|
||||
};
|
||||
|
||||
applyEggDefaults(drops, {
|
||||
|
||||
@@ -14,7 +14,11 @@ for (let i = 0; i <= NUMBER_OF_QUESTIONS; i++) {
|
||||
let question = {
|
||||
question: t(`faqQuestion${i}`),
|
||||
ios: t(`iosFaqAnswer${i}`),
|
||||
web: t(`webFaqAnswer${i}`),
|
||||
web: t(`webFaqAnswer${i}`, {
|
||||
// TODO: Need to pull these values from nconf
|
||||
techAssistanceEmail: 'admin@habitica.com',
|
||||
wikiTechAssistanceEmail: 'mailto:admin@habitica.com',
|
||||
}),
|
||||
};
|
||||
|
||||
faq.questions.push(question);
|
||||
|
||||
@@ -226,6 +226,23 @@ let armor = {
|
||||
set: 'mushroomDruid',
|
||||
canOwn: ownsItem('armor_armoire_mushroomDruidArmor'),
|
||||
},
|
||||
greenFestivalYukata: {
|
||||
text: t('armorArmoireGreenFestivalYukataText'),
|
||||
notes: t('armorArmoireGreenFestivalYukataNotes', { attrs: 8 }),
|
||||
value: 100,
|
||||
con: 8,
|
||||
per: 8,
|
||||
set: 'festivalAttire',
|
||||
canOwn: ownsItem('armor_armoire_greenFestivalYukata'),
|
||||
},
|
||||
merchantTunic: {
|
||||
text: t('armorArmoireMerchantTunicText'),
|
||||
notes: t('armorArmoireMerchantTunicNotes', { per: 10 }),
|
||||
value: 100,
|
||||
per: 10,
|
||||
set: 'merchant',
|
||||
canOwn: ownsItem('armor_armoire_merchantTunic'),
|
||||
},
|
||||
};
|
||||
|
||||
let eyewear = {
|
||||
@@ -524,6 +541,15 @@ let head = {
|
||||
set: 'mushroomDruid',
|
||||
canOwn: ownsItem('head_armoire_mushroomDruidCap'),
|
||||
},
|
||||
merchantChaperon: {
|
||||
text: t('headArmoireMerchantChaperonText'),
|
||||
notes: t('headArmoireMerchantChaperonNotes', { attrs: 7 }),
|
||||
value: 100,
|
||||
int: 7,
|
||||
per: 7,
|
||||
set: 'merchant',
|
||||
canOwn: ownsItem('head_armoire_merchantChaperon'),
|
||||
},
|
||||
};
|
||||
|
||||
let shield = {
|
||||
@@ -617,6 +643,14 @@ let shield = {
|
||||
set: 'mushroomDruid',
|
||||
canOwn: ownsItem('shield_armoire_mushroomDruidShield'),
|
||||
},
|
||||
festivalParasol: {
|
||||
text: t('shieldArmoireFestivalParasolText'),
|
||||
notes: t('shieldArmoireFestivalParasolNotes', { con: 8 }),
|
||||
value: 100,
|
||||
con: 8,
|
||||
set: 'festivalAttire',
|
||||
canOwn: ownsItem('shield_armoire_festivalParasol'),
|
||||
},
|
||||
};
|
||||
|
||||
let headAccessory = {
|
||||
@@ -829,6 +863,22 @@ let weapon = {
|
||||
per: 9,
|
||||
canOwn: ownsItem('weapon_armoire_forestFungusStaff'),
|
||||
},
|
||||
festivalFirecracker: {
|
||||
text: t('weaponArmoireFestivalFirecrackerText'),
|
||||
notes: t('weaponArmoireFestivalFirecrackerNotes', { per: 8 }),
|
||||
value: 100,
|
||||
per: 8,
|
||||
set: 'festivalAttire',
|
||||
canOwn: ownsItem('weapon_armoire_festivalFirecracker'),
|
||||
},
|
||||
merchantsDisplayTray: {
|
||||
text: t('weaponArmoireMerchantsDisplayTrayText'),
|
||||
notes: t('weaponArmoireMerchantsDisplayTrayNotes', { int: 10 }),
|
||||
value: 100,
|
||||
int: 10,
|
||||
set: 'merchant',
|
||||
canOwn: ownsItem('weapon_armoire_merchantsDisplayTray'),
|
||||
},
|
||||
};
|
||||
|
||||
let armoireSet = {
|
||||
|
||||
@@ -151,6 +151,18 @@ let armor = {
|
||||
mystery: '201612',
|
||||
value: 0,
|
||||
},
|
||||
201703: {
|
||||
text: t('armorMystery201703Text'),
|
||||
notes: t('armorMystery201703Notes'),
|
||||
mystery: '201703',
|
||||
value: 0,
|
||||
},
|
||||
201704: {
|
||||
text: t('armorMystery201704Text'),
|
||||
notes: t('armorMystery201704Notes'),
|
||||
mystery: '201704',
|
||||
value: 0,
|
||||
},
|
||||
301404: {
|
||||
text: t('armorMystery301404Text'),
|
||||
notes: t('armorMystery301404Notes'),
|
||||
@@ -226,6 +238,12 @@ let back = {
|
||||
mystery: '201702',
|
||||
value: 0,
|
||||
},
|
||||
201704: {
|
||||
text: t('backMystery201704Text'),
|
||||
notes: t('backMystery201704Notes'),
|
||||
mystery: '201704',
|
||||
value: 0,
|
||||
},
|
||||
};
|
||||
|
||||
let eyewear = {
|
||||
@@ -430,6 +448,12 @@ let head = {
|
||||
mystery: '201702',
|
||||
value: 0,
|
||||
},
|
||||
201703: {
|
||||
text: t('headMystery201703Text'),
|
||||
notes: t('headMystery201703Notes'),
|
||||
mystery: '201703',
|
||||
value: 0,
|
||||
},
|
||||
301404: {
|
||||
text: t('headMystery301404Text'),
|
||||
notes: t('headMystery301404Notes'),
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,8 @@ import defaults from 'lodash/defaults';
|
||||
import each from 'lodash/each';
|
||||
import t from './translation';
|
||||
|
||||
const CURRENT_SEASON = 'May';
|
||||
|
||||
let drops = {
|
||||
Base: {
|
||||
value: 2,
|
||||
@@ -58,6 +60,18 @@ let premium = {
|
||||
limited: true,
|
||||
_season: 'valentines',
|
||||
},
|
||||
Shimmer: {
|
||||
value: 2,
|
||||
text: t('hatchingPotionShimmer'),
|
||||
limited: true,
|
||||
_season: 'April',
|
||||
},
|
||||
Fairy: {
|
||||
value: 2,
|
||||
text: t('hatchingPotionFairy'),
|
||||
limited: true,
|
||||
_season: 'May',
|
||||
},
|
||||
Floral: {
|
||||
value: 2,
|
||||
text: t('hatchingPotionFloral'),
|
||||
@@ -118,11 +132,13 @@ each(premium, (pot, key) => {
|
||||
notes: t('hatchingPotionNotes', {
|
||||
potText: pot.text,
|
||||
}),
|
||||
_addlNotes: t(`${pot._season}EventAvailability`),
|
||||
_addlNotes: t('eventAvailability', {
|
||||
date: t(`dateEnd${pot._season}`),
|
||||
}),
|
||||
premium: true,
|
||||
limited: false,
|
||||
canBuy () {
|
||||
return pot._season === 'regular';
|
||||
return pot._season === CURRENT_SEASON;
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -125,11 +125,13 @@ api.timeTravelStable = {
|
||||
'Mammoth-Base': t('mammoth'),
|
||||
'MantisShrimp-Base': t('mantisShrimp'),
|
||||
'Phoenix-Base': t('phoenix'),
|
||||
'MagicalBee-Base': t('magicalBee'),
|
||||
},
|
||||
mounts: {
|
||||
'Mammoth-Base': t('mammoth'),
|
||||
'MantisShrimp-Base': t('mantisShrimp'),
|
||||
'Phoenix-Base': t('phoenix'),
|
||||
'MagicalBee-Base': t('magicalBee'),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -950,10 +952,10 @@ api.quests = {
|
||||
notes: t('questEggHuntNotes'),
|
||||
completion: t('questEggHuntCompletion'),
|
||||
value: 1,
|
||||
category: 'pet',
|
||||
canBuy () {
|
||||
return false;
|
||||
},
|
||||
category: 'pet',
|
||||
collect: {
|
||||
plainEgg: {
|
||||
text: t('questEggHuntCollectPlainEgg'),
|
||||
@@ -2989,6 +2991,151 @@ api.quests = {
|
||||
unlock: t('questPeacockUnlockText'),
|
||||
},
|
||||
},
|
||||
butterfly: {
|
||||
text: t('questButterflyText'),
|
||||
notes: t('questButterflyNotes'),
|
||||
completion: t('questButterflyCompletion'),
|
||||
value: 4,
|
||||
category: 'pet',
|
||||
boss: {
|
||||
name: t('questButterflyBoss'),
|
||||
hp: 400,
|
||||
str: 1.5,
|
||||
},
|
||||
drop: {
|
||||
items: [
|
||||
{
|
||||
type: 'eggs',
|
||||
key: 'Butterfly',
|
||||
text: t('questButterflyDropButterflyEgg'),
|
||||
}, {
|
||||
type: 'eggs',
|
||||
key: 'Butterfly',
|
||||
text: t('questButterflyDropButterflyEgg'),
|
||||
}, {
|
||||
type: 'eggs',
|
||||
key: 'Butterfly',
|
||||
text: t('questButterflyDropButterflyEgg'),
|
||||
},
|
||||
],
|
||||
gp: 31,
|
||||
exp: 200,
|
||||
unlock: t('questButterflyUnlockText'),
|
||||
},
|
||||
},
|
||||
mayhemMistiflying1: {
|
||||
text: t('questMayhemMistiflying1Text'),
|
||||
notes: t('questMayhemMistiflying1Notes'),
|
||||
completion: t('questMayhemMistiflying1Completion'),
|
||||
value: 4,
|
||||
goldValue: 200,
|
||||
category: 'gold',
|
||||
boss: {
|
||||
name: t('questMayhemMistiflying1Boss'),
|
||||
hp: 500,
|
||||
rage: {
|
||||
title: t('questMayhemMistiflying1RageTitle'),
|
||||
description: t('questMayhemMistiflying1RageDescription'),
|
||||
value: 50,
|
||||
healing: 0.3,
|
||||
effect: t('questMayhemMistiflying1RageEffect'),
|
||||
},
|
||||
},
|
||||
drop: {
|
||||
items: [
|
||||
{
|
||||
type: 'hatchingPotions',
|
||||
key: 'Skeleton',
|
||||
text: t('questMayhemMistiflying1DropSkeletonPotion'),
|
||||
}, {
|
||||
type: 'hatchingPotions',
|
||||
key: 'White',
|
||||
text: t('questMayhemMistiflying1DropWhitePotion'),
|
||||
}, {
|
||||
type: 'gear',
|
||||
key: 'armor_special_roguishRainbowMessengerRobes',
|
||||
text: t('questMayhemMistiflying1DropArmor'),
|
||||
},
|
||||
],
|
||||
gp: 0,
|
||||
exp: 500,
|
||||
},
|
||||
},
|
||||
mayhemMistiflying2: {
|
||||
text: t('questMayhemMistiflying2Text'),
|
||||
notes: t('questMayhemMistiflying2Notes'),
|
||||
completion: t('questMayhemMistiflying2Completion'),
|
||||
previous: 'mayhemMistiflying1',
|
||||
value: 4,
|
||||
goldValue: 300,
|
||||
category: 'gold',
|
||||
collect: {
|
||||
mistifly1: {
|
||||
text: t('questMayhemMistiflying2CollectRedMistiflies'),
|
||||
count: 25,
|
||||
},
|
||||
mistifly2: {
|
||||
text: t('questMayhemMistiflying2CollectBlueMistiflies'),
|
||||
count: 15,
|
||||
},
|
||||
mistifly3: {
|
||||
text: t('questMayhemMistiflying2CollectGreenMistiflies'),
|
||||
count: 10,
|
||||
},
|
||||
},
|
||||
drop: {
|
||||
items: [
|
||||
{
|
||||
type: 'gear',
|
||||
key: 'head_special_roguishRainbowMessengerHood',
|
||||
text: t('questMayhemMistiflying2DropHeadgear'),
|
||||
},
|
||||
],
|
||||
gp: 0,
|
||||
exp: 75,
|
||||
},
|
||||
},
|
||||
mayhemMistiflying3: {
|
||||
text: t('questMayhemMistiflying3Text'),
|
||||
notes: t('questMayhemMistiflying3Notes'),
|
||||
completion: t('questMayhemMistiflying3Completion'),
|
||||
previous: 'mayhemMistiflying2',
|
||||
value: 4,
|
||||
goldValue: 400,
|
||||
category: 'gold',
|
||||
boss: {
|
||||
name: t('questMayhemMistiflying3Boss'),
|
||||
hp: 1000,
|
||||
str: 2,
|
||||
},
|
||||
drop: {
|
||||
items: [
|
||||
{
|
||||
type: 'food',
|
||||
key: 'CottonCandyPink',
|
||||
text: t('questMayhemMistiflying3DropPinkCottonCandy'),
|
||||
}, {
|
||||
type: 'food',
|
||||
key: 'CottonCandyPink',
|
||||
text: t('questMayhemMistiflying3DropPinkCottonCandy'),
|
||||
}, {
|
||||
type: 'food',
|
||||
key: 'CottonCandyPink',
|
||||
text: t('questMayhemMistiflying3DropPinkCottonCandy'),
|
||||
}, {
|
||||
type: 'gear',
|
||||
key: 'weapon_special_roguishRainbowMessage',
|
||||
text: t('questMayhemMistiflying3DropWeapon'),
|
||||
}, {
|
||||
type: 'gear',
|
||||
key: 'shield_special_roguishRainbowMessage',
|
||||
text: t('questMayhemMistiflying3DropShield'),
|
||||
},
|
||||
],
|
||||
gp: 0,
|
||||
exp: 650,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
each(api.quests, (v, key) => {
|
||||
@@ -3095,6 +3242,74 @@ api.userDefaults = {
|
||||
],
|
||||
};
|
||||
|
||||
api.userDefaultsMobile = {
|
||||
habits: [
|
||||
{
|
||||
type: 'habit',
|
||||
text: t('defaultHabit4Text'),
|
||||
notes: t('defaultHabit4Notes'),
|
||||
up: true,
|
||||
down: false,
|
||||
attribute: 'per',
|
||||
}, {
|
||||
type: 'habit',
|
||||
text: t('defaultHabit5Text'),
|
||||
notes: t('defaultHabit5Notes'),
|
||||
up: false,
|
||||
down: true,
|
||||
attribute: 'con',
|
||||
},
|
||||
],
|
||||
dailys: [
|
||||
{
|
||||
type: 'daily',
|
||||
text: t('defaultDaily1Text'),
|
||||
attribute: 'per',
|
||||
},
|
||||
],
|
||||
todos: [
|
||||
{
|
||||
type: 'todo',
|
||||
text: t('defaultTodo1Text'),
|
||||
notes: t('defaultTodoNotes'),
|
||||
completed: false,
|
||||
attribute: 'int',
|
||||
},
|
||||
{
|
||||
type: 'todo',
|
||||
text: t('defaultTodo2Text'),
|
||||
notes: t('defaultTodo2Notes'),
|
||||
completed: false,
|
||||
attribute: 'int',
|
||||
},
|
||||
],
|
||||
rewards: [
|
||||
{
|
||||
type: 'reward',
|
||||
text: t('defaultReward2Text'),
|
||||
notes: t('defaultReward2Notes'),
|
||||
value: 20,
|
||||
},
|
||||
],
|
||||
tags: [
|
||||
{
|
||||
name: t('defaultTag1'),
|
||||
}, {
|
||||
name: t('defaultTag2'),
|
||||
}, {
|
||||
name: t('defaultTag3'),
|
||||
}, {
|
||||
name: t('defaultTag4'),
|
||||
}, {
|
||||
name: t('defaultTag5'),
|
||||
}, {
|
||||
name: t('defaultTag6'),
|
||||
}, {
|
||||
name: t('defaultTag7'),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
api.faq = faq;
|
||||
|
||||
api.loginIncentives = loginIncentives(api);
|
||||
|
||||
@@ -15,6 +15,7 @@ module.exports = function getLoginIncentives (api) {
|
||||
2: {
|
||||
rewardKey: ['background_purple'],
|
||||
reward: [api.backgrounds.incentiveBackgrounds],
|
||||
rewardName: 'incentiveBackgrounds', // i18n string
|
||||
assignReward: function assignReward (user) {
|
||||
user.purchased.background.blue = true;
|
||||
user.purchased.background.green = true;
|
||||
@@ -60,7 +61,7 @@ module.exports = function getLoginIncentives (api) {
|
||||
},
|
||||
},
|
||||
10: {
|
||||
rewardKey: ['Pet_HatchingPotion_Purple'],
|
||||
rewardKey: ['Pet_HatchingPotion_RoyalPurple'],
|
||||
reward: [api.hatchingPotions.RoyalPurple],
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.hatchingPotions.RoyalPurple) user.items.hatchingPotions.RoyalPurple = 0;
|
||||
@@ -95,7 +96,7 @@ module.exports = function getLoginIncentives (api) {
|
||||
},
|
||||
},
|
||||
26: {
|
||||
rewardKey: ['Pet_HatchingPotion_Purple'],
|
||||
rewardKey: ['Pet_HatchingPotion_RoyalPurple'],
|
||||
reward: [api.hatchingPotions.RoyalPurple],
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.hatchingPotions.RoyalPurple) user.items.hatchingPotions.RoyalPurple = 0;
|
||||
@@ -117,7 +118,7 @@ module.exports = function getLoginIncentives (api) {
|
||||
},
|
||||
},
|
||||
35: {
|
||||
rewardKey: ['Pet_HatchingPotion_Purple'],
|
||||
rewardKey: ['Pet_HatchingPotion_RoyalPurple'],
|
||||
reward: [api.hatchingPotions.RoyalPurple],
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.hatchingPotions.RoyalPurple) user.items.hatchingPotions.RoyalPurple = 0;
|
||||
@@ -133,7 +134,7 @@ module.exports = function getLoginIncentives (api) {
|
||||
},
|
||||
},
|
||||
45: {
|
||||
rewardKey: ['Pet_HatchingPotion_Purple'],
|
||||
rewardKey: ['Pet_HatchingPotion_RoyalPurple'],
|
||||
reward: [api.hatchingPotions.RoyalPurple],
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.hatchingPotions.RoyalPurple) user.items.hatchingPotions.RoyalPurple = 0;
|
||||
@@ -149,7 +150,7 @@ module.exports = function getLoginIncentives (api) {
|
||||
},
|
||||
},
|
||||
55: {
|
||||
rewardKey: ['Pet_HatchingPotion_Purple'],
|
||||
rewardKey: ['Pet_HatchingPotion_RoyalPurple'],
|
||||
reward: [api.hatchingPotions.RoyalPurple],
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.hatchingPotions.RoyalPurple) user.items.hatchingPotions.RoyalPurple = 0;
|
||||
@@ -164,7 +165,7 @@ module.exports = function getLoginIncentives (api) {
|
||||
},
|
||||
},
|
||||
65: {
|
||||
rewardKey: ['Pet_HatchingPotion_Purple'],
|
||||
rewardKey: ['Pet_HatchingPotion_RoyalPurple'],
|
||||
reward: [api.hatchingPotions.RoyalPurple],
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.hatchingPotions.RoyalPurple) user.items.hatchingPotions.RoyalPurple = 0;
|
||||
@@ -179,7 +180,7 @@ module.exports = function getLoginIncentives (api) {
|
||||
},
|
||||
},
|
||||
75: {
|
||||
rewardKey: ['Pet_HatchingPotion_Purple'],
|
||||
rewardKey: ['Pet_HatchingPotion_RoyalPurple'],
|
||||
reward: [api.hatchingPotions.RoyalPurple],
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.hatchingPotions.RoyalPurple) user.items.hatchingPotions.RoyalPurple = 0;
|
||||
@@ -194,7 +195,7 @@ module.exports = function getLoginIncentives (api) {
|
||||
},
|
||||
},
|
||||
85: {
|
||||
rewardKey: ['Pet_HatchingPotion_Purple'],
|
||||
rewardKey: ['Pet_HatchingPotion_RoyalPurple'],
|
||||
reward: [api.hatchingPotions.RoyalPurple],
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.hatchingPotions.RoyalPurple) user.items.hatchingPotions.RoyalPurple = 0;
|
||||
@@ -209,7 +210,7 @@ module.exports = function getLoginIncentives (api) {
|
||||
},
|
||||
},
|
||||
95: {
|
||||
rewardKey: ['Pet_HatchingPotion_Purple'],
|
||||
rewardKey: ['Pet_HatchingPotion_RoyalPurple'],
|
||||
reward: [api.hatchingPotions.RoyalPurple],
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.hatchingPotions.RoyalPurple) user.items.hatchingPotions.RoyalPurple = 0;
|
||||
@@ -224,9 +225,370 @@ module.exports = function getLoginIncentives (api) {
|
||||
user.items.food.Saddle += 1;
|
||||
},
|
||||
},
|
||||
105: {
|
||||
rewardKey: ['Pet_HatchingPotion_RoyalPurple'],
|
||||
reward: [api.hatchingPotions.RoyalPurple],
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.hatchingPotions.RoyalPurple) user.items.hatchingPotions.RoyalPurple = 0;
|
||||
user.items.hatchingPotions.RoyalPurple += 1;
|
||||
},
|
||||
},
|
||||
110: {
|
||||
rewardKey: ['Pet_Egg_Cactus', 'Pet_Egg_Dragon', 'Pet_Egg_Wolf'],
|
||||
reward: [api.eggs.BearCub, api.eggs.Cactus, api.eggs.Dragon, api.eggs.FlyingPig, api.eggs.Fox, api.eggs.LionCub, api.eggs.PandaCub, api.eggs.TigerCub, api.eggs.Wolf],
|
||||
rewardName: 'oneOfAllPetEggs',
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.eggs.BearCub) user.items.eggs.BearCub = 0;
|
||||
user.items.eggs.BearCub += 1;
|
||||
if (!user.items.eggs.Cactus) user.items.eggs.Cactus = 0;
|
||||
user.items.eggs.Cactus += 1;
|
||||
if (!user.items.eggs.Dragon) user.items.eggs.Dragon = 0;
|
||||
user.items.eggs.Dragon += 1;
|
||||
if (!user.items.eggs.FlyingPig) user.items.eggs.FlyingPig = 0;
|
||||
user.items.eggs.FlyingPig += 1;
|
||||
if (!user.items.eggs.Fox) user.items.eggs.Fox = 0;
|
||||
user.items.eggs.Fox += 1;
|
||||
if (!user.items.eggs.LionCub) user.items.eggs.LionCub = 0;
|
||||
user.items.eggs.LionCub += 1;
|
||||
if (!user.items.eggs.PandaCub) user.items.eggs.PandaCub = 0;
|
||||
user.items.eggs.PandaCub += 1;
|
||||
if (!user.items.eggs.TigerCub) user.items.eggs.TigerCub = 0;
|
||||
user.items.eggs.TigerCub += 1;
|
||||
if (!user.items.eggs.Wolf) user.items.eggs.Wolf = 0;
|
||||
user.items.eggs.Wolf += 1;
|
||||
},
|
||||
},
|
||||
115: {
|
||||
rewardKey: ['Pet_HatchingPotion_RoyalPurple'],
|
||||
reward: [api.hatchingPotions.RoyalPurple],
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.hatchingPotions.RoyalPurple) user.items.hatchingPotions.RoyalPurple = 0;
|
||||
user.items.hatchingPotions.RoyalPurple += 1;
|
||||
},
|
||||
},
|
||||
120: {
|
||||
rewardKey: ['Pet_HatchingPotion_Base', 'Pet_HatchingPotion_Red', 'Pet_HatchingPotion_Golden'],
|
||||
reward: [api.hatchingPotions.Base, api.hatchingPotions.CottonCandyBlue, api.hatchingPotions.CottonCandyPink, api.hatchingPotions.Desert, api.hatchingPotions.Golden, api.hatchingPotions.Red, api.hatchingPotions.Shade, api.hatchingPotions.Skeleton, api.hatchingPotions.White, api.hatchingPotions.Zombie],
|
||||
rewardName: 'oneOfAllHatchingPotions',
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.hatchingPotions.Base) user.items.hatchingPotions.Base = 0;
|
||||
user.items.hatchingPotions.Base += 1;
|
||||
if (!user.items.hatchingPotions.CottonCandyBlue) user.items.hatchingPotions.CottonCandyBlue = 0;
|
||||
user.items.hatchingPotions.CottonCandyBlue += 1;
|
||||
if (!user.items.hatchingPotions.CottonCandyPink) user.items.hatchingPotions.CottonCandyPink = 0;
|
||||
user.items.hatchingPotions.CottonCandyPink += 1;
|
||||
if (!user.items.hatchingPotions.Desert) user.items.hatchingPotions.Desert = 0;
|
||||
user.items.hatchingPotions.Desert += 1;
|
||||
if (!user.items.hatchingPotions.Golden) user.items.hatchingPotions.Golden = 0;
|
||||
user.items.hatchingPotions.Golden += 1;
|
||||
if (!user.items.hatchingPotions.Red) user.items.hatchingPotions.Red = 0;
|
||||
user.items.hatchingPotions.Red += 1;
|
||||
if (!user.items.hatchingPotions.Shade) user.items.hatchingPotions.Shade = 0;
|
||||
user.items.hatchingPotions.Shade += 1;
|
||||
if (!user.items.hatchingPotions.Skeleton) user.items.hatchingPotions.Skeleton = 0;
|
||||
user.items.hatchingPotions.Skeleton += 1;
|
||||
if (!user.items.hatchingPotions.White) user.items.hatchingPotions.White = 0;
|
||||
user.items.hatchingPotions.White += 1;
|
||||
if (!user.items.hatchingPotions.Zombie) user.items.hatchingPotions.Zombie = 0;
|
||||
user.items.hatchingPotions.Zombie += 1;
|
||||
},
|
||||
},
|
||||
125: {
|
||||
rewardKey: ['Pet_HatchingPotion_RoyalPurple'],
|
||||
reward: [api.hatchingPotions.RoyalPurple],
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.hatchingPotions.RoyalPurple) user.items.hatchingPotions.RoyalPurple = 0;
|
||||
user.items.hatchingPotions.RoyalPurple += 1;
|
||||
},
|
||||
},
|
||||
130: {
|
||||
rewardKey: ['Pet_Food_Meat', 'Pet_Food_Potatoe', 'Pet_Food_Milk'],
|
||||
reward: [api.food.Meat, api.food.CottonCandyBlue, api.food.CottonCandyPink, api.food.Potatoe, api.food.Honey, api.food.Strawberry, api.food.Chocolate, api.food.Fish, api.food.Milk, api.food.RottenMeat],
|
||||
rewardName: 'threeOfEachFood',
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.food.Meat) user.items.food.Meat = 0;
|
||||
user.items.food.Meat += 3;
|
||||
if (!user.items.food.CottonCandyBlue) user.items.food.CottonCandyBlue = 0;
|
||||
user.items.food.CottonCandyBlue += 3;
|
||||
if (!user.items.food.CottonCandyPink) user.items.food.CottonCandyPink = 0;
|
||||
user.items.food.CottonCandyPink += 3;
|
||||
if (!user.items.food.Potatoe) user.items.food.Potatoe = 0;
|
||||
user.items.food.Potatoe += 3;
|
||||
if (!user.items.food.Honey) user.items.food.Honey = 0;
|
||||
user.items.food.Honey += 3;
|
||||
if (!user.items.food.Strawberry) user.items.food.Strawberry = 0;
|
||||
user.items.food.Strawberry += 3;
|
||||
if (!user.items.food.Chocolate) user.items.food.Chocolate = 0;
|
||||
user.items.food.Chocolate += 3;
|
||||
if (!user.items.food.Fish) user.items.food.Fish = 0;
|
||||
user.items.food.Fish += 3;
|
||||
if (!user.items.food.Milk) user.items.food.Milk = 0;
|
||||
user.items.food.Milk += 3;
|
||||
if (!user.items.food.RottenMeat) user.items.food.RottenMeat = 0;
|
||||
user.items.food.RottenMeat += 3;
|
||||
},
|
||||
},
|
||||
135: {
|
||||
rewardKey: ['Pet_HatchingPotion_RoyalPurple'],
|
||||
reward: [api.hatchingPotions.RoyalPurple],
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.hatchingPotions.RoyalPurple) user.items.hatchingPotions.RoyalPurple = 0;
|
||||
user.items.hatchingPotions.RoyalPurple += 1;
|
||||
},
|
||||
},
|
||||
140: {
|
||||
rewardKey: ['shop_weapon_special_skeletonKey', 'shop_shield_special_lootBag'],
|
||||
reward: [api.gear.flat.weapon_special_skeletonKey, api.gear.flat.shield_special_lootBag],
|
||||
assignReward: function assignReward (user) {
|
||||
user.items.gear.owned.weapon_special_skeletonKey = true; // eslint-disable-line camelcase
|
||||
user.items.gear.owned.shield_special_lootBag = true; // eslint-disable-line camelcase
|
||||
},
|
||||
},
|
||||
145: {
|
||||
rewardKey: ['Pet_HatchingPotion_RoyalPurple'],
|
||||
reward: [api.hatchingPotions.RoyalPurple],
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.hatchingPotions.RoyalPurple) user.items.hatchingPotions.RoyalPurple = 0;
|
||||
user.items.hatchingPotions.RoyalPurple += 1;
|
||||
},
|
||||
},
|
||||
150: {
|
||||
rewardKey: ['shop_head_special_clandestineCowl', 'shop_armor_special_sneakthiefRobes'],
|
||||
reward: [api.gear.flat.head_special_clandestineCowl, api.gear.flat.armor_special_sneakthiefRobes],
|
||||
assignReward: function assignReward (user) {
|
||||
user.items.gear.owned.head_special_clandestineCowl = true; // eslint-disable-line camelcase
|
||||
user.items.gear.owned.armor_special_sneakthiefRobes = true; // eslint-disable-line camelcase
|
||||
},
|
||||
},
|
||||
160: {
|
||||
rewardKey: ['Pet_HatchingPotion_RoyalPurple'],
|
||||
reward: [api.hatchingPotions.RoyalPurple],
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.hatchingPotions.RoyalPurple) user.items.hatchingPotions.RoyalPurple = 0;
|
||||
user.items.hatchingPotions.RoyalPurple += 1;
|
||||
},
|
||||
},
|
||||
170: {
|
||||
rewardKey: ['shop_head_special_snowSovereignCrown', 'shop_armor_special_snowSovereignRobes'],
|
||||
reward: [api.gear.flat.head_special_snowSovereignCrown, api.gear.flat.armor_special_snowSovereignRobes],
|
||||
assignReward: function assignReward (user) {
|
||||
user.items.gear.owned.head_special_snowSovereignCrown = true; // eslint-disable-line camelcase
|
||||
user.items.gear.owned.armor_special_snowSovereignRobes = true; // eslint-disable-line camelcase
|
||||
},
|
||||
},
|
||||
180: {
|
||||
rewardKey: ['Pet_HatchingPotion_RoyalPurple'],
|
||||
reward: [api.hatchingPotions.RoyalPurple],
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.hatchingPotions.RoyalPurple) user.items.hatchingPotions.RoyalPurple = 0;
|
||||
user.items.hatchingPotions.RoyalPurple += 1;
|
||||
},
|
||||
},
|
||||
190: {
|
||||
rewardKey: ['shop_shield_special_wintryMirror', 'shop_back_special_snowdriftVeil'],
|
||||
reward: [api.gear.flat.shield_special_wintryMirror, api.gear.flat.back_special_snowdriftVeil],
|
||||
assignReward: function assignReward (user) {
|
||||
user.items.gear.owned.shield_special_wintryMirror = true; // eslint-disable-line camelcase
|
||||
user.items.gear.owned.back_special_snowdriftVeil = true; // eslint-disable-line camelcase
|
||||
},
|
||||
},
|
||||
200: {
|
||||
rewardKey: ['Pet_HatchingPotion_RoyalPurple'],
|
||||
reward: [api.hatchingPotions.RoyalPurple],
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.hatchingPotions.RoyalPurple) user.items.hatchingPotions.RoyalPurple = 0;
|
||||
user.items.hatchingPotions.RoyalPurple += 1;
|
||||
},
|
||||
},
|
||||
220: {
|
||||
rewardKey: ['Pet_Food_Saddle'],
|
||||
reward: [api.food.Saddle],
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.food.Saddle) user.items.food.Saddle = 0;
|
||||
user.items.food.Saddle += 1;
|
||||
},
|
||||
},
|
||||
240: {
|
||||
rewardKey: ['shop_weapon_special_nomadsScimitar', 'shop_armor_special_nomadsCuirass'],
|
||||
reward: [api.gear.flat.weapon_special_nomadsScimitar, api.gear.flat.armor_special_nomadsCuirass],
|
||||
assignReward: function assignReward (user) {
|
||||
user.items.gear.owned.weapon_special_nomadsScimitar = true; // eslint-disable-line camelcase
|
||||
user.items.gear.owned.armor_special_nomadsCuirass = true; // eslint-disable-line camelcase
|
||||
},
|
||||
},
|
||||
260: {
|
||||
rewardKey: ['shop_head_special_spikedHelm'],
|
||||
reward: [api.gear.flat.head_special_spikedHelm],
|
||||
assignReward: function assignReward (user) {
|
||||
user.items.gear.owned.head_special_spikedHelm = true; // eslint-disable-line camelcase
|
||||
},
|
||||
},
|
||||
280: {
|
||||
rewardKey: ['Pet_Food_Meat', 'Pet_Food_Potatoe', 'Pet_Food_Milk'],
|
||||
reward: [api.food.Meat, api.food.CottonCandyBlue, api.food.CottonCandyPink, api.food.Potatoe, api.food.Honey, api.food.Strawberry, api.food.Chocolate, api.food.Fish, api.food.Milk, api.food.RottenMeat],
|
||||
rewardName: 'threeOfEachFood',
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.food.Meat) user.items.food.Meat = 0;
|
||||
user.items.food.Meat += 3;
|
||||
if (!user.items.food.CottonCandyBlue) user.items.food.CottonCandyBlue = 0;
|
||||
user.items.food.CottonCandyBlue += 3;
|
||||
if (!user.items.food.CottonCandyPink) user.items.food.CottonCandyPink = 0;
|
||||
user.items.food.CottonCandyPink += 3;
|
||||
if (!user.items.food.Potatoe) user.items.food.Potatoe = 0;
|
||||
user.items.food.Potatoe += 3;
|
||||
if (!user.items.food.Honey) user.items.food.Honey = 0;
|
||||
user.items.food.Honey += 3;
|
||||
if (!user.items.food.Strawberry) user.items.food.Strawberry = 0;
|
||||
user.items.food.Strawberry += 3;
|
||||
if (!user.items.food.Chocolate) user.items.food.Chocolate = 0;
|
||||
user.items.food.Chocolate += 3;
|
||||
if (!user.items.food.Fish) user.items.food.Fish = 0;
|
||||
user.items.food.Fish += 3;
|
||||
if (!user.items.food.Milk) user.items.food.Milk = 0;
|
||||
user.items.food.Milk += 3;
|
||||
if (!user.items.food.RottenMeat) user.items.food.RottenMeat = 0;
|
||||
user.items.food.RottenMeat += 3;
|
||||
},
|
||||
},
|
||||
300: {
|
||||
rewardKey: ['Pet_Egg_Cactus', 'Pet_Egg_Dragon', 'Pet_Egg_Wolf'],
|
||||
reward: [api.eggs.BearCub, api.eggs.Cactus, api.eggs.Dragon, api.eggs.FlyingPig, api.eggs.Fox, api.eggs.LionCub, api.eggs.PandaCub, api.eggs.TigerCub, api.eggs.Wolf],
|
||||
rewardName: 'twoOfAllPetEggs',
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.eggs.BearCub) user.items.eggs.BearCub = 0;
|
||||
user.items.eggs.BearCub += 2;
|
||||
if (!user.items.eggs.Cactus) user.items.eggs.Cactus = 0;
|
||||
user.items.eggs.Cactus += 2;
|
||||
if (!user.items.eggs.Dragon) user.items.eggs.Dragon = 0;
|
||||
user.items.eggs.Dragon += 2;
|
||||
if (!user.items.eggs.FlyingPig) user.items.eggs.FlyingPig = 0;
|
||||
user.items.eggs.FlyingPig += 2;
|
||||
if (!user.items.eggs.Fox) user.items.eggs.Fox = 0;
|
||||
user.items.eggs.Fox += 2;
|
||||
if (!user.items.eggs.LionCub) user.items.eggs.LionCub = 0;
|
||||
user.items.eggs.LionCub += 2;
|
||||
if (!user.items.eggs.PandaCub) user.items.eggs.PandaCub = 0;
|
||||
user.items.eggs.PandaCub += 2;
|
||||
if (!user.items.eggs.TigerCub) user.items.eggs.TigerCub = 0;
|
||||
user.items.eggs.TigerCub += 2;
|
||||
if (!user.items.eggs.Wolf) user.items.eggs.Wolf = 0;
|
||||
user.items.eggs.Wolf += 2;
|
||||
},
|
||||
},
|
||||
320: {
|
||||
rewardKey: ['shop_head_special_dandyHat'],
|
||||
reward: [api.gear.flat.head_special_dandyHat],
|
||||
assignReward: function assignReward (user) {
|
||||
user.items.gear.owned.head_special_dandyHat = true; // eslint-disable-line camelcase
|
||||
},
|
||||
},
|
||||
340: {
|
||||
rewardKey: ['shop_weapon_special_fencingFoil', 'shop_armor_special_dandySuit'],
|
||||
reward: [api.gear.flat.weapon_special_fencingFoil, api.gear.flat.armor_special_dandySuit],
|
||||
assignReward: function assignReward (user) {
|
||||
user.items.gear.owned.weapon_special_fencingFoil = true; // eslint-disable-line camelcase
|
||||
user.items.gear.owned.armor_special_dandySuit = true; // eslint-disable-line camelcase
|
||||
},
|
||||
},
|
||||
360: {
|
||||
rewardKey: ['Pet_Food_Saddle'],
|
||||
reward: [api.food.Saddle],
|
||||
rewardName: 'twoSaddles',
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.food.Saddle) user.items.food.Saddle = 0;
|
||||
user.items.food.Saddle += 2;
|
||||
},
|
||||
},
|
||||
380: {
|
||||
rewardKey: ['Pet_Egg_Cactus', 'Pet_Egg_Dragon', 'Pet_Egg_Wolf'],
|
||||
reward: [api.eggs.BearCub, api.eggs.Cactus, api.eggs.Dragon, api.eggs.FlyingPig, api.eggs.Fox, api.eggs.LionCub, api.eggs.PandaCub, api.eggs.TigerCub, api.eggs.Wolf],
|
||||
rewardName: 'threeOfAllPetEggs',
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.eggs.BearCub) user.items.eggs.BearCub = 0;
|
||||
user.items.eggs.BearCub += 3;
|
||||
if (!user.items.eggs.Cactus) user.items.eggs.Cactus = 0;
|
||||
user.items.eggs.Cactus += 3;
|
||||
if (!user.items.eggs.Dragon) user.items.eggs.Dragon = 0;
|
||||
user.items.eggs.Dragon += 3;
|
||||
if (!user.items.eggs.FlyingPig) user.items.eggs.FlyingPig = 0;
|
||||
user.items.eggs.FlyingPig += 3;
|
||||
if (!user.items.eggs.Fox) user.items.eggs.Fox = 0;
|
||||
user.items.eggs.Fox += 3;
|
||||
if (!user.items.eggs.LionCub) user.items.eggs.LionCub = 0;
|
||||
user.items.eggs.LionCub += 3;
|
||||
if (!user.items.eggs.PandaCub) user.items.eggs.PandaCub = 0;
|
||||
user.items.eggs.PandaCub += 3;
|
||||
if (!user.items.eggs.TigerCub) user.items.eggs.TigerCub = 0;
|
||||
user.items.eggs.TigerCub += 3;
|
||||
if (!user.items.eggs.Wolf) user.items.eggs.Wolf = 0;
|
||||
user.items.eggs.Wolf += 3;
|
||||
},
|
||||
},
|
||||
400: {
|
||||
rewardKey: ['Pet_Food_Meat', 'Pet_Food_Potatoe', 'Pet_Food_Milk'],
|
||||
reward: [api.food.Meat, api.food.CottonCandyBlue, api.food.CottonCandyPink, api.food.Potatoe, api.food.Honey, api.food.Strawberry, api.food.Chocolate, api.food.Fish, api.food.Milk, api.food.RottenMeat],
|
||||
rewardName: 'fourOfEachFood',
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.food.Meat) user.items.food.Meat = 0;
|
||||
user.items.food.Meat += 4;
|
||||
if (!user.items.food.CottonCandyBlue) user.items.food.CottonCandyBlue = 0;
|
||||
user.items.food.CottonCandyBlue += 4;
|
||||
if (!user.items.food.CottonCandyPink) user.items.food.CottonCandyPink = 0;
|
||||
user.items.food.CottonCandyPink += 4;
|
||||
if (!user.items.food.Potatoe) user.items.food.Potatoe = 0;
|
||||
user.items.food.Potatoe += 4;
|
||||
if (!user.items.food.Honey) user.items.food.Honey = 0;
|
||||
user.items.food.Honey += 4;
|
||||
if (!user.items.food.Strawberry) user.items.food.Strawberry = 0;
|
||||
user.items.food.Strawberry += 4;
|
||||
if (!user.items.food.Chocolate) user.items.food.Chocolate = 0;
|
||||
user.items.food.Chocolate += 4;
|
||||
if (!user.items.food.Fish) user.items.food.Fish = 0;
|
||||
user.items.food.Fish += 4;
|
||||
if (!user.items.food.Milk) user.items.food.Milk = 0;
|
||||
user.items.food.Milk += 4;
|
||||
if (!user.items.food.RottenMeat) user.items.food.RottenMeat = 0;
|
||||
user.items.food.RottenMeat += 4;
|
||||
},
|
||||
},
|
||||
425: {
|
||||
rewardKey: ['Pet_Food_Saddle'],
|
||||
reward: [api.food.Saddle],
|
||||
rewardName: 'threeSaddles',
|
||||
assignReward: function assignReward (user) {
|
||||
if (!user.items.food.Saddle) user.items.food.Saddle = 0;
|
||||
user.items.food.Saddle += 3;
|
||||
},
|
||||
},
|
||||
450: {
|
||||
rewardKey: ['shop_weapon_special_tachi', 'shop_armor_special_samuraiArmor'],
|
||||
reward: [api.gear.flat.weapon_special_tachi, api.gear.flat.armor_special_samuraiArmor],
|
||||
assignReward: function assignReward (user) {
|
||||
user.items.gear.owned.weapon_special_tachi = true; // eslint-disable-line camelcase
|
||||
user.items.gear.owned.armor_special_samuraiArmor = true; // eslint-disable-line camelcase
|
||||
},
|
||||
},
|
||||
475: {
|
||||
rewardKey: ['shop_head_special_kabuto', 'shop_shield_special_wakizashi'],
|
||||
reward: [api.gear.flat.head_special_kabuto, api.gear.flat.shield_special_wakizashi],
|
||||
assignReward: function assignReward (user) {
|
||||
user.items.gear.owned.head_special_kabuto = true; // eslint-disable-line camelcase
|
||||
user.items.gear.owned.shield_special_wakizashi = true; // eslint-disable-line camelcase
|
||||
},
|
||||
},
|
||||
500: {
|
||||
rewardKey: ['achievement-royally-loyal2x'],
|
||||
reward: [api.achievements.royallyLoyal],
|
||||
rewardName: 'incentiveAchievement',
|
||||
assignReward: function assignReward (user) {
|
||||
user.achievements.royallyLoyal = true; // eslint-disable-line camelcase
|
||||
},
|
||||
},
|
||||
};
|
||||
// When the final check-in prize is added here, change checkinReceivedAllRewardsMessage in website/common/locales/en/loginIncentives.json
|
||||
// to say "You have received the final Check-In prize!". Confirm the message with Lemoness first.
|
||||
|
||||
// Add refence link to next reward and add filler days so we have a map to refernce the next reward from any day
|
||||
// Add reference link to next reward and add filler days so we have a map to reference the next reward from any day
|
||||
// We could also, use a list, but then we would be cloning each of the rewards.
|
||||
// Create a new array if we want the loginIncentives to be immutable in the future
|
||||
let nextRewardKey;
|
||||
|
||||
@@ -150,6 +150,14 @@ let mysterySets = {
|
||||
start: '2017-02-21',
|
||||
end: '2017-03-02',
|
||||
},
|
||||
201703: {
|
||||
start: '2017-03-23',
|
||||
end: '2017-04-02',
|
||||
},
|
||||
201704: {
|
||||
start: '2017-04-25',
|
||||
end: '2017-05-02',
|
||||
},
|
||||
301404: {
|
||||
start: '3014-03-24',
|
||||
end: '3014-04-02',
|
||||
|
||||
@@ -67,6 +67,7 @@ let specialPets = {
|
||||
'Lion-Veteran': 'veteranLion',
|
||||
'Gryphon-RoyalPurple': 'royalPurpleGryphon',
|
||||
'JackOLantern-Ghost': 'ghostJackolantern',
|
||||
'Jackalope-RoyalPurple': 'royalPurpleJackalope',
|
||||
};
|
||||
|
||||
let specialMounts = {
|
||||
|
||||
@@ -3,35 +3,47 @@ import each from 'lodash/each';
|
||||
|
||||
let subscriptionBlocks = {
|
||||
basic_earned: {
|
||||
target: 'user',
|
||||
canSubscribe: true,
|
||||
months: 1,
|
||||
price: 5,
|
||||
},
|
||||
basic_3mo: {
|
||||
target: 'user',
|
||||
canSubscribe: true,
|
||||
months: 3,
|
||||
price: 15,
|
||||
},
|
||||
basic_6mo: {
|
||||
target: 'user',
|
||||
canSubscribe: true,
|
||||
months: 6,
|
||||
price: 30,
|
||||
},
|
||||
google_6mo: {
|
||||
target: 'user',
|
||||
canSubscribe: true,
|
||||
months: 6,
|
||||
price: 24,
|
||||
discount: true,
|
||||
original: 30,
|
||||
},
|
||||
basic_12mo: {
|
||||
target: 'user',
|
||||
canSubscribe: true,
|
||||
months: 12,
|
||||
price: 48,
|
||||
},
|
||||
group_monthly: {
|
||||
type: 'group',
|
||||
target: 'group',
|
||||
canSubscribe: true,
|
||||
months: 1,
|
||||
price: 9,
|
||||
quantity: 3, // Default quantity for Stripe - The same as having 3 user subscriptions
|
||||
},
|
||||
group_plan_auto: {
|
||||
type: 'group',
|
||||
target: 'user',
|
||||
canSubscribe: false,
|
||||
months: 0,
|
||||
price: 0,
|
||||
quantity: 1,
|
||||
|
||||
@@ -32,8 +32,8 @@ function sanitizeOptions (o) {
|
||||
let dayStart = !Number.isNaN(ref) && ref >= 0 && ref <= 24 ? ref : 0;
|
||||
|
||||
let timezoneOffset;
|
||||
let timezoneOffsetDefault = Number(moment().zone());
|
||||
if (Number.isFinite(o.timezoneOffsetOverride)) {
|
||||
let timezoneOffsetDefault = Number(moment().utcOffset());
|
||||
if (_.isFinite(o.timezoneOffsetOverride)) {
|
||||
timezoneOffset = Number(o.timezoneOffsetOverride);
|
||||
} else if (Number.isFinite(o.timezoneOffset)) {
|
||||
timezoneOffset = Number(o.timezoneOffset);
|
||||
@@ -45,7 +45,7 @@ function sanitizeOptions (o) {
|
||||
timezoneOffset = timezoneOffsetDefault;
|
||||
}
|
||||
|
||||
let now = o.now ? moment(o.now).zone(timezoneOffset) : moment().zone(timezoneOffset);
|
||||
let now = o.now ? moment(o.now).utcOffset(timezoneOffset) : moment().utcOffset(timezoneOffset);
|
||||
|
||||
// return a new object, we don't want to add "now" to user object
|
||||
return {
|
||||
@@ -92,13 +92,16 @@ export function daysSince (yesterday, options = {}) {
|
||||
Should the user do this task on this date, given the task's repeat options and user.preferences.dayStart?
|
||||
*/
|
||||
|
||||
export function shouldDo (day, dailyTask) {
|
||||
export function shouldDo (day, dailyTask, options = {}) {
|
||||
if (dailyTask.type !== 'daily') {
|
||||
return false;
|
||||
}
|
||||
|
||||
day = moment(day).startOf('day').toDate();
|
||||
let startDate = moment(dailyTask.startDate).startOf('day').toDate();
|
||||
let o = sanitizeOptions(options);
|
||||
let startOfDayWithCDSTime = startOfDay(_.defaults({ now: day }, o));
|
||||
// The time portion of the Start Date is never visible to or modifiable by the user so we must ignore it.
|
||||
// Therefore, we must also ignore the time portion of the user's day start (startOfDayWithCDSTime), otherwise the date comparison will be wrong for some times.
|
||||
// NB: The user's day start date has already been converted to the PREVIOUS day's date if the time portion was before CDS.
|
||||
let startDate = moment(dailyTask.startDate).utcOffset(o.timezoneOffset);
|
||||
|
||||
let daysOfTheWeek = [];
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ module.exports = function updateStats (user, stats, req = {}, analytics) {
|
||||
};
|
||||
}
|
||||
});
|
||||
if (!user.flags.rebirthEnabled && (user.stats.lvl >= 50 || user.achievements.beastMaster)) {
|
||||
if (!user.flags.rebirthEnabled && user.stats.lvl >= 50) {
|
||||
user.addNotification('REBIRTH_ENABLED');
|
||||
user.flags.rebirthEnabled = true;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import {
|
||||
LARGE_GROUP_COUNT_MESSAGE_CUTOFF,
|
||||
SUPPORTED_SOCIAL_NETWORKS,
|
||||
GUILDS_PER_PAGE,
|
||||
PARTY_LIMIT_MEMBERS,
|
||||
} from './constants';
|
||||
|
||||
api.constants = {
|
||||
@@ -34,6 +35,7 @@ api.constants = {
|
||||
LARGE_GROUP_COUNT_MESSAGE_CUTOFF,
|
||||
SUPPORTED_SOCIAL_NETWORKS,
|
||||
GUILDS_PER_PAGE,
|
||||
PARTY_LIMIT_MEMBERS,
|
||||
};
|
||||
// TODO Move these under api.constants
|
||||
api.maxLevel = MAX_LEVEL;
|
||||
|
||||
@@ -179,6 +179,7 @@ function _getBasicAchievements (user, language) {
|
||||
|
||||
_addSimple(result, user, {path: 'partyUp', language});
|
||||
_addSimple(result, user, {path: 'partyOn', language});
|
||||
_addSimple(result, user, {path: 'royallyLoyal', language});
|
||||
|
||||
_addSimpleWithMasterCount(result, user, {path: 'beastMaster', language});
|
||||
_addSimpleWithMasterCount(result, user, {path: 'mountMaster', language});
|
||||
|
||||
@@ -25,7 +25,7 @@ shops.getMarketCategories = function getMarket (user, language) {
|
||||
let eggsCategory = {
|
||||
identifier: 'eggs',
|
||||
text: i18n.t('eggs', language),
|
||||
notes: i18n.t('dropsExplanation', language),
|
||||
notes: i18n.t('dropsExplanationEggs', language),
|
||||
};
|
||||
|
||||
eggsCategory.items = sortBy(values(content.questEggs)
|
||||
@@ -149,7 +149,7 @@ shops.getQuestShopCategories = function getQuestShopCategories (user, language)
|
||||
|
||||
shops.getTimeTravelersCategories = function getTimeTravelersCategories (user, language) {
|
||||
let categories = [];
|
||||
let stable = {pets: 'Pet-', mounts: 'Mount_Head_'};
|
||||
let stable = {pets: 'Pet-', mounts: 'Mount_Icon_'};
|
||||
for (let type in stable) {
|
||||
if (stable.hasOwnProperty(type)) {
|
||||
let category = {
|
||||
|
||||
@@ -7,15 +7,39 @@ import splitWhitespace from '../libs/splitWhitespace';
|
||||
import { capByLevel } from '../statHelpers';
|
||||
import {
|
||||
NotAuthorized,
|
||||
BadRequest,
|
||||
} from '../libs/errors';
|
||||
|
||||
function resetClass (user, req = {}) {
|
||||
if (user.preferences.disableClasses) {
|
||||
user.preferences.disableClasses = false;
|
||||
user.preferences.autoAllocate = false;
|
||||
} else {
|
||||
if (user.balance < 0.75) throw new NotAuthorized(i18n.t('notEnoughGems', req.language));
|
||||
user.balance -= 0.75;
|
||||
}
|
||||
|
||||
user.stats.str = 0;
|
||||
user.stats.con = 0;
|
||||
user.stats.per = 0;
|
||||
user.stats.int = 0;
|
||||
user.stats.points = capByLevel(user.stats.lvl);
|
||||
user.flags.classSelected = false;
|
||||
}
|
||||
|
||||
module.exports = function changeClass (user, req = {}, analytics) {
|
||||
let klass = get(req, 'query.class');
|
||||
|
||||
// user.flags.classSelected is set to false after the user paid the 3 gems
|
||||
if (user.stats.lvl < 10) {
|
||||
throw new NotAuthorized(i18n.t('lvl10ChangeClass', req.language));
|
||||
} else if (!user.flags.classSelected && (klass === 'warrior' || klass === 'rogue' || klass === 'wizard' || klass === 'healer')) {
|
||||
} else if (!klass) {
|
||||
// if no class is specified, reset points and set user.flags.classSelected to false. User will have paid 3 gems and will be prompted to select class.
|
||||
resetClass(user, req);
|
||||
} else if (klass === 'warrior' || klass === 'rogue' || klass === 'wizard' || klass === 'healer') {
|
||||
if (user.flags.classSelected) {
|
||||
resetClass(user, req);
|
||||
}
|
||||
|
||||
user.stats.class = klass;
|
||||
user.flags.classSelected = true;
|
||||
|
||||
@@ -56,22 +80,9 @@ module.exports = function changeClass (user, req = {}, analytics) {
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (user.preferences.disableClasses) {
|
||||
user.preferences.disableClasses = false;
|
||||
user.preferences.autoAllocate = false;
|
||||
} else {
|
||||
if (user.balance < 0.75) throw new NotAuthorized(i18n.t('notEnoughGems', req.language));
|
||||
user.balance -= 0.75;
|
||||
}
|
||||
|
||||
user.stats.str = 0;
|
||||
user.stats.con = 0;
|
||||
user.stats.per = 0;
|
||||
user.stats.int = 0;
|
||||
user.stats.points = capByLevel(user.stats.lvl);
|
||||
user.flags.classSelected = false;
|
||||
// if invalid class is specified, throw an error.
|
||||
throw new BadRequest(i18n.t('invalidClass', req.language));
|
||||
}
|
||||
|
||||
return [
|
||||
pick(user, splitWhitespace('stats flags items preferences')),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user