Merge branch 'sabrecat/20190401' into sabrecat/veggie-potions

This commit is contained in:
Sabe Jones
2019-04-04 09:21:05 -05:00
11 changed files with 261 additions and 182 deletions

View File

@@ -170,6 +170,14 @@ let premium = {
},
};
const wacky = {
Veggie: {
text: t('hatchingPotionVeggie'),
limited: true,
_season: 'March',
},
};
each(drops, (pot, key) => {
defaults(pot, {
key,
@@ -203,10 +211,29 @@ each(premium, (pot, key) => {
});
});
let all = assign({}, drops, premium);
each(wacky, (pot, key) => {
defaults(pot, {
key,
value: 2,
notes: t('hatchingPotionNotes', {
potText: pot.text,
}),
_addlNotes: t('eventAvailability', {
date: t(`dateEnd${pot._season}`),
}),
premium: false,
limited: true,
canBuy () {
return pot._season === CURRENT_SEASON;
},
});
});
let all = assign({}, drops, premium, wacky);
module.exports = {
drops,
premium,
wacky,
all,
};

View File

@@ -356,12 +356,14 @@ api.timeTravelStable = {
api.dropHatchingPotions = hatchingPotions.drops;
api.premiumHatchingPotions = hatchingPotions.premium;
api.wackyHatchingPotions = hatchingPotions.wacky;
api.hatchingPotions = hatchingPotions.all;
api.pets = stable.dropPets;
api.premiumPets = stable.premiumPets;
api.questPets = stable.questPets;
api.specialPets = stable.specialPets;
api.wackyPets = stable.wackyPets;
api.petInfo = stable.petInfo;
api.mounts = stable.dropMounts;

View File

@@ -6,6 +6,7 @@ import {
import {
drops as dropPotions,
premium as premiumPotions,
wacky as wackyPotions,
} from './hatching-potions';
import t from './translation';
@@ -47,9 +48,38 @@ function constructSet (type, eggs, potions) {
return [pets, mounts];
}
function constructPetOnlySet (type, eggs, potions) {
let pets = {};
each(eggs, (egg) => {
each(potions, (potion) => {
let key = `${egg.key}-${potion.key}`;
function getAnimalData (text) {
return {
key,
type,
potion: potion.key,
egg: egg.key,
text,
};
}
petInfo[key] = getAnimalData(t('petName', {
potion: potion.text,
egg: egg.text,
}));
pets[key] = true;
});
});
return pets;
}
let [dropPets, dropMounts] = constructSet('drop', dropEggs, dropPotions);
let [premiumPets, premiumMounts] = constructSet('premium', dropEggs, premiumPotions);
let [questPets, questMounts] = constructSet('quest', questEggs, dropPotions);
let wackyPets = constructPetOnlySet('wacky', dropEggs, wackyPotions);
let specialPets = {
'Wolf-Veteran': 'veteranWolf',
@@ -113,6 +143,7 @@ module.exports = {
dropPets,
premiumPets,
questPets,
wackyPets,
dropMounts,
questMounts,
premiumMounts,