mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 13:47:33 +01:00
feat(content): Veggie Hatching Potions
This commit is contained in:
@@ -10,8 +10,8 @@
|
||||
height: 219px;
|
||||
}
|
||||
|
||||
.Pet-HatchingPotion-Veggie {
|
||||
background: url("~assets/images/Pet-HatchingPotion-Veggie.gif") no-repeat;
|
||||
.Pet_HatchingPotion_Veggie {
|
||||
background: url("~assets/images/Pet_HatchingPotion_Veggie.gif") no-repeat;
|
||||
width: 68px;
|
||||
height: 68px;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -98,7 +98,7 @@
|
||||
@click="selectPet(context.item)"
|
||||
)
|
||||
|
||||
.btn.btn-flat.btn-show-more(@click="setShowMore(petGroup.key)", v-if='petGroup.key !== "specialPets"')
|
||||
.btn.btn-flat.btn-show-more(@click="setShowMore(petGroup.key)", v-if='petGroup.key !== "specialPets" && petGroup.key !== "wackyPets"')
|
||||
| {{ $_openedItemRows_isToggled(petGroup.key) ? $t('showLess') : $t('showMore') }}
|
||||
|
||||
h2
|
||||
@@ -462,6 +462,14 @@
|
||||
potions: this.content.dropHatchingPotions,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: this.$t('filterByWacky'),
|
||||
key: 'wackyPets',
|
||||
petSource: {
|
||||
eggs: this.content.dropEggs,
|
||||
potions: this.content.wackyHatchingPotions,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: this.$t('special'),
|
||||
key: 'specialPets',
|
||||
|
||||
@@ -4,6 +4,7 @@ import content from 'common/script/content';
|
||||
const specialPets = Object.keys(content.specialPets);
|
||||
const premiumPets = Object.keys(content.premiumPets);
|
||||
const questPets = Object.keys(content.questPets);
|
||||
const wackyPets = Object.keys(content.wackyPets);
|
||||
const dropPets = Object.keys(content.pets);
|
||||
|
||||
function getText (textOrFunction) {
|
||||
@@ -26,6 +27,7 @@ export function isHatchable (animal, userItems) {
|
||||
|
||||
export function isAllowedToFeed (animal, userItems) {
|
||||
return !specialPets.includes(animal.key) &&
|
||||
!wackyPets.includes(animal.key) &&
|
||||
isOwned('pet', animal, userItems) &&
|
||||
!isOwned('mount', animal, userItems);
|
||||
}
|
||||
|
||||
@@ -281,6 +281,7 @@
|
||||
"hatchingPotionIcySnow": "Icy Snow",
|
||||
"hatchingPotionRoseQuartz": "Rose Quartz",
|
||||
"hatchingPotionCelestial": "Celestial",
|
||||
"hatchingPotionVeggie": "Veggie",
|
||||
|
||||
"hatchingPotionNotes": "Pour this on an egg, and it will hatch as a <%= potText(locale) %> pet.",
|
||||
"premiumPotionAddlNotes": "Not usable on quest pet eggs.",
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"magicPets": "Magic Potion Pets",
|
||||
"rarePets": "Rare Pets",
|
||||
"questPets": "Quest Pets",
|
||||
"wackyPets": "Wacky Pets",
|
||||
"mounts": "Mounts",
|
||||
"activeMount": "Active Mount",
|
||||
"noActiveMount": "No Active Mount",
|
||||
@@ -129,6 +130,7 @@
|
||||
"filterByStandard": "Standard",
|
||||
"filterByMagicPotion": "Magic Potion",
|
||||
"filterByQuest": "Quest",
|
||||
"filterByWacky": "Wacky",
|
||||
"standard": "Standard",
|
||||
"sortByColor": "Color",
|
||||
"sortByHatchable": "Hatchable",
|
||||
|
||||
@@ -229,7 +229,7 @@ each(wacky, (pot, key) => {
|
||||
});
|
||||
});
|
||||
|
||||
let all = assign({}, drops, premium);
|
||||
let all = assign({}, drops, premium, wacky);
|
||||
|
||||
module.exports = {
|
||||
drops,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -316,7 +316,8 @@ let schema = new Schema({
|
||||
// Then add additional pets (quest, backer, contributor, premium)
|
||||
_.transform(shared.content.questPets, (m, v, k) => m[k] = Number),
|
||||
_.transform(shared.content.specialPets, (m, v, k) => m[k] = Number),
|
||||
_.transform(shared.content.premiumPets, (m, v, k) => m[k] = Number)
|
||||
_.transform(shared.content.premiumPets, (m, v, k) => m[k] = Number),
|
||||
_.transform(shared.content.wackyPets, (m, v, k) => m[k] = Number)
|
||||
),
|
||||
currentPet: String, // Cactus-Desert
|
||||
|
||||
|
||||
Reference in New Issue
Block a user