mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 14:17:22 +01:00
Merge branch 'develop' into quest-refactors
This commit is contained in:
@@ -485,6 +485,16 @@ const backgrounds = {
|
||||
orange_grove: { },
|
||||
iridescent_clouds: { },
|
||||
},
|
||||
backgrounds032022: {
|
||||
animals_den: { },
|
||||
brick_wall_with_ivy: { },
|
||||
flowering_prairie: { },
|
||||
},
|
||||
backgrounds042022: {
|
||||
blossoming_trees: { },
|
||||
flower_shop: { },
|
||||
springtime_lake: { },
|
||||
},
|
||||
timeTravelBackgrounds: {
|
||||
airship: {
|
||||
price: 1,
|
||||
|
||||
@@ -114,7 +114,7 @@ const bundles = {
|
||||
'guineapig',
|
||||
],
|
||||
canBuy () {
|
||||
return moment().isBetween('2018-05-08', '2018-06-02');
|
||||
return moment().isBetween('2022-03-15T08:00-04:00', '2022-03-31T20:00-04:00');
|
||||
},
|
||||
type: 'quests',
|
||||
value: 7,
|
||||
@@ -190,7 +190,7 @@ const bundles = {
|
||||
'gryphon',
|
||||
],
|
||||
canBuy () {
|
||||
return moment().isBefore('2021-02-28T08:00-05:00');
|
||||
return moment().isBefore('2022-02-28T20:00-05:00');
|
||||
},
|
||||
type: 'quests',
|
||||
value: 7,
|
||||
|
||||
@@ -11,6 +11,21 @@ const ANIMAL_SET_ACHIEVEMENTS = {
|
||||
achievementKey: 'legendaryBestiary',
|
||||
notificationType: 'ACHIEVEMENT_LEGENDARY_BESTIARY',
|
||||
},
|
||||
birdsOfAFeather: {
|
||||
type: 'pet',
|
||||
species: [
|
||||
'FlyingPig',
|
||||
'Owl',
|
||||
'Parrot',
|
||||
'Pterodactyl',
|
||||
'Gryphon',
|
||||
'Falcon',
|
||||
'Rooster',
|
||||
'Peacock',
|
||||
],
|
||||
achievementKey: 'birdsOfAFeather',
|
||||
notificationType: 'ACHIEVEMENT_BIRDS_OF_A_FEATHER',
|
||||
},
|
||||
domesticated: {
|
||||
type: 'pet',
|
||||
species: [
|
||||
|
||||
@@ -10,11 +10,29 @@ const gemsPromo = {
|
||||
|
||||
export const EVENTS = {
|
||||
noCurrentEvent: {
|
||||
start: '2022-01-31T20:00-05:00',
|
||||
end: '2022-02-28T20:00-05:00',
|
||||
start: '2022-04-30T20:00-05:00',
|
||||
end: '2022-06-30T20:00-05:00',
|
||||
season: 'normal',
|
||||
npcImageSuffix: '',
|
||||
},
|
||||
spring2022: {
|
||||
start: '2022-03-22T08:00-05:00',
|
||||
end: '2022-04-30T20:00-05:00',
|
||||
npcImageSuffix: '_spring',
|
||||
season: 'spring',
|
||||
gear: true,
|
||||
},
|
||||
aprilFools2022: {
|
||||
start: '2022-04-01T08:00-05:00',
|
||||
end: '2022-04-02T08:00-05:00',
|
||||
aprilFools: 'virtual',
|
||||
},
|
||||
valentines2022: {
|
||||
start: '2022-02-14T08:00-05:00',
|
||||
end: '2022-02-18T20:00-05:00',
|
||||
season: 'valentines',
|
||||
npcImageSuffix: 'valentines',
|
||||
},
|
||||
winter2022: {
|
||||
start: '2021-12-21T08:00-05:00',
|
||||
end: '2022-01-31T20:00-05:00',
|
||||
@@ -93,12 +111,6 @@ export const EVENTS = {
|
||||
end: '2021-04-02T08:00-05:00',
|
||||
aprilFools: 'invert',
|
||||
},
|
||||
valentines2021: {
|
||||
start: '2021-02-07T08:00-05:00',
|
||||
end: '2021-02-16T08:00-05:00',
|
||||
season: 'valentines',
|
||||
npcImageSuffix: 'valentines',
|
||||
},
|
||||
winter2021: {
|
||||
start: '2020-12-17T08:00-05:00',
|
||||
end: '2021-01-31T20:00-05:00',
|
||||
@@ -106,13 +118,14 @@ export const EVENTS = {
|
||||
npcImageSuffix: 'winter',
|
||||
gear: true,
|
||||
},
|
||||
winter2021Promo: { // used in tests, not an actual past event
|
||||
winter2021Promo: {
|
||||
// used in tests, not an actual past event
|
||||
start: '2020-12-01T08:00-05:00',
|
||||
end: '2020-12-17T20:00-05:00',
|
||||
season: 'winter',
|
||||
promo: 'g1g1',
|
||||
},
|
||||
fall2020: {
|
||||
fall2020: {
|
||||
start: '2020-09-22T08:00-04:00',
|
||||
end: '2020-10-31T20:00-04:00',
|
||||
gear: true,
|
||||
@@ -123,30 +136,30 @@ export const EVENTS = {
|
||||
summer2020: { start: '2020-06-18', end: '2020-08-02', gear: true },
|
||||
spring2020: { start: '2020-03-17', end: '2020-05-02', gear: true },
|
||||
winter2020: { start: '2019-12-19', end: '2020-02-02', gear: true },
|
||||
fall2019: { start: '2019-09-24', end: '2019-11-02', gear: true },
|
||||
fall2019: { start: '2019-09-24', end: '2019-11-02', gear: true },
|
||||
summer2019: { start: '2019-06-18', end: '2019-08-02', gear: true },
|
||||
spring2019: { start: '2019-03-19', end: '2019-05-02', gear: true },
|
||||
winter2019: { start: '2018-12-19', end: '2019-02-02', gear: true },
|
||||
fall2018: { start: '2018-09-20', end: '2018-11-02', gear: true },
|
||||
fall2018: { start: '2018-09-20', end: '2018-11-02', gear: true },
|
||||
summer2018: { start: '2018-06-19', end: '2018-08-02', gear: true },
|
||||
spring2018: { start: '2018-03-20', end: '2018-05-02', gear: true },
|
||||
winter2018: { start: '2017-12-19', end: '2018-02-02', gear: true },
|
||||
fall2017: { start: '2017-09-21', end: '2017-11-02', gear: true },
|
||||
fall2017: { start: '2017-09-21', end: '2017-11-02', gear: true },
|
||||
summer2017: { start: '2017-06-20', end: '2017-08-02', gear: true },
|
||||
spring2017: { start: '2017-03-21', end: '2017-05-02', gear: true },
|
||||
winter2017: { start: '2016-12-16', end: '2017-02-02', gear: true },
|
||||
fall2016: { start: '2016-09-20', end: '2016-11-02', gear: true },
|
||||
fall2016: { start: '2016-09-20', end: '2016-11-02', gear: true },
|
||||
summer2016: { start: '2016-06-21', end: '2016-08-02', gear: true },
|
||||
spring2016: { start: '2016-03-18', end: '2016-05-02', gear: true },
|
||||
winter2016: { start: '2015-12-18', end: '2016-02-02', gear: true },
|
||||
gaymerx: { start: '2016-09-29', end: '2016-10-03' },
|
||||
fall2015: { start: '2015-09-21', end: '2015-11-01', gear: true },
|
||||
gaymerx: { start: '2016-09-29', end: '2016-10-03' },
|
||||
fall2015: { start: '2015-09-21', end: '2015-11-01', gear: true },
|
||||
summer2015: { start: '2015-06-20', end: '2015-08-02', gear: true },
|
||||
spring2015: { start: '2015-03-20', end: '2015-05-02', gear: true },
|
||||
winter2015: { start: '2014-12-21', end: '2015-02-02', gear: true },
|
||||
fall: { start: '2014-09-21', end: '2014-11-01', gear: true },
|
||||
summer: { start: '2014-06-20', end: '2014-08-01', gear: true },
|
||||
spring: { start: '2014-03-21', end: '2014-05-01', gear: true },
|
||||
birthday: { start: '2017-01-31', end: '2017-02-02' },
|
||||
winter: { start: '2013-12-31', end: '2014-02-01' },
|
||||
fall: { start: '2014-09-21', end: '2014-11-01', gear: true },
|
||||
summer: { start: '2014-06-20', end: '2014-08-01', gear: true },
|
||||
spring: { start: '2014-03-21', end: '2014-05-01', gear: true },
|
||||
birthday: { start: '2017-01-31', end: '2017-02-02' },
|
||||
winter: { start: '2013-12-31', end: '2014-02-01' },
|
||||
};
|
||||
|
||||
@@ -67,36 +67,37 @@ const SEASONAL_SETS = {
|
||||
'cleverDogSet',
|
||||
'braveMouseSet',
|
||||
|
||||
// spring 2017
|
||||
'spring2017FelineWarriorSet',
|
||||
'spring2017CanineConjurorSet',
|
||||
'spring2017FloralMouseSet',
|
||||
'spring2017SneakyBunnySet',
|
||||
|
||||
// spring 2018
|
||||
'spring2018TulipMageSet',
|
||||
'spring2018SunriseWarriorSet',
|
||||
'spring2018DucklingRogueSet',
|
||||
'spring2018GarnetHealerSet',
|
||||
|
||||
// spring 2019
|
||||
'spring2019AmberMageSet',
|
||||
'spring2019OrchidWarriorSet',
|
||||
'spring2019CloudRogueSet',
|
||||
'spring2019RobinHealerSet',
|
||||
|
||||
// spring 2020
|
||||
'spring2020BeetleWarriorSet',
|
||||
'spring2020IrisHealerSet',
|
||||
'spring2020LapisLazuliRogueSet',
|
||||
'spring2020PuddleMageSet',
|
||||
|
||||
// spring 2021
|
||||
'spring2021SwanMageSet',
|
||||
'spring2021WillowHealerSet',
|
||||
'spring2021SunstoneWarriorSet',
|
||||
'spring2021TwinFlowerRogueSet',
|
||||
|
||||
'spring2022ForsythiaMageSet',
|
||||
'spring2022PeridotHealerSet',
|
||||
'spring2022RainstormWarriorSet',
|
||||
'spring2022MagpieRogueSet',
|
||||
],
|
||||
|
||||
summer: [
|
||||
// summer 2014
|
||||
'daringSwashbucklerSet',
|
||||
|
||||
@@ -388,6 +388,14 @@ const armor = {
|
||||
str: 7,
|
||||
set: 'violetLoungewear',
|
||||
},
|
||||
gardenersOveralls: {
|
||||
con: 7,
|
||||
set: 'gardenerSet',
|
||||
},
|
||||
strawRaincoat: {
|
||||
con: 9,
|
||||
set: 'strawRaincoat',
|
||||
},
|
||||
};
|
||||
|
||||
const body = {
|
||||
@@ -787,6 +795,14 @@ const head = {
|
||||
per: 10,
|
||||
set: 'shootingStar',
|
||||
},
|
||||
gardenersSunHat: {
|
||||
per: 7,
|
||||
set: 'gardenerSet',
|
||||
},
|
||||
strawRainHat: {
|
||||
per: 9,
|
||||
set: 'strawRaincoat',
|
||||
},
|
||||
};
|
||||
|
||||
const shield = {
|
||||
@@ -1056,6 +1072,10 @@ const shield = {
|
||||
int: 10,
|
||||
set: 'violetLoungewear',
|
||||
},
|
||||
gardenersSpade: {
|
||||
str: 8,
|
||||
set: 'gardenerSet',
|
||||
},
|
||||
};
|
||||
|
||||
const headAccessory = {
|
||||
@@ -1436,6 +1456,10 @@ const weapon = {
|
||||
str: 5,
|
||||
twoHanded: true,
|
||||
},
|
||||
gardenersWateringCan: {
|
||||
int: 8,
|
||||
set: 'gardenerSet',
|
||||
},
|
||||
};
|
||||
|
||||
forEach({
|
||||
|
||||
@@ -56,6 +56,7 @@ const armor = {
|
||||
202106: { },
|
||||
202110: { },
|
||||
202112: { },
|
||||
202204: { },
|
||||
301404: { },
|
||||
301703: { },
|
||||
301704: { },
|
||||
@@ -89,6 +90,7 @@ const back = {
|
||||
202012: { },
|
||||
202105: { },
|
||||
202109: { },
|
||||
202203: { },
|
||||
};
|
||||
|
||||
const body = {
|
||||
@@ -112,6 +114,8 @@ const eyewear = {
|
||||
202108: { },
|
||||
202201: { },
|
||||
202202: { },
|
||||
'202204A': { mystery: '202204' },
|
||||
'202204B': { mystery: '202204' },
|
||||
301404: { },
|
||||
301405: { },
|
||||
301703: { },
|
||||
@@ -207,6 +211,7 @@ const headAccessory = {
|
||||
202102: { },
|
||||
202105: { },
|
||||
202109: { },
|
||||
202203: { },
|
||||
301405: { },
|
||||
};
|
||||
|
||||
@@ -232,12 +237,8 @@ const weapon = {
|
||||
201911: { },
|
||||
202002: { },
|
||||
202102: { },
|
||||
202104: {
|
||||
twoHanded: true,
|
||||
},
|
||||
202111: {
|
||||
twoHanded: true,
|
||||
},
|
||||
202104: { twoHanded: true },
|
||||
202111: { twoHanded: true },
|
||||
202201: { },
|
||||
301404: { },
|
||||
};
|
||||
|
||||
@@ -670,15 +670,19 @@ const armor = {
|
||||
},
|
||||
spring2021Rogue: {
|
||||
set: 'spring2021TwinFlowerRogueSet',
|
||||
canBuy: () => CURRENT_EVENT && CURRENT_EVENT.season === 'spring',
|
||||
},
|
||||
spring2021Warrior: {
|
||||
set: 'spring2021SunstoneWarriorSet',
|
||||
canBuy: () => CURRENT_EVENT && CURRENT_EVENT.season === 'spring',
|
||||
},
|
||||
spring2021Mage: {
|
||||
set: 'spring2021SwanMageSet',
|
||||
canBuy: () => CURRENT_EVENT && CURRENT_EVENT.season === 'spring',
|
||||
},
|
||||
spring2021Healer: {
|
||||
set: 'spring2021WillowHealerSet',
|
||||
canBuy: () => CURRENT_EVENT && CURRENT_EVENT.season === 'spring',
|
||||
},
|
||||
summer2021Rogue: {
|
||||
set: 'summer2021ClownfishRogueSet',
|
||||
@@ -716,6 +720,19 @@ const armor = {
|
||||
winter2022Healer: {
|
||||
set: 'winter2022IceCrystalHealerSet',
|
||||
},
|
||||
spring2022Rogue: {
|
||||
set: 'spring2022MagpieRogueSet',
|
||||
},
|
||||
spring2022Warrior: {
|
||||
set: 'spring2022RainstormWarriorSet',
|
||||
},
|
||||
spring2022Mage: {
|
||||
set: 'spring2022ForsythiaMageSet',
|
||||
},
|
||||
spring2022Healer: {
|
||||
set: 'spring2022PeridotHealerSet',
|
||||
},
|
||||
|
||||
birthday2022: {
|
||||
text: t('armorSpecialBirthday2022Text'),
|
||||
notes: t('armorSpecialBirthday2022Notes'),
|
||||
@@ -1728,15 +1745,19 @@ const head = {
|
||||
},
|
||||
spring2021Rogue: {
|
||||
set: 'spring2021TwinFlowerRogueSet',
|
||||
canBuy: () => CURRENT_EVENT && CURRENT_EVENT.season === 'spring',
|
||||
},
|
||||
spring2021Warrior: {
|
||||
set: 'spring2021SunstoneWarriorSet',
|
||||
canBuy: () => CURRENT_EVENT && CURRENT_EVENT.season === 'spring',
|
||||
},
|
||||
spring2021Mage: {
|
||||
set: 'spring2021SwanMageSet',
|
||||
canBuy: () => CURRENT_EVENT && CURRENT_EVENT.season === 'spring',
|
||||
},
|
||||
spring2021Healer: {
|
||||
set: 'spring2021WillowHealerSet',
|
||||
canBuy: () => CURRENT_EVENT && CURRENT_EVENT.season === 'spring',
|
||||
},
|
||||
summer2021Rogue: {
|
||||
set: 'summer2021ClownfishRogueSet',
|
||||
@@ -1780,6 +1801,18 @@ const head = {
|
||||
value: 0,
|
||||
canOwn: ownsItem('head_special_nye2021'),
|
||||
},
|
||||
spring2022Rogue: {
|
||||
set: 'spring2022MagpieRogueSet',
|
||||
},
|
||||
spring2022Warrior: {
|
||||
set: 'spring2022RainstormWarriorSet',
|
||||
},
|
||||
spring2022Mage: {
|
||||
set: 'spring2022ForsythiaMageSet',
|
||||
},
|
||||
spring2022Healer: {
|
||||
set: 'spring2022PeridotHealerSet',
|
||||
},
|
||||
};
|
||||
|
||||
const headStats = {
|
||||
@@ -2504,12 +2537,15 @@ const shield = {
|
||||
},
|
||||
spring2021Rogue: {
|
||||
set: 'spring2021TwinFlowerRogueSet',
|
||||
canBuy: () => CURRENT_EVENT && CURRENT_EVENT.season === 'spring',
|
||||
},
|
||||
spring2021Warrior: {
|
||||
set: 'spring2021SunstoneWarriorSet',
|
||||
canBuy: () => CURRENT_EVENT && CURRENT_EVENT.season === 'spring',
|
||||
},
|
||||
spring2021Healer: {
|
||||
set: 'spring2021WillowHealerSet',
|
||||
canBuy: () => CURRENT_EVENT && CURRENT_EVENT.season === 'spring',
|
||||
},
|
||||
summer2021Rogue: {
|
||||
set: 'summer2021ClownfishRogueSet',
|
||||
@@ -2538,6 +2574,15 @@ const shield = {
|
||||
winter2022Healer: {
|
||||
set: 'winter2022IceCrystalHealerSet',
|
||||
},
|
||||
spring2022Rogue: {
|
||||
set: 'spring2022MagpieRogueSet',
|
||||
},
|
||||
spring2022Warrior: {
|
||||
set: 'spring2022RainstormWarriorSet',
|
||||
},
|
||||
spring2022Healer: {
|
||||
set: 'spring2022PeridotHealerSet',
|
||||
},
|
||||
};
|
||||
|
||||
const shieldStats = {
|
||||
@@ -3168,15 +3213,19 @@ const weapon = {
|
||||
},
|
||||
spring2021Rogue: {
|
||||
set: 'spring2021TwinFlowerRogueSet',
|
||||
canBuy: () => CURRENT_EVENT && CURRENT_EVENT.season === 'spring',
|
||||
},
|
||||
spring2021Warrior: {
|
||||
set: 'spring2021SunstoneWarriorSet',
|
||||
canBuy: () => CURRENT_EVENT && CURRENT_EVENT.season === 'spring',
|
||||
},
|
||||
spring2021Mage: {
|
||||
set: 'spring2021SwanMageSet',
|
||||
canBuy: () => CURRENT_EVENT && CURRENT_EVENT.season === 'spring',
|
||||
},
|
||||
spring2021Healer: {
|
||||
set: 'spring2021WillowHealerSet',
|
||||
canBuy: () => CURRENT_EVENT && CURRENT_EVENT.season === 'spring',
|
||||
},
|
||||
summer2021Rogue: {
|
||||
set: 'summer2021ClownfishRogueSet',
|
||||
@@ -3214,6 +3263,18 @@ const weapon = {
|
||||
winter2022Healer: {
|
||||
set: 'winter2022IceCrystalHealerSet',
|
||||
},
|
||||
spring2022Rogue: {
|
||||
set: 'spring2022MagpieRogueSet',
|
||||
},
|
||||
spring2022Warrior: {
|
||||
set: 'spring2022RainstormWarriorSet',
|
||||
},
|
||||
spring2022Mage: {
|
||||
set: 'spring2022ForsythiaMageSet',
|
||||
},
|
||||
spring2022Healer: {
|
||||
set: 'spring2022PeridotHealerSet',
|
||||
},
|
||||
};
|
||||
|
||||
const weaponStats = {
|
||||
|
||||
@@ -3,13 +3,10 @@ import defaults from 'lodash/defaults';
|
||||
import each from 'lodash/each';
|
||||
import moment from 'moment';
|
||||
import t from './translation';
|
||||
import {
|
||||
EVENTS,
|
||||
} from './constants';
|
||||
import { EVENTS } from './constants';
|
||||
|
||||
function hasQuestAchievementFunction (key) {
|
||||
return user => user.achievements.quests
|
||||
&& user.achievements.quests[key] > 0;
|
||||
return user => user.achievements.quests && user.achievements.quests[key] > 0;
|
||||
}
|
||||
|
||||
const drops = {
|
||||
@@ -66,20 +63,20 @@ const premium = {
|
||||
text: t('hatchingPotionCupid'),
|
||||
limited: true,
|
||||
canBuy () {
|
||||
return moment().isBefore('2021-02-28T20:00-05:00');
|
||||
return moment().isBefore('2022-02-28T20:00-05:00');
|
||||
},
|
||||
},
|
||||
Shimmer: {
|
||||
value: 2,
|
||||
text: t('hatchingPotionShimmer'),
|
||||
limited: true,
|
||||
event: EVENTS.spring2020,
|
||||
event: EVENTS.spring2022,
|
||||
_addlNotes: t('eventAvailabilityReturning', {
|
||||
availableDate: t('dateEndMarch'),
|
||||
previousDate: t('marchYYYY', { year: 2018 }),
|
||||
previousDate: t('marchYYYY', { year: 2020 }),
|
||||
}),
|
||||
canBuy () {
|
||||
return moment().isBefore('2020-05-02');
|
||||
return moment().isBefore(EVENTS.spring2022.end);
|
||||
},
|
||||
},
|
||||
Fairy: {
|
||||
@@ -280,20 +277,20 @@ const premium = {
|
||||
text: t('hatchingPotionRoseQuartz'),
|
||||
limited: true,
|
||||
canBuy () {
|
||||
return moment().isBefore('2021-02-28T20:00-05:00');
|
||||
return moment().isBefore('2022-02-28T20:00-05:00');
|
||||
},
|
||||
},
|
||||
Celestial: {
|
||||
value: 2,
|
||||
text: t('hatchingPotionCelestial'),
|
||||
limited: true,
|
||||
event: EVENTS.spring2020,
|
||||
event: EVENTS.spring2022,
|
||||
_addlNotes: t('eventAvailabilityReturning', {
|
||||
availableDate: t('dateEndMarch'),
|
||||
previousDate: t('marchYYYY', { year: 2019 }),
|
||||
previousDate: t('marchYYYY', { year: 2020 }),
|
||||
}),
|
||||
canBuy () {
|
||||
return moment().isBefore('2020-05-02');
|
||||
return moment().isBefore(EVENTS.spring2022.end);
|
||||
},
|
||||
},
|
||||
Sunshine: {
|
||||
@@ -472,12 +469,13 @@ const premium = {
|
||||
value: 2,
|
||||
text: t('hatchingPotionPolkaDot'),
|
||||
limited: true,
|
||||
event: EVENTS.spring2021,
|
||||
_addlNotes: t('premiumPotionAddlNotes', {
|
||||
date: t('dateEndMarch'),
|
||||
event: EVENTS.spring2022,
|
||||
_addlNotes: t('eventAvailabilityReturning', {
|
||||
availableDate: t('dateEndMarch'),
|
||||
previousDate: t('marchYYYY', { year: 2021 }),
|
||||
}),
|
||||
canBuy () {
|
||||
return moment().isBefore(EVENTS.spring2021.end);
|
||||
return moment().isBefore(EVENTS.spring2022.end);
|
||||
},
|
||||
},
|
||||
MossyStone: {
|
||||
@@ -588,9 +586,12 @@ each(wacky, (pot, key) => {
|
||||
notes: t('hatchingPotionNotes', {
|
||||
potText: pot.text,
|
||||
}),
|
||||
_addlNotes: pot._season && pot._season !== '_PENDING_' ? t('eventAvailability', {
|
||||
date: t(`dateEnd${pot._season}`),
|
||||
}) : null,
|
||||
_addlNotes:
|
||||
pot._season && pot._season !== '_PENDING_'
|
||||
? t('eventAvailability', {
|
||||
date: t(`dateEnd${pot._season}`),
|
||||
})
|
||||
: null,
|
||||
premium: false,
|
||||
limited: true,
|
||||
wacky: true,
|
||||
@@ -603,8 +604,5 @@ each(wacky, (pot, key) => {
|
||||
const all = assign({}, drops, premium, wacky);
|
||||
|
||||
export {
|
||||
drops,
|
||||
premium,
|
||||
wacky,
|
||||
all,
|
||||
drops, premium, wacky, all,
|
||||
};
|
||||
|
||||
@@ -20,11 +20,7 @@ import * as eggs from './eggs';
|
||||
import * as hatchingPotions from './hatching-potions';
|
||||
import * as stable from './stable';
|
||||
import gear from './gear';
|
||||
import {
|
||||
quests,
|
||||
questsByLevel,
|
||||
userCanOwnQuestCategories,
|
||||
} from './quests';
|
||||
import { quests, questsByLevel, userCanOwnQuestCategories } from './quests';
|
||||
|
||||
import appearances from './appearance';
|
||||
import { backgroundsTree, backgroundsFlat } from './appearance/backgrounds';
|
||||
@@ -57,7 +53,23 @@ api.spells = spells;
|
||||
api.subscriptionBlocks = subscriptionBlocks;
|
||||
api.gems = gemsBlock;
|
||||
|
||||
api.audioThemes = ['danielTheBard', 'gokulTheme', 'luneFoxTheme', 'wattsTheme', 'rosstavoTheme', 'dewinTheme', 'airuTheme', 'beatscribeNesTheme', 'arashiTheme', 'maflTheme', 'pizildenTheme', 'farvoidTheme', 'spacePenguinTheme', 'lunasolTheme', 'triumphTheme'];
|
||||
api.audioThemes = [
|
||||
'danielTheBard',
|
||||
'gokulTheme',
|
||||
'luneFoxTheme',
|
||||
'wattsTheme',
|
||||
'rosstavoTheme',
|
||||
'dewinTheme',
|
||||
'airuTheme',
|
||||
'beatscribeNesTheme',
|
||||
'arashiTheme',
|
||||
'maflTheme',
|
||||
'pizildenTheme',
|
||||
'farvoidTheme',
|
||||
'spacePenguinTheme',
|
||||
'lunasolTheme',
|
||||
'triumphTheme',
|
||||
];
|
||||
|
||||
api.mystery = timeTravelers.mystery;
|
||||
api.timeTravelerStore = timeTravelers.timeTravelerStore;
|
||||
@@ -121,7 +133,7 @@ api.cardTypes = {
|
||||
valentine: {
|
||||
key: 'valentine',
|
||||
messageOptions: 4,
|
||||
yearRound: moment().isBefore('2021-02-28T20:00-05:00'),
|
||||
yearRound: moment().isBefore('2022-02-18T20:00-05:00'),
|
||||
},
|
||||
birthday: {
|
||||
key: 'birthday',
|
||||
@@ -632,7 +644,8 @@ api.userDefaults = {
|
||||
t('defaultTag4'), // School
|
||||
t('defaultTag6'), // Chores
|
||||
],
|
||||
}, {
|
||||
},
|
||||
{
|
||||
type: 'habit',
|
||||
text: t('defaultHabit2Text'),
|
||||
value: 0,
|
||||
@@ -642,7 +655,8 @@ api.userDefaults = {
|
||||
tags: [
|
||||
t('defaultTag3'), // Health + Wellness
|
||||
],
|
||||
}, {
|
||||
},
|
||||
{
|
||||
type: 'habit',
|
||||
text: t('defaultHabit3Text'),
|
||||
value: 0,
|
||||
@@ -675,17 +689,23 @@ api.userDefaults = {
|
||||
tags: [
|
||||
{
|
||||
name: t('defaultTag1'),
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: t('defaultTag2'),
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: t('defaultTag3'),
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: t('defaultTag4'),
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: t('defaultTag5'),
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: t('defaultTag6'),
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: t('defaultTag7'),
|
||||
},
|
||||
],
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import moment from 'moment';
|
||||
import { EVENTS } from './constants';
|
||||
// Magic Hatching Potions are configured like this:
|
||||
// type: 'premiumHatchingPotion', // note no "s" at the end
|
||||
// path: 'premiumHatchingPotions.Rainbow',
|
||||
const featuredItems = {
|
||||
market () {
|
||||
if (moment().isBefore('2022-01-31T20:00-05:00')) {
|
||||
if (moment().isBefore(EVENTS.spring2022.end)) {
|
||||
return [
|
||||
{
|
||||
type: 'armoire',
|
||||
@@ -12,15 +13,15 @@ const featuredItems = {
|
||||
},
|
||||
{
|
||||
type: 'premiumHatchingPotion',
|
||||
path: 'premiumHatchingPotions.StainedGlass',
|
||||
path: 'premiumHatchingPotions.Shimmer',
|
||||
},
|
||||
{
|
||||
type: 'premiumHatchingPotion',
|
||||
path: 'premiumHatchingPotions.Peppermint',
|
||||
path: 'premiumHatchingPotions.Celestial',
|
||||
},
|
||||
{
|
||||
type: 'premiumHatchingPotion',
|
||||
path: 'premiumHatchingPotions.Holly',
|
||||
path: 'premiumHatchingPotions.PolkaDot',
|
||||
},
|
||||
];
|
||||
}
|
||||
@@ -44,35 +45,19 @@ const featuredItems = {
|
||||
];
|
||||
},
|
||||
quests () {
|
||||
if (moment().isBefore('2022-01-11T08:00-05:00')) {
|
||||
return [
|
||||
{
|
||||
type: 'quests',
|
||||
path: 'quests.evilsanta',
|
||||
},
|
||||
{
|
||||
type: 'quests',
|
||||
path: 'quests.evilsanta2',
|
||||
},
|
||||
{
|
||||
type: 'quests',
|
||||
path: 'quests.penguin',
|
||||
},
|
||||
];
|
||||
}
|
||||
if (moment().isBefore('2022-01-31T20:00-05:00')) {
|
||||
if (moment().isBefore('2022-03-31T20:00-04:00')) {
|
||||
return [
|
||||
{
|
||||
type: 'bundles',
|
||||
path: 'bundles.winterQuests',
|
||||
path: 'bundles.cuddleBuddies',
|
||||
},
|
||||
{
|
||||
type: 'quests',
|
||||
path: 'quests.silver',
|
||||
path: 'quests.egg',
|
||||
},
|
||||
{
|
||||
type: 'quests',
|
||||
path: 'quests.sheep',
|
||||
path: 'quests.ghost_stag',
|
||||
},
|
||||
];
|
||||
}
|
||||
@@ -83,7 +68,7 @@ const featuredItems = {
|
||||
},
|
||||
{
|
||||
type: 'quests',
|
||||
path: 'quests.bronze',
|
||||
path: 'quests.silver',
|
||||
},
|
||||
{
|
||||
type: 'quests',
|
||||
@@ -91,7 +76,7 @@ const featuredItems = {
|
||||
},
|
||||
];
|
||||
},
|
||||
seasonal: 'winter2021Warrior',
|
||||
seasonal: 'spring2021Healer',
|
||||
timeTravelers: [
|
||||
// TODO
|
||||
],
|
||||
|
||||
@@ -250,3 +250,53 @@ export function shouldDo (day, dailyTask, options = {}) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export function getPlanMonths (plan) {
|
||||
// NB gift subscriptions don't have a planID
|
||||
// (which doesn't matter because we don't need to reapply perks
|
||||
// for them and by this point they should have expired anyway)
|
||||
if (!plan.planId) return 1;
|
||||
const planIdRegExp = new RegExp('_([0-9]+)mo'); // e.g., matches 'google_6mo' / 'basic_12mo' and captures '6' / '12'
|
||||
const match = plan.planId.match(planIdRegExp);
|
||||
if (match !== null && match[0] !== null) {
|
||||
// 3 for 3-month recurring subscription, etc
|
||||
return match[1]; // eslint-disable-line prefer-destructuring
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is a helper method to get all the needed informations of the plan
|
||||
*
|
||||
* currently used in cron and the "next hourglass in" feature
|
||||
*/
|
||||
export function getPlanContext (user, now) {
|
||||
const { plan } = user.purchased;
|
||||
|
||||
defaults(plan.consecutive, {
|
||||
count: 0, offset: 0, trinkets: 0, gemCapExtra: 0,
|
||||
});
|
||||
|
||||
const nowMoment = moment(now);
|
||||
|
||||
const subscriptionEndDate = moment(plan.dateTerminated).isBefore()
|
||||
? moment(plan.dateTerminated).startOf('month')
|
||||
: nowMoment.startOf('month');
|
||||
const dateUpdatedMoment = moment(plan.dateUpdated).startOf('month');
|
||||
const elapsedMonths = moment(subscriptionEndDate).diff(dateUpdatedMoment, 'months');
|
||||
|
||||
const monthsTillNextHourglass = plan.consecutive.offset || (3 - (plan.consecutive.count % 3));
|
||||
|
||||
const possibleNextHourglassDate = moment(plan.dateUpdated)
|
||||
.add(monthsTillNextHourglass, 'months');
|
||||
|
||||
return {
|
||||
plan,
|
||||
subscriptionEndDate,
|
||||
dateUpdatedMoment,
|
||||
elapsedMonths,
|
||||
offset: plan.consecutive.offset, // months until the new hourglass is added
|
||||
nextHourglassDate: possibleNextHourglassDate,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -25,7 +25,9 @@ import {
|
||||
import content from './content/index';
|
||||
import * as count from './count';
|
||||
// TODO under api.libs.cron?
|
||||
import { daysSince, DAY_MAPPING, shouldDo } from './cron';
|
||||
import {
|
||||
daysSince, DAY_MAPPING, shouldDo, getPlanContext, getPlanMonths,
|
||||
} from './cron';
|
||||
import apiErrors from './errors/apiErrorMessages';
|
||||
import commonErrors from './errors/commonErrorMessages';
|
||||
import autoAllocate from './fns/autoAllocate';
|
||||
@@ -93,13 +95,16 @@ import { unEquipByType } from './ops/unequip';
|
||||
import getOfficialPinnedItems from './libs/getOfficialPinnedItems';
|
||||
import { sleepAsync } from './libs/sleepAsync';
|
||||
|
||||
const api = {};
|
||||
api.content = content;
|
||||
api.errors = errors;
|
||||
api.i18n = i18n;
|
||||
api.shouldDo = shouldDo;
|
||||
api.daysSince = daysSince;
|
||||
api.DAY_MAPPING = DAY_MAPPING;
|
||||
const api = {
|
||||
content,
|
||||
errors,
|
||||
i18n,
|
||||
shouldDo,
|
||||
getPlanContext,
|
||||
getPlanMonths,
|
||||
daysSince,
|
||||
DAY_MAPPING,
|
||||
};
|
||||
|
||||
api.constants = {
|
||||
MAX_INCENTIVES,
|
||||
|
||||
@@ -30,20 +30,24 @@ export default {
|
||||
|
||||
pinnedSets: SHOP_OPEN
|
||||
? {
|
||||
healer: 'winter2022IceCrystalHealerSet',
|
||||
rogue: 'winter2022FireworksRogueSet',
|
||||
warrior: 'winter2022StockingWarriorSet',
|
||||
wizard: 'winter2022PomegranateMageSet',
|
||||
healer: 'spring2022PeridotHealerSet',
|
||||
rogue: 'spring2022MagpieRogueSet',
|
||||
warrior: 'spring2022RainstormWarriorSet',
|
||||
wizard: 'spring2022ForsythiaMageSet',
|
||||
}
|
||||
: {},
|
||||
|
||||
availableSpells: SHOP_OPEN && moment().isBetween('2021-12-30T08:00-04:00', CURRENT_EVENT.end)
|
||||
availableSpells: SHOP_OPEN && moment().isBetween('2022-04-12T08:00-05:00', CURRENT_EVENT.end)
|
||||
? [
|
||||
'snowball',
|
||||
'shinySeed',
|
||||
]
|
||||
: [],
|
||||
|
||||
availableQuests: [],
|
||||
availableQuests: SHOP_OPEN && CURRENT_EVENT.season === 'spring'
|
||||
? [
|
||||
'egg',
|
||||
]
|
||||
: [],
|
||||
|
||||
featuredSet: 'winter2021ArcticExplorerHealerSet',
|
||||
featuredSet: 'spring2021TwinFlowerRogueSet',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user