Move hatching potions to separate module

This commit is contained in:
Blade Barringer
2015-09-20 07:46:30 -05:00
parent 7697b6f4a2
commit 8b96e2ed1a
2 changed files with 49 additions and 13 deletions

View File

@@ -629,19 +629,7 @@ api.specialMounts =
api.timeTravelStable = require('../../dist/scripts/content/time-traveler-stable')
api.hatchingPotions =
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.hatchingPotions = require('../../dist/scripts/content/hatching-potions')
api.pets = _.transform api.dropEggs, (m, egg) ->
_.defaults m, _.transform api.hatchingPotions, (m2, pot) ->

View 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;