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

202 lines
3.6 KiB
JavaScript
Raw Normal View History

import defaults from 'lodash/defaults';
import each from 'lodash/each';
import { assign } from 'lodash';
import t from './translation';
function hasQuestAchievementFunction (key) {
return user => user.achievements.quests && user.achievements.quests[key] > 0;
}
2019-10-08 14:57:10 +00:00
const drops = {
Base: {
value: 2,
},
White: {
value: 2,
},
Desert: {
value: 2,
},
Red: {
value: 3,
},
Shade: {
value: 3,
},
Skeleton: {
value: 3,
},
Zombie: {
value: 4,
},
CottonCandyPink: {
value: 4,
},
CottonCandyBlue: {
value: 4,
},
Golden: {
value: 5,
},
};
2019-10-08 14:57:10 +00:00
const premium = {
2024-05-17 13:44:08 +00:00
RoyalPurple: {},
Cupid: {},
Shimmer: {},
Fairy: {},
Floral: {},
Aquatic: {},
Ember: {},
Thunderstorm: {},
Spooky: {},
Ghost: {},
Holly: {},
Peppermint: {},
StarryNight: {},
Rainbow: {},
Glass: {},
Glow: {},
Frost: {},
IcySnow: {},
RoseQuartz: {},
Celestial: {},
Sunshine: {},
Bronze: {
2024-05-17 13:44:08 +00:00
questPotion: true,
canBuy: hasQuestAchievementFunction('bronze'),
},
2024-04-05 03:42:28 +00:00
Watery: {},
Silver: {
2024-05-17 13:44:08 +00:00
questPotion: true,
canBuy: hasQuestAchievementFunction('silver'),
2019-09-26 19:47:26 +00:00
},
2024-04-05 03:42:28 +00:00
Shadow: {},
Amber: {
2024-05-17 13:44:08 +00:00
questPotion: true,
canBuy: hasQuestAchievementFunction('amber'),
2019-12-19 22:54:27 +00:00
},
2024-04-05 03:42:28 +00:00
Aurora: {},
2020-02-13 00:30:54 +00:00
Ruby: {
2024-05-17 13:44:08 +00:00
questPotion: true,
2020-02-13 00:30:54 +00:00
canBuy: hasQuestAchievementFunction('ruby'),
2020-03-17 20:35:38 +00:00
},
2024-04-05 03:42:28 +00:00
BirchBark: {},
Fluorite: {
2024-05-17 13:44:08 +00:00
questPotion: true,
canBuy: hasQuestAchievementFunction('fluorite'),
},
2024-04-05 03:42:28 +00:00
SandSculpture: {},
2020-08-25 21:04:28 +00:00
Windup: {
2024-05-17 13:44:08 +00:00
questPotion: true,
2020-08-25 21:04:28 +00:00
canBuy: hasQuestAchievementFunction('windup'),
},
2020-09-14 21:05:54 +00:00
Turquoise: {
2024-05-17 13:44:08 +00:00
questPotion: true,
2020-09-14 21:05:54 +00:00
canBuy: hasQuestAchievementFunction('turquoise'),
},
2024-04-05 03:42:28 +00:00
Vampire: {},
AutumnLeaf: {},
BlackPearl: {
2024-05-17 13:44:08 +00:00
questPotion: true,
canBuy: hasQuestAchievementFunction('blackPearl'),
},
2024-04-05 03:42:28 +00:00
StainedGlass: {},
PolkaDot: {},
MossyStone: {
2024-05-17 13:44:08 +00:00
questPotion: true,
canBuy: hasQuestAchievementFunction('stone'),
},
2024-04-05 03:42:28 +00:00
Sunset: {},
Moonglow: {},
SolarSystem: {
2024-05-17 13:44:08 +00:00
questPotion: true,
canBuy: hasQuestAchievementFunction('solarSystem'),
},
Onyx: {
2024-05-17 13:44:08 +00:00
questPotion: true,
canBuy: hasQuestAchievementFunction('onyx'),
},
2024-04-05 03:42:28 +00:00
Porcelain: {},
PinkMarble: {
2024-05-17 13:44:08 +00:00
questPotion: true,
canBuy: hasQuestAchievementFunction('pinkMarble'),
},
RoseGold: {},
2024-05-13 12:49:39 +00:00
Koi: {},
};
2019-03-25 22:26:38 +00:00
const wacky = {
2024-05-17 13:44:08 +00:00
Veggie: {},
2020-04-04 00:25:43 +00:00
Dessert: {
2024-05-17 13:44:08 +00:00
questPotion: true,
2020-04-04 00:25:43 +00:00
canBuy: hasQuestAchievementFunction('waffle'),
},
VirtualPet: {
2024-05-17 13:44:08 +00:00
questPotion: true,
2022-04-06 18:36:43 +00:00
canBuy: hasQuestAchievementFunction('virtualpet'),
},
2024-05-17 13:44:08 +00:00
TeaShop: {},
Fungi: {
questPotion: true,
canBuy: hasQuestAchievementFunction('fungi'),
},
2019-03-25 22:26:38 +00:00
};
each(drops, (pot, key) => {
defaults(pot, {
key,
value: 2,
2024-04-05 03:42:28 +00:00
text: t(`hatchingPotion${key}`),
notes: t('hatchingPotionNotes', {
2024-04-05 03:42:28 +00:00
potText: t(`hatchingPotion${key}`),
}),
premium: false,
limited: false,
canBuy () {
return true;
},
});
});
each(premium, (pot, key) => {
defaults(pot, {
key,
value: 2,
2024-04-05 03:42:28 +00:00
text: t(`hatchingPotion${key}`),
notes: t('hatchingPotionNotes', {
2024-04-05 03:42:28 +00:00
potText: t(`hatchingPotion${key}`),
}),
2024-04-05 03:42:28 +00:00
_addlNotes: t('premiumPotionUnlimitedNotes'),
premium: true,
2024-04-05 03:42:28 +00:00
limited: true,
canBuy () {
2019-12-19 22:54:27 +00:00
return false;
},
});
});
2019-03-25 22:26:38 +00:00
each(wacky, (pot, key) => {
defaults(pot, {
key,
value: 2,
2024-04-05 03:42:28 +00:00
text: t(`hatchingPotion${key}`),
2019-03-25 22:26:38 +00:00
notes: t('hatchingPotionNotes', {
2024-04-05 03:42:28 +00:00
potText: t(`hatchingPotion${key}`),
2019-03-25 22:26:38 +00:00
}),
2024-04-05 03:42:28 +00:00
_addlNotes: t('premiumPotionUnlimitedNotes'),
2019-03-25 22:26:38 +00:00
premium: false,
limited: true,
2019-04-04 15:35:22 +00:00
wacky: true,
2019-03-25 22:26:38 +00:00
canBuy () {
2019-12-19 22:54:27 +00:00
return false;
2019-03-25 22:26:38 +00:00
},
});
});
const all = assign({}, drops, premium, wacky);
export {
drops, premium, wacky, all,
};