mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
207 lines
3.8 KiB
JavaScript
207 lines
3.8 KiB
JavaScript
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;
|
|
}
|
|
|
|
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,
|
|
},
|
|
};
|
|
|
|
const premium = {
|
|
RoyalPurple: {},
|
|
Cupid: {},
|
|
Shimmer: {},
|
|
Fairy: {},
|
|
Floral: {},
|
|
Aquatic: {},
|
|
Ember: {},
|
|
Thunderstorm: {},
|
|
Spooky: {},
|
|
Ghost: {},
|
|
Holly: {},
|
|
Peppermint: {},
|
|
StarryNight: {},
|
|
Rainbow: {},
|
|
Glass: {},
|
|
Glow: {},
|
|
Frost: {},
|
|
IcySnow: {},
|
|
RoseQuartz: {},
|
|
Celestial: {},
|
|
Sunshine: {},
|
|
Bronze: {
|
|
questPotion: true,
|
|
canBuy: hasQuestAchievementFunction('bronze'),
|
|
},
|
|
Watery: {},
|
|
Silver: {
|
|
questPotion: true,
|
|
canBuy: hasQuestAchievementFunction('silver'),
|
|
},
|
|
Shadow: {},
|
|
Amber: {
|
|
questPotion: true,
|
|
canBuy: hasQuestAchievementFunction('amber'),
|
|
},
|
|
Aurora: {},
|
|
Ruby: {
|
|
questPotion: true,
|
|
canBuy: hasQuestAchievementFunction('ruby'),
|
|
},
|
|
BirchBark: {},
|
|
Fluorite: {
|
|
questPotion: true,
|
|
canBuy: hasQuestAchievementFunction('fluorite'),
|
|
},
|
|
SandSculpture: {},
|
|
Windup: {
|
|
questPotion: true,
|
|
canBuy: hasQuestAchievementFunction('windup'),
|
|
},
|
|
Turquoise: {
|
|
questPotion: true,
|
|
canBuy: hasQuestAchievementFunction('turquoise'),
|
|
},
|
|
Vampire: {},
|
|
AutumnLeaf: {},
|
|
BlackPearl: {
|
|
questPotion: true,
|
|
canBuy: hasQuestAchievementFunction('blackPearl'),
|
|
},
|
|
StainedGlass: {},
|
|
PolkaDot: {},
|
|
MossyStone: {
|
|
questPotion: true,
|
|
canBuy: hasQuestAchievementFunction('stone'),
|
|
},
|
|
Sunset: {},
|
|
Moonglow: {},
|
|
SolarSystem: {
|
|
questPotion: true,
|
|
canBuy: hasQuestAchievementFunction('solarSystem'),
|
|
},
|
|
Onyx: {
|
|
questPotion: true,
|
|
canBuy: hasQuestAchievementFunction('onyx'),
|
|
},
|
|
Porcelain: {},
|
|
PinkMarble: {
|
|
questPotion: true,
|
|
canBuy: hasQuestAchievementFunction('pinkMarble'),
|
|
},
|
|
Koi: {},
|
|
};
|
|
|
|
const wacky = {
|
|
Veggie: {},
|
|
Dessert: {
|
|
questPotion: true,
|
|
canBuy: hasQuestAchievementFunction('waffle'),
|
|
},
|
|
VirtualPet: {
|
|
questPotion: true,
|
|
canBuy: hasQuestAchievementFunction('virtualpet'),
|
|
},
|
|
TeaShop: {},
|
|
Fungi: {
|
|
questPotion: true,
|
|
canBuy: hasQuestAchievementFunction('fungi'),
|
|
},
|
|
Fungi: {
|
|
text: t('hatchingPotionFungi'),
|
|
limited: true,
|
|
_addlNotes: t('premiumPotionUnlimitedNotes'),
|
|
canBuy: hasQuestAchievementFunction('fungi'),
|
|
},
|
|
};
|
|
|
|
each(drops, (pot, key) => {
|
|
defaults(pot, {
|
|
key,
|
|
value: 2,
|
|
text: t(`hatchingPotion${key}`),
|
|
notes: t('hatchingPotionNotes', {
|
|
potText: t(`hatchingPotion${key}`),
|
|
}),
|
|
premium: false,
|
|
limited: false,
|
|
canBuy () {
|
|
return true;
|
|
},
|
|
});
|
|
});
|
|
|
|
each(premium, (pot, key) => {
|
|
defaults(pot, {
|
|
key,
|
|
value: 2,
|
|
text: t(`hatchingPotion${key}`),
|
|
notes: t('hatchingPotionNotes', {
|
|
potText: t(`hatchingPotion${key}`),
|
|
}),
|
|
_addlNotes: t('premiumPotionUnlimitedNotes'),
|
|
premium: true,
|
|
limited: true,
|
|
canBuy () {
|
|
return false;
|
|
},
|
|
});
|
|
});
|
|
|
|
each(wacky, (pot, key) => {
|
|
defaults(pot, {
|
|
key,
|
|
value: 2,
|
|
text: t(`hatchingPotion${key}`),
|
|
notes: t('hatchingPotionNotes', {
|
|
potText: t(`hatchingPotion${key}`),
|
|
}),
|
|
_addlNotes: t('premiumPotionUnlimitedNotes'),
|
|
premium: false,
|
|
limited: true,
|
|
wacky: true,
|
|
canBuy () {
|
|
return false;
|
|
},
|
|
});
|
|
});
|
|
|
|
const all = assign({}, drops, premium, wacky);
|
|
|
|
export {
|
|
drops, premium, wacky, all,
|
|
};
|