mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 21:57:22 +01:00
Merge branch 'sabrecat/20190401' into sabrecat/veggie-potions
This commit is contained in:
@@ -10,6 +10,12 @@
|
||||
height: 219px;
|
||||
}
|
||||
|
||||
.Pet_HatchingPotion_Veggie {
|
||||
background: url("~assets/images/Pet_HatchingPotion_Veggie.gif") no-repeat;
|
||||
width: 68px;
|
||||
height: 68px;
|
||||
}
|
||||
|
||||
.Gems {
|
||||
display:inline-block;
|
||||
margin-right:5px;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 344 KiB After Width: | Height: | Size: 360 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',
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import content from 'common/script/content';
|
||||
|
||||
const specialPets = Object.keys(content.specialPets);
|
||||
const wackyPets = Object.keys(content.wackyPets);
|
||||
|
||||
function getText (textOrFunction) {
|
||||
if (textOrFunction instanceof Function) {
|
||||
@@ -23,6 +24,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);
|
||||
}
|
||||
@@ -59,4 +61,3 @@ export function createAnimal (egg, potion, type, _content, 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",
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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