fix(event): include stable

This commit is contained in:
Sabe Jones
2019-04-01 10:24:55 -05:00
parent 7b2081ab03
commit 07e4b2c463
2 changed files with 13 additions and 2 deletions

View File

@@ -2,6 +2,9 @@
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 dropPets = Object.keys(content.pets);
function getText (textOrFunction) {
if (textOrFunction instanceof Function) {
@@ -33,10 +36,18 @@ export function isSpecial (animal) {
export function createAnimal (egg, potion, type, _content, userItems) {
let animalKey = `${egg.key}-${potion.key}`;
let fooledKey = '';
if (questPets.includes(animalKey)) {
fooledKey = 'Fox-Veggie';
} else if (dropPets.includes(animalKey) || premiumPets.includes(animalKey)) {
fooledKey = `${egg.key}-Veggie`;
} else {
fooledKey = animalKey;
}
return {
key: animalKey,
class: type === 'pet' ? `Pet Pet-${animalKey}` : `Mount_Icon_${animalKey}`,
class: type === 'pet' ? `Pet Pet-${fooledKey}` : `Mount_Icon_${animalKey}`,
eggKey: egg.key,
eggName: getText(egg.text),
potionKey: potion.key,
@@ -59,4 +70,3 @@ export function createAnimal (egg, potion, type, _content, userItems) {
},
};
}

View File

@@ -44,6 +44,7 @@ api.getNews = {
<h3>Special April Fool's Social Media Challenge!</h3>
<p>For even more fun, check out the <a href='/challenges/b0337534-ec69-4269-8cc6-f74c91881451'>official Challenge</a> posted especially for today! Share your avatar featuring your new fruit and veggie pet on social media between now and April 3, and you'll have a chance to win gems and have your avatar featured on the Habitica Blog!</p>
<div class="small mb-3">by Beffymaroo, SabreCat, Piyo, Viirus, and Lemoness</div>
<div class="npc_aprilFool center-block"></div>
</div>
`,
});