diff --git a/public/js/services/guideServices.js b/public/js/services/guideServices.js index 3535086828..d90db16475 100644 --- a/public/js/services/guideServices.js +++ b/public/js/services/guideServices.js @@ -139,7 +139,10 @@ angular.module('guideServices', []). } }); - + $rootScope.$watch('user.flags.rebirthEnabled', function(after, before) { + if (alreadyShown(before, after)) return; + $rootScope.modals.rebirthEnabled = true; + }); /** diff --git a/src/models/user.js b/src/models/user.js index 6fdd789e55..d47530cfec 100644 --- a/src/models/user.js +++ b/src/models/user.js @@ -45,7 +45,8 @@ var UserSchema = new Schema({ veteran: Boolean, snowball: Number, streak: Number, - challenges: Array + challenges: Array, + rebirth: Array }, auth: { facebook: Schema.Types.Mixed, @@ -94,7 +95,8 @@ var UserSchema = new Schema({ partyEnabled: Boolean, // FIXME do we need this? contributor: Boolean, classSelected: {type: Boolean, 'default': false}, - mathUpdates: Boolean + mathUpdates: Boolean, + rebirthEnabled: {type: Boolean, 'default': false} }, history: { exp: Array, // [{date: Date, value: Number}], // big peformance issues if these are defined diff --git a/views/shared/modals/index.jade b/views/shared/modals/index.jade index 339424984e..d8b098ac8a 100644 --- a/views/shared/modals/index.jade +++ b/views/shared/modals/index.jade @@ -7,4 +7,5 @@ include ./buy-gems include ./members include ./settings include ./pets -include ./classes \ No newline at end of file +include ./classes +include ./rebirth diff --git a/views/shared/modals/rebirth.jade b/views/shared/modals/rebirth.jade new file mode 100644 index 0000000000..1a65ec1a6b --- /dev/null +++ b/views/shared/modals/rebirth.jade @@ -0,0 +1,38 @@ +// Created by Sabe on 12/22/13. + +div(modal='modals.rebirthEnabled') + .modal-header + h3 Rebirth: New Adventure Available! + .modal-body + p + span. + You've unlocked Rebirth! This special Market item allows you to begin a new game at level 1 while keeping your tasks, achievements, pets, and more. Use it to breathe new life into HabitRPG if you feel you've achieved it all, or to experience new features with the fresh eyes of a beginning character! + .modal-footer + button.btn.btn-default.cancel(ng-click='modals.rebirthEnabled = false') Close + +div(modal='modals.rebirth') + .modal-header + h3 Rebirth: Begin a New Adventure + .modal-body + include ../gems + p. + Rebirth sets your game to a starting state, as if you'd created a new account, but keeps your most hard-earned or paid-for items intact. When you are reborn: + ul + li You become a Level 1 Warrior with full Health but no Experience. You may choose a new class at Level 10 as normal. + li You lose all Gold and all purchased equipment. + li Your tasks are reset to neutral (yellow color), but their history remains. + li Your Dailies' streaks are reset to 0. + li You keep your Achievements, your Gems, your backer and contributor tiers, and any purchased avatar customizations, such as hair styles. + li You keep whatever Challenges, Guilds, and Party you are a member of. + li You keep your Pets and Mounts, though you will not be able to access them until you unlock the Stable again. + li You earn an Achievement for beginning a new adventure! + p. + Consider using this feature if you would like to replay the early game with Habit's newest features, or if your motivation drops when you've attained all the best gear! + .modal-footer + button.btn.btn-large.cancel(ng-click='modals.rebirth = false') Never mind + span(ng-if='user.balance < 1') + a.btn.btn-success.btn-large(ng-click="modals.buyGems = true") Buy More Gems + span.gem-cost Not enough Gems + span(ng-if='user.balance >= 1', ng-controller='SettingsCtrl') + a.btn.btn-danger.btn-large(ng-click='rebirth()') Be Reborn + span.gem-cost 8 Gems