mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Add pets and egss as modules
This commit is contained in:
@@ -44,12 +44,15 @@
|
|||||||
"dropEggBearCubAdjective": "cuddly",
|
"dropEggBearCubAdjective": "cuddly",
|
||||||
|
|
||||||
"questEggGryphonText": "Gryphon",
|
"questEggGryphonText": "Gryphon",
|
||||||
|
"questEggGryphonMountText": "Gryphon",
|
||||||
"questEggGryphonAdjective": "proud",
|
"questEggGryphonAdjective": "proud",
|
||||||
|
|
||||||
"questEggHedgehogText": "Hedgehog",
|
"questEggHedgehogText": "Hedgehog",
|
||||||
|
"questEggHedgehogMountText": "Hedgehog",
|
||||||
"questEggHedgehogAdjective": "spiky",
|
"questEggHedgehogAdjective": "spiky",
|
||||||
|
|
||||||
"questEggDeerText": "Deer",
|
"questEggDeerText": "Deer",
|
||||||
|
"questEggDeerMountText": "Deer",
|
||||||
"questEggDeerAdjective": "elegant",
|
"questEggDeerAdjective": "elegant",
|
||||||
|
|
||||||
"questEggEggText": "Egg",
|
"questEggEggText": "Egg",
|
||||||
@@ -57,54 +60,71 @@
|
|||||||
"questEggEggAdjective": "colorful",
|
"questEggEggAdjective": "colorful",
|
||||||
|
|
||||||
"questEggRatText": "Rat",
|
"questEggRatText": "Rat",
|
||||||
|
"questEggRatMountText": "Rat",
|
||||||
"questEggRatAdjective": "dirty",
|
"questEggRatAdjective": "dirty",
|
||||||
|
|
||||||
"questEggOctopusText": "Octopus",
|
"questEggOctopusText": "Octopus",
|
||||||
|
"questEggOctopusMountText": "Octopus",
|
||||||
"questEggOctopusAdjective": "slippery",
|
"questEggOctopusAdjective": "slippery",
|
||||||
|
|
||||||
"questEggSeahorseText": "Seahorse",
|
"questEggSeahorseText": "Seahorse",
|
||||||
|
"questEggSeahorseMountText": "Seahorse",
|
||||||
"questEggSeahorseAdjective": "prize",
|
"questEggSeahorseAdjective": "prize",
|
||||||
|
|
||||||
"questEggParrotText": "Parrot",
|
"questEggParrotText": "Parrot",
|
||||||
|
"questEggParrotMountText": "Parrot",
|
||||||
"questEggParrotAdjective": "vibrant",
|
"questEggParrotAdjective": "vibrant",
|
||||||
|
|
||||||
"questEggRoosterText": "Rooster",
|
"questEggRoosterText": "Rooster",
|
||||||
|
"questEggRoosterMountText": "Rooster",
|
||||||
"questEggRoosterAdjective": "strutting",
|
"questEggRoosterAdjective": "strutting",
|
||||||
|
|
||||||
"questEggSpiderText": "Spider",
|
"questEggSpiderText": "Spider",
|
||||||
|
"questEggSpiderMountText": "Spider",
|
||||||
"questEggSpiderAdjective": "creepy",
|
"questEggSpiderAdjective": "creepy",
|
||||||
|
|
||||||
"questEggOwlText": "Owl",
|
"questEggOwlText": "Owl",
|
||||||
|
"questEggOwlMountText": "Owl",
|
||||||
"questEggOwlAdjective": "wise",
|
"questEggOwlAdjective": "wise",
|
||||||
|
|
||||||
"questEggPenguinText": "Penguin",
|
"questEggPenguinText": "Penguin",
|
||||||
|
"questEggPenguinMountText": "Penguin",
|
||||||
"questEggPenguinAdjective": "perspicacious",
|
"questEggPenguinAdjective": "perspicacious",
|
||||||
|
|
||||||
"questEggTRexText": "Tyrannosaur",
|
"questEggTRexText": "Tyrannosaur",
|
||||||
|
"questEggTRexMountText": "Tyrannosaur",
|
||||||
"questEggTRexAdjective": "tiny-armed",
|
"questEggTRexAdjective": "tiny-armed",
|
||||||
|
|
||||||
"questEggRockText": "Rock",
|
"questEggRockText": "Rock",
|
||||||
|
"questEggRockMountText": "Rock",
|
||||||
"questEggRockAdjective": "lively",
|
"questEggRockAdjective": "lively",
|
||||||
|
|
||||||
"questEggBunnyText": "Bunny",
|
"questEggBunnyText": "Bunny",
|
||||||
|
"questEggBunnyMountText": "Bunny",
|
||||||
"questEggBunnyAdjective": "snuggly",
|
"questEggBunnyAdjective": "snuggly",
|
||||||
|
|
||||||
"questEggSlimeText": "Marshmallow Slime",
|
"questEggSlimeText": "Marshmallow Slime",
|
||||||
|
"questEggSlimeMountText": "Marshmallow Slime",
|
||||||
"questEggSlimeAdjective": "sweet",
|
"questEggSlimeAdjective": "sweet",
|
||||||
|
|
||||||
"questEggSheepText": "Sheep",
|
"questEggSheepText": "Sheep",
|
||||||
|
"questEggSheepMountText": "Sheep",
|
||||||
"questEggSheepAdjective": "woolly",
|
"questEggSheepAdjective": "woolly",
|
||||||
|
|
||||||
"questEggCuttlefishText": "Cuttlefish",
|
"questEggCuttlefishText": "Cuttlefish",
|
||||||
|
"questEggCuttlefishMountText": "Cuttlefish",
|
||||||
"questEggCuttlefishAdjective": "cuddly",
|
"questEggCuttlefishAdjective": "cuddly",
|
||||||
|
|
||||||
"questEggWhaleText": "Whale",
|
"questEggWhaleText": "Whale",
|
||||||
|
"questEggWhaleMountText": "Whale",
|
||||||
"questEggWhaleAdjective": "splashy",
|
"questEggWhaleAdjective": "splashy",
|
||||||
|
|
||||||
"questEggCheetahText": "Cheetah",
|
"questEggCheetahText": "Cheetah",
|
||||||
|
"questEggCheetahMountText": "Cheetah",
|
||||||
"questEggCheetahAdjective": "honest",
|
"questEggCheetahAdjective": "honest",
|
||||||
|
|
||||||
"questEggHorseText": "Horse",
|
"questEggHorseText": "Horse",
|
||||||
|
"questEggHorseMountText": "Horse",
|
||||||
"questEggHorseAdjective": "galloping",
|
"questEggHorseAdjective": "galloping",
|
||||||
|
|
||||||
"eggNotes": "Find a hatching potion to pour on this egg, and it will hatch into a <%= eggAdjective(locale) %> <%= eggText(locale) %>.",
|
"eggNotes": "Find a hatching potion to pour on this egg, and it will hatch into a <%= eggAdjective(locale) %> <%= eggText(locale) %>.",
|
||||||
|
|||||||
@@ -572,81 +572,27 @@ eggs = require('../../dist/scripts/content/eggs/index')
|
|||||||
|
|
||||||
api.dropEggs = eggs.dropEggs
|
api.dropEggs = eggs.dropEggs
|
||||||
|
|
||||||
api.questEggs =
|
api.questEggs = eggs.questEggs
|
||||||
# value & other defaults set below
|
|
||||||
Gryphon: text: t('questEggGryphonText'), adjective: t('questEggGryphonAdjective'), canBuy: false
|
|
||||||
Hedgehog: text: t('questEggHedgehogText'), adjective: t('questEggHedgehogAdjective'), canBuy: false
|
|
||||||
Deer: text: t('questEggDeerText'), adjective: t('questEggDeerAdjective'), canBuy: false
|
|
||||||
Egg: text: t('questEggEggText'), adjective: t('questEggEggAdjective'), canBuy: false, mountText: t('questEggEggMountText')
|
|
||||||
Rat: text: t('questEggRatText'), adjective: t('questEggRatAdjective'), canBuy: false
|
|
||||||
Octopus: text: t('questEggOctopusText'), adjective: t('questEggOctopusAdjective'), canBuy: false
|
|
||||||
Seahorse: text: t('questEggSeahorseText'), adjective: t('questEggSeahorseAdjective'), canBuy: false
|
|
||||||
Parrot: text: t('questEggParrotText'), adjective: t('questEggParrotAdjective'), canBuy: false
|
|
||||||
Rooster: text: t('questEggRoosterText'), adjective: t('questEggRoosterAdjective'), canBuy: false
|
|
||||||
Spider: text: t('questEggSpiderText'), adjective: t('questEggSpiderAdjective'), canBuy: false
|
|
||||||
Owl: text: t('questEggOwlText'), adjective: t('questEggOwlAdjective'), canBuy: false
|
|
||||||
Penguin: text: t('questEggPenguinText'), adjective: t('questEggPenguinAdjective'), canBuy: false
|
|
||||||
TRex: text: t('questEggTRexText'), adjective: t('questEggTRexAdjective'), canBuy: false
|
|
||||||
Rock: text: t('questEggRockText'), adjective: t('questEggRockAdjective'), canBuy: false
|
|
||||||
Bunny: text: t('questEggBunnyText'), adjective: t('questEggBunnyAdjective'), canBuy: false
|
|
||||||
Slime: text: t('questEggSlimeText'), adjective: t('questEggSlimeAdjective'), canBuy: false
|
|
||||||
Sheep: text: t('questEggSheepText'), adjective: t('questEggSheepAdjective'), canBuy: false
|
|
||||||
Cuttlefish: text: t('questEggCuttlefishText'), adjective: t('questEggCuttlefishAdjective'), canBuy: false
|
|
||||||
Whale: text: t('questEggWhaleText'), adjective: t('questEggWhaleAdjective'), canBuy: false
|
|
||||||
Cheetah: text: t('questEggCheetahText'), adjective: t('questEggCheetahAdjective'), canBuy: false
|
|
||||||
Horse: text: t('questEggHorseText'), adjective: t('questEggHorseAdjective'), canBuy: false
|
|
||||||
|
|
||||||
_.each api.questEggs, (egg,key) ->
|
api.eggs = eggs.allEggs
|
||||||
_.defaults egg,
|
|
||||||
canBuy:false
|
|
||||||
value: 3
|
|
||||||
key: key
|
|
||||||
notes: t('eggNotes', {eggText: egg.text, eggAdjective: egg.adjective})
|
|
||||||
mountText: egg.text
|
|
||||||
|
|
||||||
api.eggs = _.assign(_.cloneDeep(api.dropEggs), api.questEggs)
|
pets_mounts = require('../../dist/scripts/content/pets-mounts/index')
|
||||||
|
|
||||||
# special pets & mounts are {key:i18n}
|
api.specialPets = pets_mounts.specialPets
|
||||||
api.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'
|
|
||||||
|
|
||||||
api.specialMounts =
|
api.specialMounts = pets_mounts.specialMounts
|
||||||
'BearCub-Polar': 'polarBear'
|
|
||||||
'LionCub-Ethereal': 'etherealLion'
|
|
||||||
'MantisShrimp-Base': 'mantisShrimp'
|
|
||||||
'Turkey-Base': 'turkey'
|
|
||||||
'Mammoth-Base': 'mammoth'
|
|
||||||
'Orca-Base': 'orca'
|
|
||||||
'Gryphon-RoyalPurple': 'royalPurpleGryphon'
|
|
||||||
|
|
||||||
api.timeTravelStable = require('../../dist/scripts/content/time-traveler-stable')
|
api.timeTravelStable = require('../../dist/scripts/content/time-traveler-stable')
|
||||||
|
|
||||||
api.hatchingPotions = require('../../dist/scripts/content/hatching-potions')
|
api.hatchingPotions = require('../../dist/scripts/content/hatching-potions')
|
||||||
|
|
||||||
api.pets = _.transform api.dropEggs, (m, egg) ->
|
api.pets = pets_mounts.dropPets
|
||||||
_.defaults m, _.transform api.hatchingPotions, (m2, pot) ->
|
|
||||||
m2[egg.key + "-" + pot.key] = true
|
|
||||||
|
|
||||||
api.questPets = _.transform api.questEggs, (m, egg) ->
|
api.questPets = pets_mounts.questPets
|
||||||
_.defaults m, _.transform api.hatchingPotions, (m2, pot) ->
|
|
||||||
m2[egg.key + "-" + pot.key] = true
|
|
||||||
|
|
||||||
## added for mountmaster -- yes, the transforms are correct, since the same strings are used for both pets and mounts
|
api.mounts = pets_mounts.dropMounts
|
||||||
api.mounts = _.transform api.dropEggs, (m, egg) ->
|
|
||||||
_.defaults m, _.transform api.hatchingPotions, (m2, pot) ->
|
|
||||||
m2[egg.key + "-" + pot.key] = true
|
|
||||||
|
|
||||||
api.questMounts = _.transform api.questEggs, (m, egg) ->
|
api.questMounts = pets_mounts.questMounts
|
||||||
_.defaults m, _.transform api.hatchingPotions, (m2, pot) ->
|
|
||||||
m2[egg.key + "-" + pot.key] = true
|
|
||||||
|
|
||||||
api.food = require('../../dist/scripts/content/food/index')
|
api.food = require('../../dist/scripts/content/food/index')
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {each} from 'lodash';
|
import {each, defaults} from 'lodash';
|
||||||
import t from '../helpers/translator';
|
import t from '../helpers/translator';
|
||||||
|
|
||||||
const DROP_EGGS = [
|
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;
|
export default eggs;
|
||||||
|
|||||||
@@ -1,23 +1,15 @@
|
|||||||
// value & other defaults set below
|
import {assign} from 'lodash';
|
||||||
let each = require('lodash').each;
|
|
||||||
let defaults = require('lodash').defaults;
|
|
||||||
let t = require('../helpers/translator');
|
|
||||||
|
|
||||||
let dropEggs = require('./drops');
|
import dropEggs from './drops';
|
||||||
|
import questEggs from './quest';
|
||||||
|
|
||||||
each(dropEggs, (egg, key) => {
|
let allEggs = {};
|
||||||
return defaults(egg, {
|
|
||||||
canBuy: true,
|
assign(allEggs, dropEggs);
|
||||||
value: 3,
|
assign(allEggs, questEggs);
|
||||||
key: key,
|
|
||||||
notes: t('eggNotes', {
|
|
||||||
eggText: egg.text,
|
|
||||||
eggAdjective: egg.adjective
|
|
||||||
}),
|
|
||||||
mountText: egg.text
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
dropEggs: dropEggs
|
allEggs: allEggs,
|
||||||
|
dropEggs: dropEggs,
|
||||||
|
questEggs: questEggs,
|
||||||
}
|
}
|
||||||
|
|||||||
50
common/script/src/content/eggs/quest.js
Normal file
50
common/script/src/content/eggs/quest.js
Normal 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;
|
||||||
29
common/script/src/content/pets-mounts/index.js
Normal file
29
common/script/src/content/pets-mounts/index.js
Normal 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,
|
||||||
|
}
|
||||||
13
common/script/src/content/pets-mounts/special-mounts.js
Normal file
13
common/script/src/content/pets-mounts/special-mounts.js
Normal 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;
|
||||||
15
common/script/src/content/pets-mounts/special-pets.js
Normal file
15
common/script/src/content/pets-mounts/special-pets.js
Normal 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;
|
||||||
Reference in New Issue
Block a user