habitica-self-host/website/common/script/content/hatching-potions.js

288 lines
5.4 KiB
JavaScript
Raw Normal View History

import assign from 'lodash/assign';
import defaults from 'lodash/defaults';
import each from 'lodash/each';
import t from './translation';
2019-09-26 19:47:26 +00:00
const CURRENT_SEASON = 'October';
function hasQuestAchievementFunction (key) {
2019-10-08 14:57:10 +00:00
return user => user.achievements.quests
&& user.achievements.quests[key] > 0;
}
2019-10-08 14:57:10 +00:00
const drops = {
Base: {
value: 2,
text: t('hatchingPotionBase'),
},
White: {
value: 2,
text: t('hatchingPotionWhite'),
},
Desert: {
value: 2,
text: t('hatchingPotionDesert'),
},
Red: {
value: 3,
text: t('hatchingPotionRed'),
},
Shade: {
value: 3,
text: t('hatchingPotionShade'),
},
Skeleton: {
value: 3,
text: t('hatchingPotionSkeleton'),
},
Zombie: {
value: 4,
text: t('hatchingPotionZombie'),
},
CottonCandyPink: {
value: 4,
text: t('hatchingPotionCottonCandyPink'),
},
CottonCandyBlue: {
value: 4,
text: t('hatchingPotionCottonCandyBlue'),
},
Golden: {
value: 5,
text: t('hatchingPotionGolden'),
},
};
2019-10-08 14:57:10 +00:00
const premium = {
RoyalPurple: {
value: 2,
text: t('hatchingPotionRoyalPurple'),
limited: true,
},
Cupid: {
value: 2,
text: t('hatchingPotionCupid'),
limited: true,
_season: '_PENDING_',
},
Shimmer: {
value: 2,
text: t('hatchingPotionShimmer'),
limited: true,
_season: '_PENDING_',
},
Fairy: {
value: 2,
text: t('hatchingPotionFairy'),
limited: true,
_season: '_PENDING_',
},
Floral: {
value: 2,
text: t('hatchingPotionFloral'),
limited: true,
_season: '_PENDING_',
},
2017-06-29 21:21:20 +00:00
Aquatic: {
value: 2,
text: t('hatchingPotionAquatic'),
limited: true,
_season: '_PENDING_',
2017-06-29 21:21:20 +00:00
},
2017-08-08 20:48:59 +00:00
Ember: {
value: 2,
text: t('hatchingPotionEmber'),
limited: true,
_season: '_PENDING_',
2017-08-08 20:48:59 +00:00
},
Thunderstorm: {
value: 2,
text: t('hatchingPotionThunderstorm'),
limited: true,
_season: '_PENDING_',
},
Spooky: {
value: 2,
text: t('hatchingPotionSpooky'),
limited: true,
2019-09-26 19:47:26 +00:00
_season: 'October',
_addlNotes: t('eventAvailabilityReturning', {
availableDate: t('dateEndOctober'),
previousDate: t('september2017'),
}),
},
Ghost: {
Login Incentives (#8230) * feat(incentives): login bennies WIP * feat(content): incentive prize content WIP * fix(content): placeholders pass tests * WIP(content): Bard instrument placeholder * feat(content): Incentives build * chore(sprites): compile and fix some strings * WIP(incentives): quests and backgrounds * fix(quests): correct buy/launch handling * [WIP] Incentives rewarding (#8226) * Added login incentive rewards * Updated incentive rewards * Added incentive modal and updated notification structure * Added analytics to sleeping * Added login incentives to user analytics * Fixed unit tests and ensured that prizes are incremented and not replaced * Updated style of daily login incentive modal * Added rewards modal * Added translations * Added loigin incentive ui elements to profile * Updated login incentives structure and abstracted to common.content * Added dynamic display for login incentives on profile * Added purple potion image * Updated daily login modal * Fixed progress calculation * Added bard gear * Updated login incentive rewards * Fixed styles and text * Added multiple read for notifications * Fixed lint issues * Fixed styles and added 50 limit * Updated quest keys * Added login incentives reward page * Fixed tests * Fixed linting and tests * Read named notifications route. Add image for backgrounds * Fixed style issues and added tranlsations to login incentive notification * Hided abiltiy to purchase incentive backgrounds and added message to detail how to unlock * Updated awarded message * Fixed text and updated progress counter to display better * Fixed purple potion reward text * Fixed check in backgrouns reward text * fix(quest): pass tests * Added display of multiple rewards * Updated modal styles * Fixed neagtive 50 issue * Remvoed total count from daily login incentives modal * Fixed magic paw display * fix(awards): give bunnies again * WIP(incentives): more progress on BG shop * fix(incentives): actually award backgrounds * fix(incentives): more BG fixy * fix(backgrounds): don't gem-buy checkin bgs * Added dust bunny notification * fix(incentives): don't redisplay bunny award * chore(news): Bailey and different promo sprite
2016-11-24 01:34:09 +00:00
value: 2,
text: t('hatchingPotionGhost'),
Login Incentives (#8230) * feat(incentives): login bennies WIP * feat(content): incentive prize content WIP * fix(content): placeholders pass tests * WIP(content): Bard instrument placeholder * feat(content): Incentives build * chore(sprites): compile and fix some strings * WIP(incentives): quests and backgrounds * fix(quests): correct buy/launch handling * [WIP] Incentives rewarding (#8226) * Added login incentive rewards * Updated incentive rewards * Added incentive modal and updated notification structure * Added analytics to sleeping * Added login incentives to user analytics * Fixed unit tests and ensured that prizes are incremented and not replaced * Updated style of daily login incentive modal * Added rewards modal * Added translations * Added loigin incentive ui elements to profile * Updated login incentives structure and abstracted to common.content * Added dynamic display for login incentives on profile * Added purple potion image * Updated daily login modal * Fixed progress calculation * Added bard gear * Updated login incentive rewards * Fixed styles and text * Added multiple read for notifications * Fixed lint issues * Fixed styles and added 50 limit * Updated quest keys * Added login incentives reward page * Fixed tests * Fixed linting and tests * Read named notifications route. Add image for backgrounds * Fixed style issues and added tranlsations to login incentive notification * Hided abiltiy to purchase incentive backgrounds and added message to detail how to unlock * Updated awarded message * Fixed text and updated progress counter to display better * Fixed purple potion reward text * Fixed check in backgrouns reward text * fix(quest): pass tests * Added display of multiple rewards * Updated modal styles * Fixed neagtive 50 issue * Remvoed total count from daily login incentives modal * Fixed magic paw display * fix(awards): give bunnies again * WIP(incentives): more progress on BG shop * fix(incentives): actually award backgrounds * fix(incentives): more BG fixy * fix(backgrounds): don't gem-buy checkin bgs * Added dust bunny notification * fix(incentives): don't redisplay bunny award * chore(news): Bailey and different promo sprite
2016-11-24 01:34:09 +00:00
limited: true,
_season: '_PENDING_',
Login Incentives (#8230) * feat(incentives): login bennies WIP * feat(content): incentive prize content WIP * fix(content): placeholders pass tests * WIP(content): Bard instrument placeholder * feat(content): Incentives build * chore(sprites): compile and fix some strings * WIP(incentives): quests and backgrounds * fix(quests): correct buy/launch handling * [WIP] Incentives rewarding (#8226) * Added login incentive rewards * Updated incentive rewards * Added incentive modal and updated notification structure * Added analytics to sleeping * Added login incentives to user analytics * Fixed unit tests and ensured that prizes are incremented and not replaced * Updated style of daily login incentive modal * Added rewards modal * Added translations * Added loigin incentive ui elements to profile * Updated login incentives structure and abstracted to common.content * Added dynamic display for login incentives on profile * Added purple potion image * Updated daily login modal * Fixed progress calculation * Added bard gear * Updated login incentive rewards * Fixed styles and text * Added multiple read for notifications * Fixed lint issues * Fixed styles and added 50 limit * Updated quest keys * Added login incentives reward page * Fixed tests * Fixed linting and tests * Read named notifications route. Add image for backgrounds * Fixed style issues and added tranlsations to login incentive notification * Hided abiltiy to purchase incentive backgrounds and added message to detail how to unlock * Updated awarded message * Fixed text and updated progress counter to display better * Fixed purple potion reward text * Fixed check in backgrouns reward text * fix(quest): pass tests * Added display of multiple rewards * Updated modal styles * Fixed neagtive 50 issue * Remvoed total count from daily login incentives modal * Fixed magic paw display * fix(awards): give bunnies again * WIP(incentives): more progress on BG shop * fix(incentives): actually award backgrounds * fix(incentives): more BG fixy * fix(backgrounds): don't gem-buy checkin bgs * Added dust bunny notification * fix(incentives): don't redisplay bunny award * chore(news): Bailey and different promo sprite
2016-11-24 01:34:09 +00:00
},
Holly: {
value: 2,
text: t('hatchingPotionHolly'),
limited: true,
_season: '_PENDING_',
},
Peppermint: {
2017-02-02 17:29:33 +00:00
value: 2,
text: t('hatchingPotionPeppermint'),
2017-02-02 17:29:33 +00:00
limited: true,
_season: '_PENDING_',
2017-02-02 17:29:33 +00:00
},
StarryNight: {
value: 2,
text: t('hatchingPotionStarryNight'),
limited: true,
_season: '_PENDING_',
},
2018-03-13 20:54:27 +00:00
Rainbow: {
value: 2,
text: t('hatchingPotionRainbow'),
limited: true,
2019-05-14 21:33:42 +00:00
_season: '_PENDING_',
2018-03-13 20:54:27 +00:00
},
Glass: {
value: 2,
text: t('hatchingPotionGlass'),
limited: true,
2019-08-01 23:08:43 +00:00
_season: '_PENDING_',
_addlNotes: t('eventAvailabilityReturning', {
availableDate: t('dateEndJuly'),
previousDate: t('june2018'),
}),
},
Glow: {
value: 2,
text: t('hatchingPotionGlow'),
limited: true,
2019-09-26 19:47:26 +00:00
_season: 'October',
_addlNotes: t('eventAvailabilityReturning', {
availableDate: t('dateEndOctober'),
previousDate: t('september2018'),
}),
},
2018-11-20 20:55:45 +00:00
Frost: {
value: 2,
text: t('hatchingPotionFrost'),
limited: true,
_season: '_PENDING_',
2018-11-20 20:55:45 +00:00
},
2018-12-20 15:40:54 +00:00
IcySnow: {
value: 2,
text: t('hatchingPotionIcySnow'),
limited: true,
_season: '_PENDING_',
2018-12-20 15:40:54 +00:00
},
RoseQuartz: {
value: 2,
text: t('hatchingPotionRoseQuartz'),
limited: true,
_season: '_PENDING_',
},
Celestial: {
value: 2,
text: t('hatchingPotionCelestial'),
limited: true,
2019-05-14 21:33:42 +00:00
_season: '_PENDING_',
},
Sunshine: {
value: 2,
text: t('hatchingPotionSunshine'),
limited: true,
_season: '_PENDING_',
},
Bronze: {
value: 2,
text: t('hatchingPotionBronze'),
limited: true,
canBuy: hasQuestAchievementFunction('bronze'),
},
Watery: {
value: 2,
text: t('hatchingPotionWatery'),
limited: true,
2019-08-01 23:08:43 +00:00
_season: '_PENDING_',
},
Silver: {
value: 2,
text: t('hatchingPotionSilver'),
limited: true,
canBuy: hasQuestAchievementFunction('silver'),
},
2019-09-26 19:47:26 +00:00
Shadow: {
value: 2,
text: t('hatchingPotionShadow'),
limited: true,
_season: 'October',
},
};
2019-03-25 22:26:38 +00:00
const wacky = {
Veggie: {
text: t('hatchingPotionVeggie'),
limited: true,
2019-05-14 21:33:42 +00:00
_season: '_PENDING_',
2019-03-25 22:26:38 +00:00
},
};
each(drops, (pot, key) => {
defaults(pot, {
key,
value: 2,
notes: t('hatchingPotionNotes', {
potText: pot.text,
}),
premium: false,
limited: false,
canBuy () {
return true;
},
});
});
each(premium, (pot, key) => {
defaults(pot, {
key,
value: 2,
notes: t('hatchingPotionNotes', {
potText: pot.text,
}),
2019-09-26 19:47:26 +00:00
_addlNotes: t('premiumPotionAddlNotes', {
date: t(`dateEnd${pot._season}`),
}),
premium: true,
limited: false,
canBuy () {
return pot._season === CURRENT_SEASON;
},
});
});
2019-03-25 22:26:38 +00:00
each(wacky, (pot, key) => {
defaults(pot, {
key,
value: 2,
notes: t('hatchingPotionNotes', {
potText: pot.text,
}),
_addlNotes: t('eventAvailability', {
date: t(`dateEnd${pot._season}`),
}),
premium: false,
limited: true,
2019-04-04 15:35:22 +00:00
wacky: true,
2019-03-25 22:26:38 +00:00
canBuy () {
return pot._season === CURRENT_SEASON;
},
});
});
2019-10-08 14:57:10 +00:00
const all = assign({}, drops, premium, wacky);
2019-10-01 15:53:48 +00:00
export {
drops,
premium,
2019-03-25 22:26:38 +00:00
wacky,
all,
};