feat(pets): Peppermint Hatching Potions

Also fixes an issue where the pet hatching modal would appear when the user attempted to hatch a premium version of a quest pet.
This commit is contained in:
Sabe Jones
2015-12-04 17:20:33 -05:00
parent a3665e7095
commit 0f578b79ff
45 changed files with 3317 additions and 3108 deletions

View File

@@ -0,0 +1,84 @@
.Pet-Wolf-White {
background-image: url(spritesmith-main-10.png);
background-position: 0px 0px;
width: 81px;
height: 99px;
}
.Pet-Wolf-Zombie {
background-image: url(spritesmith-main-10.png);
background-position: -82px 0px;
width: 81px;
height: 99px;
}
.Pet_HatchingPotion_Base {
background-image: url(spritesmith-main-10.png);
background-position: 0px -100px;
width: 48px;
height: 51px;
}
.Pet_HatchingPotion_CottonCandyBlue {
background-image: url(spritesmith-main-10.png);
background-position: -49px -100px;
width: 48px;
height: 51px;
}
.Pet_HatchingPotion_CottonCandyPink {
background-image: url(spritesmith-main-10.png);
background-position: -98px -100px;
width: 48px;
height: 51px;
}
.Pet_HatchingPotion_Desert {
background-image: url(spritesmith-main-10.png);
background-position: -164px 0px;
width: 48px;
height: 51px;
}
.Pet_HatchingPotion_Golden {
background-image: url(spritesmith-main-10.png);
background-position: -164px -52px;
width: 48px;
height: 51px;
}
.Pet_HatchingPotion_Peppermint {
background-image: url(spritesmith-main-10.png);
background-position: -213px -104px;
width: 48px;
height: 51px;
}
.Pet_HatchingPotion_Red {
background-image: url(spritesmith-main-10.png);
background-position: -49px -152px;
width: 48px;
height: 51px;
}
.Pet_HatchingPotion_Shade {
background-image: url(spritesmith-main-10.png);
background-position: -98px -152px;
width: 48px;
height: 51px;
}
.Pet_HatchingPotion_Skeleton {
background-image: url(spritesmith-main-10.png);
background-position: -147px -152px;
width: 48px;
height: 51px;
}
.Pet_HatchingPotion_Spooky {
background-image: url(spritesmith-main-10.png);
background-position: -213px 0px;
width: 48px;
height: 51px;
}
.Pet_HatchingPotion_White {
background-image: url(spritesmith-main-10.png);
background-position: -213px -52px;
width: 48px;
height: 51px;
}
.Pet_HatchingPotion_Zombie {
background-image: url(spritesmith-main-10.png);
background-position: 0px -152px;
width: 48px;
height: 51px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 152 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 145 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 KiB

After

Width:  |  Height:  |  Size: 139 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -156,6 +156,7 @@
"hatchingPotionCottonCandyBlue": "Cotton Candy Blue",
"hatchingPotionGolden": "Golden",
"hatchingPotionSpooky": "Spooky",
"hatchingPotionPeppermint": "Peppermint",
"hatchingPotionNotes": "Pour this on an egg, and it will hatch as a <%= potText(locale) %> pet.",
"premiumPotionAddlNotes": "Not usable on quest pet eggs.",

View File

@@ -62,5 +62,6 @@
"witchyWizardSet": "Witchy Wizard (Mage)",
"mummyMedicSet": "Mummy Medic (Healer)",
"vampireSmiterSet": "Vampire Smiter (Rogue)",
"fallEventAvailability": "Available until October 31"
"fallEventAvailability": "Available until October 31",
"winterEventAvailability": "Available until December 31"
}

View File

@@ -1030,6 +1030,14 @@ api.premiumHatchingPotions = {
canBuy: (function() {
return false;
})
},
Peppermint: {
value: 2,
text: t('hatchingPotionPeppermint'),
limited: true,
canBuy: (function() {
return true;
})
}
};

View File

