feat(pets): Spooky pets/mounts

This commit is contained in:
Sabe Jones
2015-09-22 14:23:52 -04:00
parent cd9c372254
commit e96410aa57
7 changed files with 39 additions and 11 deletions

View File

@@ -24,6 +24,7 @@
"eggSingular": "egg", "eggSingular": "egg",
"noEggs": "You don't have any eggs.", "noEggs": "You don't have any eggs.",
"hatchingPotions": "Hatching Potions", "hatchingPotions": "Hatching Potions",
"magicHatchingPotions": "Magic Hatching Potions",
"hatchingPotion": "hatching potion", "hatchingPotion": "hatching potion",
"noHatchingPotions": "You don't have any hatching potions.", "noHatchingPotions": "You don't have any hatching potions.",
"inventoryText": "Click an egg to see usable potions highlighted in green and then click one of the highlighted potions to hatch your pet. If no potions are highlighted, click that egg again to deselect it, and instead click a potion first to have the usable eggs highlighted. You can also sell unwanted drops to Alexander the Merchant.", "inventoryText": "Click an egg to see usable potions highlighted in green and then click one of the highlighted potions to hatch your pet. If no potions are highlighted, click that egg again to deselect it, and instead click a potion first to have the usable eggs highlighted. You can also sell unwanted drops to Alexander the Merchant.",

View File

@@ -1165,16 +1165,21 @@ api.hatchingPotions =
CottonCandyPink: value: 4, text: t('hatchingPotionCottonCandyPink') CottonCandyPink: value: 4, text: t('hatchingPotionCottonCandyPink')
CottonCandyBlue: value: 4, text: t('hatchingPotionCottonCandyBlue') CottonCandyBlue: value: 4, text: t('hatchingPotionCottonCandyBlue')
Golden: value: 5, text: t('hatchingPotionGolden') Golden: value: 5, text: t('hatchingPotionGolden')
Spooky: value: 3, text: t('hatchingPotionSpooky'), premium: true Spooky: value: 3, text: t('hatchingPotionSpooky'), premium: true, limited: true
_.each api.hatchingPotions, (pot,key) -> _.each api.hatchingPotions, (pot,key) ->
_.defaults pot, {key, value: 2, notes: t('hatchingPotionNotes', {potText: pot.text}), premium: false, canBuy: true} _.defaults pot, {key, value: 2, notes: t('hatchingPotionNotes', {potText: pot.text}), premium: false, limited: false, canBuy: true}
api.pets = _.transform api.dropEggs, (m, egg) -> api.pets = _.transform api.dropEggs, (m, egg) ->
_.defaults m, _.transform api.hatchingPotions, (m2, pot) -> _.defaults m, _.transform api.hatchingPotions, (m2, pot) ->
if not pot.premium if not pot.premium
m2[egg.key + "-" + pot.key] = true m2[egg.key + "-" + pot.key] = true
api.premiumPets = _.transform api.dropEggs, (m, egg) ->
_.defaults m, _.transform api.hatchingPotions, (m2, pot) ->
if pot.premium
m2[egg.key + "-" + pot.key] = true
api.questPets = _.transform api.questEggs, (m, egg) -> api.questPets = _.transform api.questEggs, (m, egg) ->
_.defaults m, _.transform api.hatchingPotions, (m2, pot) -> _.defaults m, _.transform api.hatchingPotions, (m2, pot) ->
if not pot.premium if not pot.premium

View File

