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;
|
height: 219px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.Pet_HatchingPotion_Veggie {
|
||||||
|
background: url("~assets/images/Pet_HatchingPotion_Veggie.gif") no-repeat;
|
||||||
|
width: 68px;
|
||||||
|
height: 68px;
|
||||||
|
}
|
||||||
|
|
||||||
.Gems {
|
.Gems {
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
margin-right:5px;
|
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)"
|
@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') }}
|
| {{ $_openedItemRows_isToggled(petGroup.key) ? $t('showLess') : $t('showMore') }}
|
||||||
|
|
||||||
h2
|
h2
|
||||||
@@ -462,6 +462,14 @@
|
|||||||
potions: this.content.dropHatchingPotions,
|
potions: this.content.dropHatchingPotions,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('filterByWacky'),
|
||||||
|
key: 'wackyPets',
|
||||||
|
petSource: {
|
||||||
|
eggs: this.content.dropEggs,
|
||||||
|
potions: this.content.wackyHatchingPotions,
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('special'),
|
label: this.$t('special'),
|
||||||
key: 'specialPets',
|
key: 'specialPets',
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import content from 'common/script/content';
|
import content from 'common/script/content';
|
||||||
|
|
||||||
const specialPets = Object.keys(content.specialPets);
|
const specialPets = Object.keys(content.specialPets);
|
||||||
|
const wackyPets = Object.keys(content.wackyPets);
|
||||||
|
|
||||||
function getText (textOrFunction) {
|
function getText (textOrFunction) {
|
||||||
if (textOrFunction instanceof Function) {
|
if (textOrFunction instanceof Function) {
|
||||||
@@ -23,6 +24,7 @@ export function isHatchable (animal, userItems) {
|
|||||||
|
|
||||||
export function isAllowedToFeed (animal, userItems) {
|
export function isAllowedToFeed (animal, userItems) {
|
||||||
return !specialPets.includes(animal.key) &&
|
return !specialPets.includes(animal.key) &&
|
||||||
|
!wackyPets.includes(animal.key) &&
|
||||||
isOwned('pet', animal, userItems) &&
|
isOwned('pet', animal, userItems) &&
|
||||||
!isOwned('mount', 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",
|
"hatchingPotionIcySnow": "Icy Snow",
|
||||||
"hatchingPotionRoseQuartz": "Rose Quartz",
|
"hatchingPotionRoseQuartz": "Rose Quartz",
|
||||||
"hatchingPotionCelestial": "Celestial",
|
"hatchingPotionCelestial": "Celestial",
|
||||||
|
"hatchingPotionVeggie": "Veggie",
|
||||||
|
|
||||||
"hatchingPotionNotes": "Pour this on an egg, and it will hatch as a <%= potText(locale) %> pet.",
|
"hatchingPotionNotes": "Pour this on an egg, and it will hatch as a <%= potText(locale) %> pet.",
|
||||||
"premiumPotionAddlNotes": "Not usable on quest pet eggs.",
|
"premiumPotionAddlNotes": "Not usable on quest pet eggs.",
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"magicPets": "Magic Potion Pets",
|
"magicPets": "Magic Potion Pets",
|
||||||
"rarePets": "Rare Pets",
|
"rarePets": "Rare Pets",
|
||||||
"questPets": "Quest Pets",
|
"questPets": "Quest Pets",
|
||||||
|
"wackyPets": "Wacky Pets",
|
||||||
"mounts": "Mounts",
|
"mounts": "Mounts",
|
||||||
"activeMount": "Active Mount",
|
"activeMount": "Active Mount",
|
||||||
"noActiveMount": "No Active Mount",
|
"noActiveMount": "No Active Mount",
|
||||||
@@ -129,6 +130,7 @@
|
|||||||
"filterByStandard": "Standard",
|
"filterByStandard": "Standard",
|
||||||
"filterByMagicPotion": "Magic Potion",
|
"filterByMagicPotion": "Magic Potion",
|
||||||
"filterByQuest": "Quest",
|
"filterByQuest": "Quest",
|
||||||
|
"filterByWacky": "Wacky",
|
||||||
"standard": "Standard",
|
"standard": "Standard",
|
||||||
"sortByColor": "Color",
|
"sortByColor": "Color",
|
||||||
"sortByHatchable": "Hatchable",
|
"sortByHatchable": "Hatchable",
|
||||||
|
|||||||
@@ -170,6 +170,14 @@ let premium = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const wacky = {
|
||||||
|
Veggie: {
|
||||||
|
text: t('hatchingPotionVeggie'),
|
||||||
|
limited: true,
|
||||||
|
_season: 'March',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
each(drops, (pot, key) => {
|
each(drops, (pot, key) => {
|
||||||
defaults(pot, {
|
defaults(pot, {
|
||||||
key,
|
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 = {
|
module.exports = {
|
||||||
drops,
|
drops,
|
||||||
premium,
|
premium,
|
||||||
|
wacky,
|
||||||
all,
|
all,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -356,12 +356,14 @@ api.timeTravelStable = {
|
|||||||
|
|
||||||
api.dropHatchingPotions = hatchingPotions.drops;
|
api.dropHatchingPotions = hatchingPotions.drops;
|
||||||
api.premiumHatchingPotions = hatchingPotions.premium;
|
api.premiumHatchingPotions = hatchingPotions.premium;
|
||||||
|
api.wackyHatchingPotions = hatchingPotions.wacky;
|
||||||
api.hatchingPotions = hatchingPotions.all;
|
api.hatchingPotions = hatchingPotions.all;
|
||||||
|
|
||||||
api.pets = stable.dropPets;
|
api.pets = stable.dropPets;
|
||||||
api.premiumPets = stable.premiumPets;
|
api.premiumPets = stable.premiumPets;
|
||||||
api.questPets = stable.questPets;
|
api.questPets = stable.questPets;
|
||||||
api.specialPets = stable.specialPets;
|
api.specialPets = stable.specialPets;
|
||||||
|
api.wackyPets = stable.wackyPets;
|
||||||
api.petInfo = stable.petInfo;
|
api.petInfo = stable.petInfo;
|
||||||
|
|
||||||
api.mounts = stable.dropMounts;
|
api.mounts = stable.dropMounts;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
drops as dropPotions,
|
drops as dropPotions,
|
||||||
premium as premiumPotions,
|
premium as premiumPotions,
|
||||||
|
wacky as wackyPotions,
|
||||||
} from './hatching-potions';
|
} from './hatching-potions';
|
||||||
import t from './translation';
|
import t from './translation';
|
||||||
|
|
||||||
@@ -47,9 +48,38 @@ function constructSet (type, eggs, potions) {
|
|||||||
return [pets, mounts];
|
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 [dropPets, dropMounts] = constructSet('drop', dropEggs, dropPotions);
|
||||||
let [premiumPets, premiumMounts] = constructSet('premium', dropEggs, premiumPotions);
|
let [premiumPets, premiumMounts] = constructSet('premium', dropEggs, premiumPotions);
|
||||||
let [questPets, questMounts] = constructSet('quest', questEggs, dropPotions);
|
let [questPets, questMounts] = constructSet('quest', questEggs, dropPotions);
|
||||||
|
let wackyPets = constructPetOnlySet('wacky', dropEggs, wackyPotions);
|
||||||
|
|
||||||
let specialPets = {
|
let specialPets = {
|
||||||
'Wolf-Veteran': 'veteranWolf',
|
'Wolf-Veteran': 'veteranWolf',
|
||||||
@@ -113,6 +143,7 @@ module.exports = {
|
|||||||
dropPets,
|
dropPets,
|
||||||
premiumPets,
|
premiumPets,
|
||||||
questPets,
|
questPets,
|
||||||
|
wackyPets,
|
||||||
dropMounts,
|
dropMounts,
|
||||||
questMounts,
|
questMounts,
|
||||||
premiumMounts,
|
premiumMounts,
|
||||||
|
|||||||
@@ -316,7 +316,8 @@ let schema = new Schema({
|
|||||||
// Then add additional pets (quest, backer, contributor, premium)
|
// Then add additional pets (quest, backer, contributor, premium)
|
||||||
_.transform(shared.content.questPets, (m, v, k) => m[k] = Number),
|
_.transform(shared.content.questPets, (m, v, k) => m[k] = Number),
|
||||||
_.transform(shared.content.specialPets, (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
|
currentPet: String, // Cactus-Desert
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user