@@ -89,17 +89,18 @@ describe('Inventory Controller', function() {
});
it('does not show modal if user tries to hatch a pet they own', function(){
user.items.pets['Cactus-Base'] = 5;
scope.chooseEgg('Cactus');
scope.choosePotion('Base');
expect(user.items.eggs).to.eql({Cactus: 0});
expect(user.items.hatchingPotions).to.eql({Base: 0});
expect(user.items.pets).to.eql({'Cactus-Base': 5});
expect(scope.selectedEgg).to.eql(null);
expect(scope.selectedPotion).to.eql(null);
expect(rootScope.openModal).to.have.been.calledOnce;
scope.chooseEgg('Cactus');
scope.choosePotion('Base');
expect(rootScope.openModal).to.not.have.been.calledTwice;
expect(rootScope.openModal).to.not.have.been.called;
});
it('does not show modal if user tries to hatch a premium quest pet', function(){
user.items.eggs = {Snake: 1};
user.items.hatchingPotions = {Peppermint: 1};
scope.chooseEgg('Snake');
scope.choosePotion('Peppermint');
expect(rootScope.openModal).to.not.have.been.called;
});
it('does not show pet hatching modal if user has opted out', function(){

View File

@@ -115,11 +115,12 @@ habitrpg.controller("InventoryCtrl",
var potName = Content.hatchingPotions[potion.key].text();
if (!$window.confirm(window.env.t('hatchAPot', {potion: potName, egg: eggName}))) return;
var userHasPet = user.items.pets[egg.key + '-' + potion.key] > 0;
var invalidPet = (user.items.pets[egg.key + '-' + potion.key] > 0) ||
(Content.hatchingPotions[potion.key].premium && !Content.dropEggs[egg.key])
user.ops.hatch({params:{egg:egg.key, hatchingPotion:potion.key}});
if (!user.preferences.suppressModals.hatchPet && !userHasPet) {
if (!user.preferences.suppressModals.hatchPet && !invalidPet) {
$scope.hatchedPet = {
egg: eggName,
potion: potName,

View File

@@ -136,6 +136,19 @@
| {{::pot.value}}&nbsp;
span.Pet_Currency_Gem1x.inline-gems
li.customize-menu
menu.pets-menu!=env.t('magicHatchingPotions') + " - " + env.t('winterEventAvailability')
p.muted=env.t('premiumPotionNoDropExplanation')
div(ng-repeat='pot in Content.hatchingPotions', ng-if='pot.premium && pot.canBuy(user)')
button.customize-option(class='Pet_HatchingPotion_{{::pot.key}}',
popover='{{::pot.notes()}} {{::pot.addlNotes()}}', popover-append-to-body='true',
popover-title!=env.t("potion", {potionType: "{{::pot.text()}}"}),
popover-trigger='mouseenter', popover-placement='top',
ng-click='purchase("hatchingPotions", pot)')
p
| {{::pot.value}}&nbsp;
span.Pet_Currency_Gem1x.inline-gems
li.customize-menu
menu.pets-menu(label=env.t('food'))
p.muted!=env.t('dropsExplanation')

View File

@@ -1,5 +1,27 @@
h2 12/1/2015 - DECEMBER ARMOIRE ITEMS, BACKGROUNDS, MYSTERY BOX, AND GAYMERX ARMOR!
h2 12/7/2015 - PEPPERMINT PETS AND PUSH TASK TO BOTTOM!
hr
tr
td
.Pet-Wolf-Peppermint.pull-right
h3 Peppermint Magic Hatching Potions
p A new Magic Hatching Potion is available!
br
p Between now and December 31st, you can buy Peppermint Hatching Potions from <a href='/#/options/inventory/drops'>the Market</a> and use them to hatch any standard pet egg. (Magic Hatching Potions do not work on Quest Pet eggs.) You'll find it very easy to care for your new Peppermint Pets: they love to eat every kind of food!
br
p Peppermint Hatching Potions are a Seasonal Edition item, so they will only be available during this time each year! Be sure to get them while you can.
p.small.muted by Lemoness
tr
td
h3 Push Task to Bottom
p Now you can easily push a task to the bottom of a list! Hold the Control or Command key, and the Push Task to Top icon will switch to a Push Task to Bottom icon. Click that and down goes the task!
p.small.muted by TheHollidayInn
if menuItem !== 'oldNews'
hr
a(href='/static/old-news', target='_blank') Read older news
mixin oldNews
h2 12/1/2015 - DECEMBER ARMOIRE ITEMS, BACKGROUNDS, MYSTERY BOX, AND GAYMERX ARMOR!
tr
td
.weapon_armoire_blueLongbow.pull-right
@@ -28,12 +50,6 @@ h2 12/1/2015 - DECEMBER ARMOIRE ITEMS, BACKGROUNDS, MYSTERY BOX, AND GAYMERX ARM
.head_special_gaymerx.pull-right
h3 GaymerX Armor
p In honor of Habitica's partnership with the GaymerX3 Conference (December 11-13, in downtown San Jose), the Rainbow Warrior set is available once again from the Rewards column! It will only be available until December 14th, so be sure to get it now. Plus, the Unconventional Armor set will be available at the conference, so don't forget to pick up a promo card if you attend!
if menuItem !== 'oldNews'
hr
a(href='/static/old-news', target='_blank') Read older news
mixin oldNews
h2 11/25/2015 - HABITICA THANKSGIVING! NOVEMBER SUBSCRIBER ITEM AND TURKEY PETS AND MOUNTS
tr
td