@@ -232,10 +232,10 @@ var UserSchema = new Schema({
_.defaults( _.defaults(
// First transform to a 1D eggs/potions mapping // First transform to a 1D eggs/potions mapping
_.transform(shared.content.pets, function(m,v,k){ m[k] = Number; }), _.transform(shared.content.pets, function(m,v,k){ m[k] = Number; }),
// Then add quest pets // Then add additional pets (quest, backer, contributor, premium)
_.transform(shared.content.questPets, function(m,v,k){ m[k] = Number; }), _.transform(shared.content.questPets, function(m,v,k){ m[k] = Number; }),
// Then add additional pets (backer, contributor) _.transform(shared.content.specialPets, function(m,v,k){ m[k] = Number; }),
_.transform(shared.content.specialPets, function(m,v,k){ m[k] = Number; }) _.transform(shared.content.premiumPets, function(m,v,k){ m[k] = Number; })
), ),
currentPet: String, // Cactus-Desert currentPet: String, // Cactus-Desert
@@ -265,9 +265,10 @@ var UserSchema = new Schema({
mounts: _.defaults( mounts: _.defaults(
// First transform to a 1D eggs/potions mapping // First transform to a 1D eggs/potions mapping
_.transform(shared.content.pets, function(m,v,k){ m[k] = Boolean; }), _.transform(shared.content.pets, function(m,v,k){ m[k] = Boolean; }),
// Then add quest pets // Then add quest and premium pets
_.transform(shared.content.questPets, function(m,v,k){ m[k] = Boolean; }), _.transform(shared.content.questPets, function(m,v,k){ m[k] = Boolean; }),
// Then add additional pets (backer, contributor) _.transform(shared.content.premiumPets, function(m,v,k){ m[k] = Boolean; }),
// Then add additional mounts (backer, contributor)
_.transform(shared.content.specialMounts, function(m,v,k){ m[k] = Boolean; }) _.transform(shared.content.specialMounts, function(m,v,k){ m[k] = Boolean; })
), ),
currentMount: String, currentMount: String,

View File

@@ -134,7 +134,19 @@
li.customize-menu li.customize-menu
menu.pets-menu(label=env.t('hatchingPotions')) menu.pets-menu(label=env.t('hatchingPotions'))
p.muted!=env.t('dropsExplanation') p.muted!=env.t('dropsExplanation')
div(ng-repeat='pot in Content.hatchingPotions', ng-if='pot.canBuy') div(ng-repeat='pot in Content.hatchingPotions', ng-if='!pot.premium')
button.customize-option(class='Pet_HatchingPotion_{{::pot.key}}',
popover='{{::pot.notes()}}', 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}} 
span.Pet_Currency_Gem1x.inline-gems
li.customize-menu
menu.pets-menu(label=env.t('magicHatchingPotions'))
div(ng-repeat='pot in Content.hatchingPotions', ng-if='pot.premium')
button.customize-option(class='Pet_HatchingPotion_{{::pot.key}}', button.customize-option(class='Pet_HatchingPotion_{{::pot.key}}',
popover='{{::pot.notes()}}', popover-append-to-body='true', popover='{{::pot.notes()}}', popover-append-to-body='true',
popover-title!=env.t("potion", {potionType: "{{::pot.text()}}"}), popover-title!=env.t("potion", {potionType: "{{::pot.text()}}"}),

View File

@@ -8,7 +8,7 @@ mixin mountList(source,showPremium)
- mount = egg.key+"-"+potion.key - mount = egg.key+"-"+potion.key
div(popover-trigger='mouseenter', popover=env.t('mountName', {potion: potion.text(env.language.code), mount: egg.mountText(env.language.code)}), popover-placement='bottom', ng-hide='#{potion.premium} && #{!showPremium}') div(popover-trigger='mouseenter', popover=env.t('mountName', {potion: potion.text(env.language.code), mount: egg.mountText(env.language.code)}), popover-placement='bottom', ng-hide='#{potion.premium} && #{!showPremium}')
button(class="pet-button Mount_Head_#{mount}", ng-show='user.items.mounts["#{mount}"]', ng-class='{active: user.items.currentMount == "#{mount}"}', ng-click='chooseMount("#{egg.key}", "#{potion.key}")') button(class="pet-button Mount_Head_#{mount}", ng-show='user.items.mounts["#{mount}"]', ng-class='{active: user.items.currentMount == "#{mount}"}', ng-click='chooseMount("#{egg.key}", "#{potion.key}")')
button(class="pet-button mount-not-owned", ng-hide='user.items.mounts["#{mount}"]') button(class="pet-button mount-not-owned", ng-if='!user.items.mounts["#{mount}"] && (#{potion.canBuy} || user.items.hatchingPotions["#{potion.key}"] || user.items.pets["#{mount}"])')
.PixelPaw .PixelPaw
-} -}

View File

@@ -9,7 +9,7 @@ mixin petList(source,showPremium)
button(class="pet-button Pet-#{pet}", ng-if='user.items.pets["#{pet}"]>0', ng-class='{active: user.items.currentPet == "#{pet}", selectableInventory: #{!egg.noMount} && selectedFood && !user.items.mounts["#{pet}"]}', ng-click='choosePet("#{egg.key}", "#{potion.key}")') button(class="pet-button Pet-#{pet}", ng-if='user.items.pets["#{pet}"]>0', ng-class='{active: user.items.currentPet == "#{pet}", selectableInventory: #{!egg.noMount} && selectedFood && !user.items.mounts["#{pet}"]}', ng-click='choosePet("#{egg.key}", "#{potion.key}")')
.progress(ng-show='!user.items.mounts["#{pet}"]') .progress(ng-show='!user.items.mounts["#{pet}"]')
.progress-bar.progress-bar-success(ng-style='{width: user.items.pets["#{pet}"]/.5 + "%"}') .progress-bar.progress-bar-success(ng-style='{width: user.items.pets["#{pet}"]/.5 + "%"}')
button(class="pet-button pet-not-owned", ng-if='!user.items.pets["#{pet}"]') button(class="pet-button pet-not-owned", ng-if='!user.items.pets["#{pet}"] && (#{potion.canBuy} || user.items.hatchingPotions["#{potion.key}"])')
.PixelPaw .PixelPaw
button(class="pet-evolved pet-button Pet-#{pet}", ng-if='user.items.pets["#{pet}"]<0') button(class="pet-evolved pet-button Pet-#{pet}", ng-if='user.items.pets["#{pet}"]<0')

View File

@@ -33,7 +33,7 @@
span.Pet_Currency_Gem1x.inline-gems span.Pet_Currency_Gem1x.inline-gems
menu.pets-menu(label=env.t('seasonalItems')) menu.pets-menu(label=env.t('seasonalItems'))
div div
button.customize-option(class='shop_spookDust', button.customize-option(class='inventory_special_spookDust',
popover='{{::Content.spells.special.spookDust.notes()}}', popover='{{::Content.spells.special.spookDust.notes()}}',
popover-title='{{::Content.spells.special.spookDust.text()}}', popover-title='{{::Content.spells.special.spookDust.text()}}',
popover-trigger='mouseenter', popover-placement='right', popover-trigger='mouseenter', popover-placement='right',
@@ -41,6 +41,15 @@
ng-click='purchase("special", Content.spells.special.spookDust)') ng-click='purchase("special", Content.spells.special.spookDust)')
p {{::Content.spells.special.spookDust.value}} p {{::Content.spells.special.spookDust.value}}
span(class='shop_gold') span(class='shop_gold')
div
button.customize-option(class='Pet_HatchingPotion_Spooky',
popover='{{::Content.hatchingPotions.Spooky.notes()}}',
popover-title!=env.t("potion", {potionType: "{{::Content.hatchingPotions.Spooky.text()}}"}),
popover-trigger='mouseenter', popover-placement='right',
popover-append-to-body='true',
ng-click='purchase("hatchingPotions", Content.hatchingPotions.Spooky)')
p {{::Content.hatchingPotions.Spooky.value}}&nbsp;
span.Pet_Currency_Gem1x.inline-gems
// div // div
button.customize-option(popover='{{::Content.spells.special.nye.notes()}}', popover-title='{{::Content.spells.special.nye.text()}}', popover-trigger='mouseenter', popover-placement='right', popover-append-to-body='true', ng-click='castStart(Content.spells.special.nye)', class='inventory_special_nye') button.customize-option(popover='{{::Content.spells.special.nye.notes()}}', popover-title='{{::Content.spells.special.nye.text()}}', popover-trigger='mouseenter', popover-placement='right', popover-append-to-body='true', ng-click='castStart(Content.spells.special.nye)', class='inventory_special_nye')