From 0e28f04c909776037ab799c2bb3c44b10ac2c8bf Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 25 Dec 2014 14:33:11 -0600 Subject: [PATCH 1/6] feat(event): Implement Seasonal Shop --- public/js/controllers/inventoryCtrl.js | 18 ++++++++++++------ views/options/inventory/inventory.jade | 13 ++++++++++--- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/public/js/controllers/inventoryCtrl.js b/public/js/controllers/inventoryCtrl.js index e1b47a47f0..32511b60ef 100644 --- a/public/js/controllers/inventoryCtrl.js +++ b/public/js/controllers/inventoryCtrl.js @@ -87,16 +87,22 @@ habitrpg.controller("InventoryCtrl", ['$rootScope', '$scope', '$window', 'User', } $scope.purchase = function(type, item){ - if (item.key=='spookDust') return User.user.ops.buySpookDust({}); var gems = User.user.balance * 4; - if(gems < item.value) return $rootScope.openModal('buyGems'); - var string = (type == 'hatchingPotions') ? window.env.t('hatchingPotion') : (type == 'eggs') ? window.env.t('eggSingular') : (type == 'quests') ? window.env.t('quest') : (item.key == 'Saddle') ? window.env.t('foodSaddleText').toLowerCase() : (type == 'special') ? item.key : type; // this is ugly but temporary, once the purchase modal is done this will be removed - var message = window.env.t('buyThis', {text: string, price: item.value, gems: gems}) + var string = (type == 'weapon') ? window.env.t('weapon') : (type == 'armor') ? window.env.t('armor') : (type == 'head') ? window.env.t('headgear') : (type == 'shield') ? window.env.t('offhand') : (type == 'hatchingPotions') ? window.env.t('hatchingPotion') : (type == 'eggs') ? window.env.t('eggSingular') : (type == 'quests') ? window.env.t('quest') : (item.key == 'Saddle') ? window.env.t('foodSaddleText').toLowerCase() : type; // this is ugly but temporary, once the purchase modal is done this will be removed + if (type == 'weapon' || type == 'armor' || type == 'head' || type == 'shield') { + if (gems < ((item.specialClass == "wizard") && (item.type == "weapon")) + 1) return $rootScope.openModal('buyGems'); + var message = window.env.t('buyThis', {text: string, price: ((item.specialClass == "wizard") && (item.type == "weapon")) + 1, gems: gems}) + if($window.confirm(message)) + User.user.ops.purchase({params:{type:"gear",key:item.key}}); + } else { + if(gems < item.value) return $rootScope.openModal('buyGems'); + var message = window.env.t('buyThis', {text: string, price: item.value, gems: gems}) + if($window.confirm(message)) + User.user.ops.purchase({params:{type:type,key:item.key}}); + } - if($window.confirm(message)) - User.user.ops.purchase({params:{type:type,key:item.key}}); } $scope.choosePet = function(egg, potion){ diff --git a/views/options/inventory/inventory.jade b/views/options/inventory/inventory.jade index d5d254c2a3..eb1544cfab 100644 --- a/views/options/inventory/inventory.jade +++ b/views/options/inventory/inventory.jade @@ -23,13 +23,20 @@ script(type='text/ng-template', id='partials/options.inventory.seasonalshop.html .container-fluid .stable.row .col-md-2 - .seasonalshop_closed + .seasonalshop_winter2015 .col-md-10 .popover.static-popover.fade.right.in .arrow - h3.popover-title!=env.t('seasonalShopClosedTitle', {linkStart:"", linkEnd: ""}) + h3.popover-title!=env.t('seasonalShopTitle', {linkStart:"", linkEnd: ""}) .popover-content - p!=env.t('seasonalShopClosedText', {linkStart: "", linkEnd: ""}) + p!=env.t('seasonalShopText') + li.customize-menu.inventory-gear + menu(label='{{::label}}', ng-repeat='(set,label) in {candycane:env.t("candycaneSet"), ski:env.t("skiSet"), snowflake:env.t("snowflakeSet"), yeti:env.t("yetiSet")}') + div(ng-repeat='item in Content.gear.flat | toArray | where:{index:set}') + button.customize-option(popover='{{::item.notes()}}', popover-title='{{::item.text()}}', popover-trigger='mouseenter', popover-placement='right', ng-click='purchase(item.type,item)', class='shop_{{::item.key}}') + .center + | {{((item.specialClass == "wizard") && (item.type == "weapon")) + 1}}  + span.Pet_Currency_Gem1x.inline-gems script(type='text/ng-template', id='partials/options.inventory.timetravelers.html') .container-fluid From 1c9088654881d91e3120dcc9729d6d0b2708db0b Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 25 Dec 2014 15:52:26 -0600 Subject: [PATCH 2/6] fix(event): Better shop flow --- views/options/inventory/inventory.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/options/inventory/inventory.jade b/views/options/inventory/inventory.jade index eb1544cfab..e6038a4078 100644 --- a/views/options/inventory/inventory.jade +++ b/views/options/inventory/inventory.jade @@ -31,7 +31,7 @@ script(type='text/ng-template', id='partials/options.inventory.seasonalshop.html .popover-content p!=env.t('seasonalShopText') li.customize-menu.inventory-gear - menu(label='{{::label}}', ng-repeat='(set,label) in {candycane:env.t("candycaneSet"), ski:env.t("skiSet"), snowflake:env.t("snowflakeSet"), yeti:env.t("yetiSet")}') + menu.pets-menu(label='{{::label}}', ng-repeat='(set,label) in {candycane:env.t("candycaneSet"), ski:env.t("skiSet"), snowflake:env.t("snowflakeSet"), yeti:env.t("yetiSet")}') div(ng-repeat='item in Content.gear.flat | toArray | where:{index:set}') button.customize-option(popover='{{::item.notes()}}', popover-title='{{::item.text()}}', popover-trigger='mouseenter', popover-placement='right', ng-click='purchase(item.type,item)', class='shop_{{::item.key}}') .center From 6d4d9451a582360a0f27ac9aed1d6426ea406165 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 25 Dec 2014 17:09:06 -0600 Subject: [PATCH 3/6] feat(event): Mystery migration --- migrations/mysteryitems.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/mysteryitems.js b/migrations/mysteryitems.js index b222047bda..47437570ef 100644 --- a/migrations/mysteryitems.js +++ b/migrations/mysteryitems.js @@ -2,7 +2,7 @@ var _id = ''; var update = { $push: { 'purchased.plan.mysteryItems':{ - $each:['head_mystery_201411','weapon_mystery_201411'] + $each:['head_mystery_201412','armor_mystery_201412'] } } }; From 597793e3cac21d0e1faec7762be33fd73ce273a9 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 25 Dec 2014 17:36:16 -0600 Subject: [PATCH 4/6] feat(event): Quests and Bailey --- views/options/inventory/inventory.jade | 6 +++ views/shared/new-stuff.jade | 74 ++++++++++++++++++-------- 2 files changed, 58 insertions(+), 22 deletions(-) diff --git a/views/options/inventory/inventory.jade b/views/options/inventory/inventory.jade index e6038a4078..6ced2f4816 100644 --- a/views/options/inventory/inventory.jade +++ b/views/options/inventory/inventory.jade @@ -37,6 +37,12 @@ script(type='text/ng-template', id='partials/options.inventory.seasonalshop.html .center | {{((item.specialClass == "wizard") && (item.type == "weapon")) + 1}}  span.Pet_Currency_Gem1x.inline-gems + menu.pets-menu(label=env.t('quests')) + div(ng-repeat='quest in Content.quests', ng-if='quest.key == "evilSanta" || quest.key == "evilSanta2"') + button.customize-option(popover="{{::quest.previous && !user.achievements.quests[quest.previous] ? env.t('scrollsPre') : quest.notes() | htmlDecode}}", popover-title='{{::quest.text()}}', popover-trigger='mouseenter', popover-placement='top', ng-click='buyQuest(quest.key)', class='inventory_quest_scroll', ng-class='::{locked: quest.previous && !user.achievements.quests[quest.previous]}') + p + | {{::quest.value}} + span.Pet_Currency_Gem1x.inline-gems script(type='text/ng-template', id='partials/options.inventory.timetravelers.html') .container-fluid diff --git a/views/shared/new-stuff.jade b/views/shared/new-stuff.jade index 76188b0e7b..6cc1171cf2 100644 --- a/views/shared/new-stuff.jade +++ b/views/shared/new-stuff.jade @@ -1,32 +1,62 @@ -h5 WINTER WONDERLAND BEGINS! Winter Class Outfits, Wintery Hair Colors, and NPC Decorations! +h5 tr td - h5 Winter Wonderland Begins! - p Winter has arrived, and the snow is gently drifting down over Habit City. Come celebrate with us! - tr - td - h5 Winter Class Outfits - .promo_winterclasses2015.pull-right - p From now until January 31st, limited edition outfits are available in the Rewards column. Depending on your class, you can be a Soothing Skater, Mage of the North, Gingerbread Warrior, or Icicle Drake! You'd better get productive to earn enough gold before they disappear. Good luck! - p.small.muted by Lemoness - tr - td - h5 Wintery Hair Colors - .promo_winteryhair.pull-right - p The Seasonal Edition Wintery Hair Colors are now available for purchase in the avatar customizations page! Now you can dye your avatar's hair Holly Green, Winter Star, Snowy, Peppermint, Aurora, or Festive. - p Seasonal Edition items recur unchanged every year, but they are only available to purchase during a short period of time. This is different from Limited Edition Items, which only recur if something is changed, such as the art or the price. These hair colors may remind some of you of the Holiday Hair Colors that were available last winter. The Holiday Hair Colors have been Retired in favor of the similar Seasonal Edition Wintery Hair Colors. Read more about the difference between Seasonal and Limited Edition items here! - p.small.muted by Lemoness, crystalphoenix, and mariahm - tr - td - h5 NPC Decorations - .npc_alex.pull-right - p Looks like the NPCs are really getting in to the cheery winter mood around the site. Who wouldn't? After all, there's plenty more to come! - p.small.muted by Lemoness + h5 December Subscriber Item Set and Seasonal Shop! Plus, Flagging Posts and Winter Plot-Line Continues + tr + td + h5 December Subscriber Item Set + .promo_mystery_201412.pull-right + p The December Subscriber Item has been revealed: the Penguin Item Set! All December subscribers will receive the Penguin Hat and the Penguin Suit. You still have six days to subscribe) and receive the item set! Thank you so much for your support - we really do rely on you to keep HabitRPG free to use and running smoothly. + p.small.muted by Lemoness + tr + td + h5 Seasonal Shop: Seasonal Outfits and Quests + .seasonalshop_winter2015.pull-right + p The Seasonal Shop has opened! The Seasonal Sorceress is stocking the seasonal edition versions of last year's winter outfits, now available for Gems instead of Gold, and the two winter quests, Trapper Santa and Find the Cub. The Seasonal Shop will only be open until January 31st, so don't wait! + p.small.muted by SabreCat and Lemoness + tr + td + h5 Flagging Posts + p You can now report inappropriate posts to moderators simply by clicking the new flag button next to the post. You should only report posts that violate the Community Guidelines and/or Terms of Service. Thanks for helping us to keep Habitica safe and pleasant for everybody! + p.small.muted by Alys, Blade, and Matteo + tr + td + h5 Winter Plot-Line Continues + p SabreCat's news is dire. "Most of my sabertooth friends have been impossible to reach, but one thing is clear: the prides have been disappearing from the Steppes. There are also reports that something drove the mammoths to early migration and disturbed the hibernation of the terrible lizards." + p He wraps his cloak around himself as another blast of frigid wind roars through the streets. An icy winter gale has been blowing from the north, rattling the window panes and setting the pets and mounts to trembling and howling. + p "I've never seen anything like it!" says Matt the Beast Master. "Something is terrifying all my animals - even the cacti, who are normally so mighty and brave! For something to frighten a cactus..." He shakes his head. + p The stress level in Habitica is mounting. + p.small.muted Missed the previous Winter Plot-line? Catch up on the story here! + p.small.muted by Lemoness hr a(href='/static/old-news', target='_blank') Read older news mixin oldNews + h5 12/21/2014 - Winter Wonderland Begins, Winter Class Outfits, Wintery Hair Colors, and NPC Decorations! + tr + td + h5 Winter Wonderland Begins! + p Winter has arrived, and the snow is gently drifting down over Habit City. Come celebrate with us! + tr + td + h5 Winter Class Outfits + .promo_winterclasses2015.pull-right + p From now until January 31st, limited edition outfits are available in the Rewards column. Depending on your class, you can be a Soothing Skater, Mage of the North, Gingerbread Warrior, or Icicle Drake! You'd better get productive to earn enough gold before they disappear. Good luck! + p.small.muted by Lemoness + tr + td + h5 Wintery Hair Colors + .promo_winteryhair.pull-right + p The Seasonal Edition Wintery Hair Colors are now available for purchase in the avatar customizations page! Now you can dye your avatar's hair Holly Green, Winter Star, Snowy, Peppermint, Aurora, or Festive. + p Seasonal Edition items recur unchanged every year, but they are only available to purchase during a short period of time. This is different from Limited Edition Items, which only recur if something is changed, such as the art or the price. These hair colors may remind some of you of the Holiday Hair Colors that were available last winter. The Holiday Hair Colors have been Retired in favor of the similar Seasonal Edition Wintery Hair Colors. Read more about the difference between Seasonal and Limited Edition items here! + p.small.muted by Lemoness, crystalphoenix, and mariahm + tr + td + h5 NPC Decorations + .npc_alex.pull-right + p Looks like the NPCs are really getting in to the cheery winter mood around the site. Who wouldn't? After all, there's plenty more to come! + p.small.muted by Lemoness h5 12/17/2014 - Android App Update, Seasonal Shop, and Winter Plot-Line Continues tr td From f4c582eb2475e6f1bb846aba44b3ad690c4fc0b7 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 25 Dec 2014 17:40:49 -0600 Subject: [PATCH 5/6] fix(event): quest syntax --- views/options/inventory/inventory.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/options/inventory/inventory.jade b/views/options/inventory/inventory.jade index 6ced2f4816..90dbd3398e 100644 --- a/views/options/inventory/inventory.jade +++ b/views/options/inventory/inventory.jade @@ -38,7 +38,7 @@ script(type='text/ng-template', id='partials/options.inventory.seasonalshop.html | {{((item.specialClass == "wizard") && (item.type == "weapon")) + 1}}  span.Pet_Currency_Gem1x.inline-gems menu.pets-menu(label=env.t('quests')) - div(ng-repeat='quest in Content.quests', ng-if='quest.key == "evilSanta" || quest.key == "evilSanta2"') + div(ng-repeat='quest in Content.quests', ng-if='(quest.key == "evilsanta") || (quest.key == "evilsanta2")') button.customize-option(popover="{{::quest.previous && !user.achievements.quests[quest.previous] ? env.t('scrollsPre') : quest.notes() | htmlDecode}}", popover-title='{{::quest.text()}}', popover-trigger='mouseenter', popover-placement='top', ng-click='buyQuest(quest.key)', class='inventory_quest_scroll', ng-class='::{locked: quest.previous && !user.achievements.quests[quest.previous]}') p | {{::quest.value}} From 1b4843ff586340abc51b3f45ccad0fe195fd6475 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 25 Dec 2014 17:42:09 -0600 Subject: [PATCH 6/6] fix(event): Better quest text placement --- views/options/inventory/inventory.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/options/inventory/inventory.jade b/views/options/inventory/inventory.jade index 90dbd3398e..492341a8b5 100644 --- a/views/options/inventory/inventory.jade +++ b/views/options/inventory/inventory.jade @@ -39,7 +39,7 @@ script(type='text/ng-template', id='partials/options.inventory.seasonalshop.html span.Pet_Currency_Gem1x.inline-gems menu.pets-menu(label=env.t('quests')) div(ng-repeat='quest in Content.quests', ng-if='(quest.key == "evilsanta") || (quest.key == "evilsanta2")') - button.customize-option(popover="{{::quest.previous && !user.achievements.quests[quest.previous] ? env.t('scrollsPre') : quest.notes() | htmlDecode}}", popover-title='{{::quest.text()}}', popover-trigger='mouseenter', popover-placement='top', ng-click='buyQuest(quest.key)', class='inventory_quest_scroll', ng-class='::{locked: quest.previous && !user.achievements.quests[quest.previous]}') + button.customize-option(popover="{{::quest.previous && !user.achievements.quests[quest.previous] ? env.t('scrollsPre') : quest.notes() | htmlDecode}}", popover-title='{{::quest.text()}}', popover-trigger='mouseenter', popover-placement='right', ng-click='buyQuest(quest.key)', class='inventory_quest_scroll', ng-class='::{locked: quest.previous && !user.achievements.quests[quest.previous]}') p | {{::quest.value}} span.Pet_Currency_Gem1x.inline-gems