mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
Move egg function to helpers
This commit is contained in:
@@ -143,3 +143,31 @@ export function generateBackgrounds(sets) {
|
||||
|
||||
return backgrounds;
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
// Egg Helpers
|
||||
//----------------------------------------
|
||||
|
||||
export function generateEggs(set, options={}) {
|
||||
let eggs = {};
|
||||
let type = options.type;
|
||||
let canBuy = options.canBuy;
|
||||
|
||||
each(set, (pet) => {
|
||||
eggs[pet] = {
|
||||
text: translator(`${type}Egg${pet}Text`),
|
||||
mountText: translator(`${type}Egg${pet}MountText`),
|
||||
adjective: translator(`${type}Egg${pet}Adjective`),
|
||||
canBuy: canBuy,
|
||||
value: 3,
|
||||
key: pet,
|
||||
}
|
||||
|
||||
eggs[pet].notes = translator('eggNotes', {
|
||||
eggText: eggs[pet].text,
|
||||
eggAdjective: eggs[pet].adjective
|
||||
});
|
||||
});
|
||||
|
||||
return eggs;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user