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", "hatchingPotionCottonCandyBlue": "Cotton Candy Blue",
"hatchingPotionGolden": "Golden", "hatchingPotionGolden": "Golden",
"hatchingPotionSpooky": "Spooky", "hatchingPotionSpooky": "Spooky",
"hatchingPotionPeppermint": "Peppermint",
"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.",

View File

@@ -62,5 +62,6 @@
"witchyWizardSet": "Witchy Wizard (Mage)", "witchyWizardSet": "Witchy Wizard (Mage)",
"mummyMedicSet": "Mummy Medic (Healer)", "mummyMedicSet": "Mummy Medic (Healer)",
"vampireSmiterSet": "Vampire Smiter (Rogue)", "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() { canBuy: (function() {
return false; 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(){ 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.chooseEgg('Cactus');
scope.choosePotion('Base'); scope.choosePotion('Base');
expect(user.items.eggs).to.eql({Cactus: 0}); expect(rootScope.openModal).to.not.have.been.called;
expect(user.items.hatchingPotions).to.eql({Base: 0}); });
expect(user.items.pets).to.eql({'Cactus-Base': 5});
expect(scope.selectedEgg).to.eql(null); it('does not show modal if user tries to hatch a premium quest pet', function(){
expect(scope.selectedPotion).to.eql(null); user.items.eggs = {Snake: 1};
expect(rootScope.openModal).to.have.been.calledOnce; user.items.hatchingPotions = {Peppermint: 1};
scope.chooseEgg('Cactus'); scope.chooseEgg('Snake');
scope.choosePotion('Base'); scope.choosePotion('Peppermint');
expect(rootScope.openModal).to.not.have.been.calledTwice; expect(rootScope.openModal).to.not.have.been.called;
}); });
it('does not show pet hatching modal if user has opted out', function(){ 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(); var potName = Content.hatchingPotions[potion.key].text();
if (!$window.confirm(window.env.t('hatchAPot', {potion: potName, egg: eggName}))) return; 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}}); user.ops.hatch({params:{egg:egg.key, hatchingPotion:potion.key}});
if (!user.preferences.suppressModals.hatchPet && !userHasPet) { if (!user.preferences.suppressModals.hatchPet && !invalidPet) {
$scope.hatchedPet = { $scope.hatchedPet = {
egg: eggName, egg: eggName,
potion: potName, potion: potName,

View File

@@ -136,6 +136,19 @@
| {{::pot.value}}&nbsp; | {{::pot.value}}&nbsp;
span.Pet_Currency_Gem1x.inline-gems 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 li.customize-menu
menu.pets-menu(label=env.t('food')) menu.pets-menu(label=env.t('food'))
p.muted!=env.t('dropsExplanation') p.muted!=env.t('dropsExplanation')

View File

@@ -1,39 +1,55 @@
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 hr
tr tr
td td
.weapon_armoire_blueLongbow.pull-right .Pet-Wolf-Peppermint.pull-right
h3 December Armoire Items h3 Peppermint Magic Hatching Potions
p There is new equipment in Enchanted Armoire, a 100 GP Reward in the Rewards Column which unlocks after you've attained Ultimate Gear! p A new Magic Hatching Potion is available!
br br
p Click on the Enchanted Armoire for a random chance at special Equipment, including the Crystal Crescent Set and the Blue Longbow! It may also give you random XP or food items. We'll be adding new equipment to it during the first week of each month, but even when you've exhausted the current supply, you can keep clicking for a chance at food and XP. 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 br
p Now go spend all that accumulated Gold! May the Random Number Generator smile upon you... 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 and SabreCat
p.small.muted Art by starsystemic, Fandekasp, and nonight
tr
td
.background_winter_town.pull-right
h3 December Backgrounds
p There are three new avatar backgrounds in the <a href='/#/options/profile/backgrounds'>Background Shop!</a> Now your avatar can ski on the Alpine Slopes, gaze at the Snowy Sunrise, or bustle through a Winter Town!
p.small.muted by Karithina, Inventrix, and Midori88
tr
td
.inventory_present_12.pull-right
h3 December Mystery Box
p Ooh... What could it be? All Habiticans who are <a href='/#/options/settings/subscription'>subscribed</a> during the month of December will receive the 2015 December Mystery Item Set! It will be revealed on the 23rd, so keep your eyes peeled. Thanks for supporting the site <3
p.small.muted by Lemoness p.small.muted by Lemoness
tr tr
td td
.head_special_gaymerx.pull-right h3 Push Task to Bottom
h3 GaymerX Armor 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 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! p.small.muted by TheHollidayInn
if menuItem !== 'oldNews' if menuItem !== 'oldNews'
hr hr
a(href='/static/old-news', target='_blank') Read older news a(href='/static/old-news', target='_blank') Read older news
mixin oldNews mixin oldNews
h2 12/1/2015 - DECEMBER ARMOIRE ITEMS, BACKGROUNDS, MYSTERY BOX, AND GAYMERX ARMOR!
tr
td
.weapon_armoire_blueLongbow.pull-right
h3 December Armoire Items
p There is new equipment in Enchanted Armoire, a 100 GP Reward in the Rewards Column which unlocks after you've attained Ultimate Gear!
br
p Click on the Enchanted Armoire for a random chance at special Equipment, including the Crystal Crescent Set and the Blue Longbow! It may also give you random XP or food items. We'll be adding new equipment to it during the first week of each month, but even when you've exhausted the current supply, you can keep clicking for a chance at food and XP.
br
p Now go spend all that accumulated Gold! May the Random Number Generator smile upon you...
p.small.muted by Lemoness and SabreCat
p.small.muted Art by starsystemic, Fandekasp, and nonight
tr
td
.background_winter_town.pull-right
h3 December Backgrounds
p There are three new avatar backgrounds in the <a href='/#/options/profile/backgrounds'>Background Shop!</a> Now your avatar can ski on the Alpine Slopes, gaze at the Snowy Sunrise, or bustle through a Winter Town!
p.small.muted by Karithina, Inventrix, and Midori88
tr
td
.inventory_present_12.pull-right
h3 December Mystery Box
p Ooh... What could it be? All Habiticans who are <a href='/#/options/settings/subscription'>subscribed</a> during the month of December will receive the 2015 December Mystery Item Set! It will be revealed on the 23rd, so keep your eyes peeled. Thanks for supporting the site <3
p.small.muted by Lemoness
tr
td
.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!
h2 11/25/2015 - HABITICA THANKSGIVING! NOVEMBER SUBSCRIBER ITEM AND TURKEY PETS AND MOUNTS h2 11/25/2015 - HABITICA THANKSGIVING! NOVEMBER SUBSCRIBER ITEM AND TURKEY PETS AND MOUNTS
tr tr
td td