Add pets and egss as modules

This commit is contained in:
Blade Barringer
2015-09-21 08:57:35 -05:00
parent 1d4159ebf3
commit 9b8e6534d0
8 changed files with 159 additions and 82 deletions

View File

@@ -1,4 +1,4 @@
import {each} from 'lodash';
import {each, defaults} from 'lodash';
import t from '../helpers/translator';
const DROP_EGGS = [
@@ -23,4 +23,16 @@ each(DROP_EGGS, (pet) => {
}
});
each(eggs, (egg, key) => {
return defaults(egg, {
canBuy: true,
value: 3,
key: key,
notes: t('eggNotes', {
eggText: egg.text,
eggAdjective: egg.adjective
}),
});
});
export default eggs;

View File

@@ -1,23 +1,15 @@
// value & other defaults set below
let each = require('lodash').each;
let defaults = require('lodash').defaults;
let t = require('../helpers/translator');
import {assign} from 'lodash';
let dropEggs = require('./drops');
import dropEggs from './drops';
import questEggs from './quest';
each(dropEggs, (egg, key) => {
return defaults(egg, {
canBuy: true,
value: 3,
key: key,
notes: t('eggNotes', {
eggText: egg.text,
eggAdjective: egg.adjective
}),
mountText: egg.text
});
});
let allEggs = {};
assign(allEggs, dropEggs);
assign(allEggs, questEggs);
export default {
dropEggs: dropEggs
allEggs: allEggs,
dropEggs: dropEggs,
questEggs: questEggs,
}

View File

@@ -0,0 +1,50 @@
import {each, defaults} from 'lodash';
import t from '../helpers/translator';
const QUEST_EGGS = [
'Gryphon',
'Hedgehog',
'Deer',
'Egg',
'Rat',
'Octopus',
'Seahorse',
'Parrot',
'Rooster',
'Spider',
'Owl',
'Penguin',
'TRex',
'Rock',
'Bunny',
'Slime',
'Sheep',
'Cuttlefish',
'Whale',
'Cheetah',
'Horse',
];
let eggs = { };
each(QUEST_EGGS, (pet) => {
eggs[pet] = {
text: t(`questEgg${pet}Text`),
mountText: t(`questEgg${pet}MountText`),
adjective: t(`questEgg${pet}Adjective`),
}
});
each(eggs, (egg, key) => {
return defaults(egg, {
canBuy: false,
value: 3,
key: key,
notes: t('eggNotes', {
eggText: egg.text,
eggAdjective: egg.adjective
}),
});
});
export default eggs;

View File

@@ -0,0 +1,29 @@
import {transform, defaults} from 'lodash';
import hatchingPotions from '../hatching-potions';
import dropEggs from '../eggs/drops';
import questEggs from '../eggs/quest';
import specialPets from './special-pets';
import specialMounts from './special-mounts';
let dropPets = generateAnimalSet(dropEggs);
let questPets = generateAnimalSet(questEggs);
let dropMounts = generateAnimalSet(dropEggs);
let questMounts = generateAnimalSet(questEggs);
function generateAnimalSet(set) {
return transform(set, function(m, egg) {
defaults(m, transform(hatchingPotions, function(m2, pot) {
return m2[egg.key + "-" + pot.key] = true;
}));
});
}
export default {
dropPets: dropPets,
dropMounts: dropMounts,
questPets: questPets,
questMounts: questMounts,
specialPets: specialPets,
specialMounts: specialMounts,
}

View File

@@ -0,0 +1,13 @@
// special mounts are {key:i18n}
let specialMounts = {
'BearCub-Polar': 'polarBear',
'LionCub-Ethereal': 'etherealLion',
'MantisShrimp-Base': 'mantisShrimp',
'Turkey-Base': 'turkey',
'Mammoth-Base': 'mammoth',
'Orca-Base': 'orca',
'Gryphon-RoyalPurple': 'royalPurpleGryphon',
}
export default specialMounts;

View File

@@ -0,0 +1,15 @@
// special mounts are {key:i18n}
let specialPets = {
'Wolf-Veteran': 'veteranWolf',
'Wolf-Cerberus': 'cerberusPup',
'Dragon-Hydra': 'hydra',
'Turkey-Base': 'turkey',
'BearCub-Polar': 'polarBearPup',
'MantisShrimp-Base': 'mantisShrimp',
'JackOLantern-Base': 'jackolantern',
'Mammoth-Base': 'mammoth',
'Tiger-Veteran': 'veteranTiger',
}
export default specialPets;