mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
Move hatching potions to separate module
This commit is contained in:
@@ -629,19 +629,7 @@ api.specialMounts =
|
|||||||
|
|
||||||
api.timeTravelStable = require('../../dist/scripts/content/time-traveler-stable')
|
api.timeTravelStable = require('../../dist/scripts/content/time-traveler-stable')
|
||||||
|
|
||||||
api.hatchingPotions =
|
api.hatchingPotions = require('../../dist/scripts/content/hatching-potions')
|
||||||
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')
|
|
||||||
_.each api.hatchingPotions, (pot,key) ->
|
|
||||||
_.defaults pot, {key, value: 2, notes: t('hatchingPotionNotes', {potText: pot.text})}
|
|
||||||
|
|
||||||
api.pets = _.transform api.dropEggs, (m, egg) ->
|
api.pets = _.transform api.dropEggs, (m, egg) ->
|
||||||
_.defaults m, _.transform api.hatchingPotions, (m2, pot) ->
|
_.defaults m, _.transform api.hatchingPotions, (m2, pot) ->
|
||||||
|
|||||||
48
common/script/src/content/hatcing-potions.js
Normal file
48
common/script/src/content/hatcing-potions.js
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import {each, defaults} from 'lodash';
|
||||||
|
import t from '../helpers/translator';
|
||||||
|
|
||||||
|
let hatchingPotions = {
|
||||||
|
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,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
each(hatchingPotions, function(potion, key) {
|
||||||
|
defaults(potion, {
|
||||||
|
key: key,
|
||||||
|
value: 2,
|
||||||
|
text: t(`hatchingPotion${key}`),
|
||||||
|
notes: t('hatchingPotionNotes', {
|
||||||
|
potText: potion.text
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
export default hatchingPotions;
|
||||||
Reference in New Issue
Block a user