From 53fff0dbc61c2bb11bf21f1575c487ab05016214 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Sat, 27 Dec 2014 11:49:51 -0600 Subject: [PATCH 1/6] feat(seasonal): Implement Snowball Adds the snowball from Winter 2014 to the Seasonal Shop. --- public/js/controllers/inventoryCtrl.js | 1 + views/options/inventory/inventory.jade | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/public/js/controllers/inventoryCtrl.js b/public/js/controllers/inventoryCtrl.js index 5e71b5bf2e..325584ca26 100644 --- a/public/js/controllers/inventoryCtrl.js +++ b/public/js/controllers/inventoryCtrl.js @@ -87,6 +87,7 @@ habitrpg.controller("InventoryCtrl", ['$rootScope', '$scope', '$window', 'User', } $scope.purchase = function(type, item){ + if (type == 'special') return User.user.ops.buySpecialSpell({params:{key:item.key}}); var gems = User.user.balance * 4; diff --git a/views/options/inventory/inventory.jade b/views/options/inventory/inventory.jade index 6ffe3ce743..7c1d8a1539 100644 --- a/views/options/inventory/inventory.jade +++ b/views/options/inventory/inventory.jade @@ -43,6 +43,15 @@ script(type='text/ng-template', id='partials/options.inventory.seasonalshop.html p | {{::quest.value}}  span.Pet_Currency_Gem1x.inline-gems + mixin buySpecialSpell(k,gp) + menu.pets-menu(label='{{::Content.spells.special.#{k}.text()}}') + div + button.customize-option(popover='{{::Content.spells.special.#{k}.notes()}}', popover-title='{{::Content.spells.special.#{k}.text()}}', popover-trigger='mouseenter', popover-placement='right', ng-click='purchase("special", Content.spells.special.#{k})', class='inventory_special_#{k}') + p + | {{::Content.spells.special.#{k}.value}} + span(class='#{gp ? "shop_gold" : "Pet_Currency_Gem1x inline-gems"}') + +buySpecialSpell('snowball',true) + //-+buySpecialSpell('spookDust',true) script(type='text/ng-template', id='partials/options.inventory.timetravelers.html') .container-fluid @@ -203,15 +212,6 @@ script(type='text/ng-template', id='partials/options.inventory.drops.html') p | 4 span.Pet_Currency_Gem1x.inline-gems - mixin buySpecialSpell(k,gp) - div - button.customize-option(popover='{{::Content.spells.special.#{k}.notes()}}', popover-title='{{::Content.spells.special.#{k}.text()}}', popover-trigger='mouseenter', popover-placement='top', ng-click='purchase("special", Content.spells.special.#{k})', class='inventory_special_#{k}') - p - | {{::Content.spells.special.#{k}.value}} - span(class='#{gp ? "shop_gold" : "Pet_Currency_Gem1x inline-gems"}') - //-+buySpecialSpell('snowball',false) - //-+buySpecialSpell('spookDust',true) - div(ng-show='user.flags.rebirthEnabled') button.customize-option(popover=env.t('rebirthPop'), popover-title=env.t('rebirthName'), popover-trigger='mouseenter', popover-placement='top', ng-click='openModal("rebirth")', class='rebirth_orb') p(ng-show='user.stats.lvl < 100') From d8cfc1dd4b9bd734aa99f9d61d6a54cd858ca99c Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Mon, 29 Dec 2014 20:58:28 -0600 Subject: [PATCH 2/6] WIP(NYE): New Year's cards --- src/models/user.js | 7 +++++-- views/options/inventory/inventory.jade | 21 ++++++++++----------- views/shared/modals/limited.jade | 23 ++++++++++++++++++++++- views/shared/profiles/achievements.jade | 6 ++++++ 4 files changed, 43 insertions(+), 14 deletions(-) diff --git a/src/models/user.js b/src/models/user.js index a9527cd512..132f5f76cf 100644 --- a/src/models/user.js +++ b/src/models/user.js @@ -47,7 +47,8 @@ var UserSchema = new Schema({ perfect: Number, habitBirthday: Boolean, valentine: Number, - costumeContest: Boolean + costumeContest: Boolean, + nye: Number }, auth: { blocked: Boolean, @@ -173,7 +174,9 @@ var UserSchema = new Schema({ snowball: {type: Number, 'default': 0}, spookDust: {type: Number, 'default': 0}, valentine: Number, - valentineReceived: Array // array of strings, by sender name + valentineReceived: Array, // array of strings, by sender name + nye: Number, + nyeReceived: Array }, // -------------- Animals ------------------- diff --git a/views/options/inventory/inventory.jade b/views/options/inventory/inventory.jade index 7c1d8a1539..cd2ddf90ca 100644 --- a/views/options/inventory/inventory.jade +++ b/views/options/inventory/inventory.jade @@ -43,15 +43,12 @@ script(type='text/ng-template', id='partials/options.inventory.seasonalshop.html p | {{::quest.value}}  span.Pet_Currency_Gem1x.inline-gems - mixin buySpecialSpell(k,gp) - menu.pets-menu(label='{{::Content.spells.special.#{k}.text()}}') - div - button.customize-option(popover='{{::Content.spells.special.#{k}.notes()}}', popover-title='{{::Content.spells.special.#{k}.text()}}', popover-trigger='mouseenter', popover-placement='right', ng-click='purchase("special", Content.spells.special.#{k})', class='inventory_special_#{k}') - p - | {{::Content.spells.special.#{k}.value}} - span(class='#{gp ? "shop_gold" : "Pet_Currency_Gem1x inline-gems"}') - +buySpecialSpell('snowball',true) - //-+buySpecialSpell('spookDust',true) + menu.pets-menu(label=env.t('seasonalItems')) + div + button.customize-option(popover='{{::Content.spells.special.snowball.notes()}}', popover-title='{{::Content.spells.special.snowball.text()}}', popover-trigger='mouseenter', popover-placement='right', ng-click='purchase("special", Content.spells.special.snowball)', class='inventory_special_snowball') + p + | {{::Content.spells.special.snowball.value}} + span(class='shop_gold') script(type='text/ng-template', id='partials/options.inventory.timetravelers.html') .container-fluid @@ -132,12 +129,10 @@ script(type='text/ng-template', id='partials/options.inventory.drops.html') +specialItem('snowball') +specialItem('spookDust') - //-menu.pets-menu(label=env.t('valentineCard')) div(ng-if='user.items.special.valentineReceived[0]') button.customize-option(popover="Valentine's Day Card from {{User.user.items.special.valentineReceived[0]}}", popover-trigger='mouseenter', popover-placement='right', ng-click='openModal("valentine")', class='inventory_special_valentine') .badge.badge-info.stack-count {{user.items.special.valentineReceived.length}} - //-menu.pets-menu(label=env.t('subscriberItem')) div(ng-if='user.purchased.plan.customerId || user.purchased.plan.mysteryItems.length') button.customize-option(popover=env.t('subscriberItemText'), popover-trigger='mouseenter', popover-placement='right', class='inventory_present', ng-click="user.ops.openMysteryItem({})") .badge.badge-info.stack-count {{user.purchased.plan.mysteryItems.length}} @@ -146,6 +141,10 @@ script(type='text/ng-template', id='partials/options.inventory.drops.html') button.customize-option(popover=env.t('mysticHourglassPopover'), popover-trigger='mouseenter', popover-placement='right', class='inventory_special_trinket', ng-click="$state.go('options.inventory.timetravelers')") .badge.badge-info.stack-count {{user.purchased.plan.consecutive.trinkets}} + div(ng-if='user.items.special.nyeReceived[0]') + button.customize-option(popover="New Year's Card from {{User.user.items.special.nyeReceived[0]}}", popover-trigger='mouseenter', popover-placement='right', ng-click='openModal("nye")', class='inventory_special_nye') + .badge.badge-info.stack-count {{user.items.special.nyeReceived.length}} + .col-md-6 h2=env.t('market') .row-fluid diff --git a/views/shared/modals/limited.jade b/views/shared/modals/limited.jade index 8d2d31ce90..d60e3e51e7 100644 --- a/views/shared/modals/limited.jade +++ b/views/shared/modals/limited.jade @@ -27,4 +27,25 @@ script(id='modals/valentine.html', type='text/ng-template') p small For enduring such a saccharine poem, you both receive the "Adoring Friends" badge! .modal-footer - button.btn.btn-default(ng-click='user.ops.readValentine({});$close()')=env.t('ok') \ No newline at end of file + button.btn.btn-default(ng-click='user.ops.readValentine({});$close()')=env.t('ok') + +// New Year's +script(id='modals/nye.html', type='text/ng-template') + .modal-header + h4 + .inventory_special_nye.pull-right + =env.t('nyeCard') + .modal-body + .bg-info(style='padding:10px') + p To: {{user.profile.name}}, From: {{user.items.special.nyeReceived[0]}} + hr + div(ng-switch='Math.floor(Math.random()*5)') + p(ng-switch-when='0') Happy New Year! May you slay many a bad Habit. + p(ng-switch-when='1') Happy New Year! May you reap many Rewards. + p(ng-switch-when='2') Happy New Year! May you earn many a Perfect Day. + p(ng-switch-when='3') Happy New Year! May your To-Do list stay short and sweet. + p(ng-switch-default) Happy New Year! May you not get attacked by a raging Hippogriff. + p + small For celebrating the new year together, you both receive the "Auld Acquaintance" badge! + .modal-footer + button.btn.btn-default(ng-click='user.ops.readNYE({});$close()')=env.t('ok') diff --git a/views/shared/profiles/achievements.jade b/views/shared/profiles/achievements.jade index bc8689d17d..43313a5e8e 100644 --- a/views/shared/profiles/achievements.jade +++ b/views/shared/profiles/achievements.jade @@ -179,3 +179,9 @@ div(ng-if='::profile.achievements.costumeContest') =env.t('costumeContestText') hr +div(ng-if='::profile.achievements.nye') + .achievement.achievement-valentine + h5=env.t('auldAcquaintance') + small + =env.t('auldAcquaintanceText', {cards: "{{::profile.achievements.nye}}"}) + hr \ No newline at end of file From 51acc477fe9ad58aba4c7aeede788d496441c3c6 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Tue, 30 Dec 2014 19:57:24 -0600 Subject: [PATCH 3/6] feat(NYE): New Year's cards --- public/js/controllers/rootCtrl.js | 3 +++ views/options/inventory/inventory.jade | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/public/js/controllers/rootCtrl.js b/public/js/controllers/rootCtrl.js index eab6ac66fa..5065a93eb2 100644 --- a/public/js/controllers/rootCtrl.js +++ b/public/js/controllers/rootCtrl.js @@ -195,6 +195,9 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$ $scope.castStart = function(spell) { if (User.user.stats.mp < spell.mana) return Notification.text(window.env.t('notEnoughMana')); + if (spell.key == 'nye' && User.user.stats.gp < spell.value) + return Notification.text('Not enough gold.'); + $rootScope.applyingAction = true; $scope.spell = spell; if (spell.target == 'self') { diff --git a/views/options/inventory/inventory.jade b/views/options/inventory/inventory.jade index cd2ddf90ca..44218966fa 100644 --- a/views/options/inventory/inventory.jade +++ b/views/options/inventory/inventory.jade @@ -49,6 +49,11 @@ script(type='text/ng-template', id='partials/options.inventory.seasonalshop.html p | {{::Content.spells.special.snowball.value}} span(class='shop_gold') + div + button.customize-option(popover='{{::Content.spells.special.nye.notes()}}', popover-title='{{::Content.spells.special.nye.text()}}', popover-trigger='mouseenter', popover-placement='right', ng-click='castStart(Content.spells.special.nye)', class='inventory_special_nye') + p + | {{Content.spells.special.nye.value}} + span(class='shop_gold') script(type='text/ng-template', id='partials/options.inventory.timetravelers.html') .container-fluid From e35722865abad24f22bac9833a53f3bbd7d8e1ac Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Tue, 30 Dec 2014 20:52:06 -0600 Subject: [PATCH 4/6] fix(NYE): I18N for random text --- views/shared/modals/limited.jade | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/views/shared/modals/limited.jade b/views/shared/modals/limited.jade index d60e3e51e7..9099754893 100644 --- a/views/shared/modals/limited.jade +++ b/views/shared/modals/limited.jade @@ -39,12 +39,17 @@ script(id='modals/nye.html', type='text/ng-template') .bg-info(style='padding:10px') p To: {{user.profile.name}}, From: {{user.items.special.nyeReceived[0]}} hr - div(ng-switch='Math.floor(Math.random()*5)') - p(ng-switch-when='0') Happy New Year! May you slay many a bad Habit. - p(ng-switch-when='1') Happy New Year! May you reap many Rewards. - p(ng-switch-when='2') Happy New Year! May you earn many a Perfect Day. - p(ng-switch-when='3') Happy New Year! May your To-Do list stay short and sweet. - p(ng-switch-default) Happy New Year! May you not get attacked by a raging Hippogriff. + ul.list-unstyled(ng-switch='Math.floor(Math.random()*5)') + li(ng-switch-when='0') + =env.t('newYear0') + li(ng-switch-when='1') + =env.t('newYear1') + li(ng-switch-when='2') + =env.t('newYear2') + li(ng-switch-when='3') + =env.t('newYear3') + li(ng-switch-default) + =env.t('newYear4') p small For celebrating the new year together, you both receive the "Auld Acquaintance" badge! .modal-footer From 1f1b4371b7b75bf420d1e903f326fa80d8deb5e1 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Tue, 30 Dec 2014 21:48:02 -0600 Subject: [PATCH 5/6] feat(NYE): Migrate hats --- migrations/20141230_new_years_hats.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 migrations/20141230_new_years_hats.js diff --git a/migrations/20141230_new_years_hats.js b/migrations/20141230_new_years_hats.js new file mode 100644 index 0000000000..08e6a542fe --- /dev/null +++ b/migrations/20141230_new_years_hats.js @@ -0,0 +1,11 @@ +db.users.update( + {'gear.owned.head_special_nye':{$ne:null}}, + {$set:{'gear.owned.head_special_nye2014':false}}, + {multi:1} +) + +db.users.update( + {'gear.owned.head_special_nye':null}, + {$set:{'gear.owned.head_special_nye':false}}, + {multi:1} +) From 230482c57893bea1a1e3aa97509029f600b991f6 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Tue, 30 Dec 2014 21:58:15 -0600 Subject: [PATCH 6/6] chore(news): Bailey --- views/shared/new-stuff.jade | 76 +++++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 28 deletions(-) diff --git a/views/shared/new-stuff.jade b/views/shared/new-stuff.jade index 6cc1171cf2..996f33382b 100644 --- a/views/shared/new-stuff.jade +++ b/views/shared/new-stuff.jade @@ -1,38 +1,58 @@ -h5 +h5 NEW YEAR'S EVE CELEBRATION: Party Hats, New Year's Cards, Snowballs, and Last Chance for Penguin Item Set tr td - 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 + h5 Party Hats + .promo_partyhats.pull-right + p In honor of the new year, some free Party Hats are available in the Rewards store! New users get the ever-handsome Absurd Party Hat, and users who already received one last year get the Silly Party Hat. These hats will be available to purchase until January 31st, but once you've bought them, you'll have them forever. Enjoy! + p.small.muted by Lemoness and SabreCat + tr + td + h5 New Year's Cards (Until Jan 1st Only!) + .inventory_special_nye.pull-right + p Until January 1st only, the Seasonal Shop is stocking New Year's Cards! Now you can send cards to your friends (and yourself) to wish them a Happy Habit New Year. All senders and recipients will receive the Auld Acquaintance badge! + p.small.muted by Lemoness and SabreCat + tr + td + h5 Snowballs + .inventory_special_snowball.pull-right + p The Seasonal Shop is also stocking Snowballs for gold! Throw them at your friends to have an exciting effect. Anyone hit with a snowball earns the Annoying Friends badge. The results of being hit with a Snowball will last until the end of your day, but you can also reverse them early by buying Salt from the Rewards column. Snowballs are available until January 31st. + p.small.muted by Shaner, Lemoness, and SabreCat + tr + td + h5 Last Chance for Penguin Item Set + p Reminder: this is the final day to subscribe and receive the Penguin Item Set! If you want the Penguin Hat or the Penguin Suit, now's the time! Thanks so much for your support <3 hr a(href='/static/old-news', target='_blank') Read older news mixin oldNews + h5 12/25/2014 - 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 h5 12/21/2014 - Winter Wonderland Begins, Winter Class Outfits, Wintery Hair Colors, and NPC Decorations! tr td