Adjust formatting in footer controller

This commit is contained in:
Blade Barringer
2015-09-13 02:19:34 -05:00
parent 14fabfbe40
commit cd4ec5bd12

View File

@@ -69,53 +69,62 @@ function($scope, $rootScope, User, $http, Notification, ApiUrl) {
* Debug functions. Note that the server route for gems is only available if process.env.DEBUG=true * Debug functions. Note that the server route for gems is only available if process.env.DEBUG=true
*/ */
if (_.contains(['development','test'],window.env.NODE_ENV)) { if (_.contains(['development','test'],window.env.NODE_ENV)) {
$scope.setHealthLow = function(){ $scope.setHealthLow = function(){
User.set({ User.set({
'stats.hp': 1 'stats.hp': 1
}); });
} };
$scope.addMissedDay = function(numberOfDays){ $scope.addMissedDay = function(numberOfDays){
if (!confirm("Are you sure you want to reset the day by " + numberOfDays + " day(s)?")) return; if (!confirm("Are you sure you want to reset the day by " + numberOfDays + " day(s)?")) return;
var dayBefore = moment(User.user.lastCron).subtract(numberOfDays, 'days').toDate(); var dayBefore = moment(User.user.lastCron).subtract(numberOfDays, 'days').toDate();
User.set({'lastCron': dayBefore}); User.set({'lastCron': dayBefore});
Notification.text('-' + numberOfDays + ' day(s), remember to refresh'); Notification.text('-' + numberOfDays + ' day(s), remember to refresh');
} };
$scope.addTenGems = function(){ $scope.addTenGems = function(){
$http.post(ApiUrl.get() + '/api/v2/user/addTenGems').success(function(){ $http.post(ApiUrl.get() + '/api/v2/user/addTenGems').success(function(){
User.log({}); User.log({});
}) })
} };
$scope.addHourglass = function(){ $scope.addHourglass = function(){
User.set({ User.set({
'purchased.plan.consecutive.trinkets': User.user.purchased.plan.consecutive.trinkets + 1, 'purchased.plan.consecutive.trinkets': User.user.purchased.plan.consecutive.trinkets + 1,
}); });
} };
$scope.addGold = function(){ $scope.addGold = function(){
User.set({ User.set({
'stats.gp': User.user.stats.gp + 500, 'stats.gp': User.user.stats.gp + 500,
}); });
} };
$scope.addMana = function(){ $scope.addMana = function(){
User.set({ User.set({
'stats.mp': User.user.stats.mp + 500, 'stats.mp': User.user.stats.mp + 500,
}); });
} };
$scope.addLevelsAndGold = function(){ $scope.addLevelsAndGold = function(){
User.set({ User.set({
'stats.exp': User.user.stats.exp + 10000, 'stats.exp': User.user.stats.exp + 10000,
'stats.gp': User.user.stats.gp + 10000, 'stats.gp': User.user.stats.gp + 10000,
'stats.mp': User.user.stats.mp + 10000 'stats.mp': User.user.stats.mp + 10000
}); });
} };
$scope.addOneLevel = function(){ $scope.addOneLevel = function(){
User.set({ User.set({
'stats.exp': User.user.stats.exp + (Math.round(((Math.pow(User.user.stats.lvl, 2) * 0.25) + (10 * User.user.stats.lvl) + 139.75) / 10) * 10) 'stats.exp': User.user.stats.exp + (Math.round(((Math.pow(User.user.stats.lvl, 2) * 0.25) + (10 * User.user.stats.lvl) + 139.75) / 10) * 10)
}); });
} };
$scope.addBossQuestProgressUp = function(){ $scope.addBossQuestProgressUp = function(){
User.set({ User.set({
'party.quest.progress.up': User.user.party.quest.progress.up + 1000 'party.quest.progress.up': User.user.party.quest.progress.up + 1000
}); });
} };
} }
}]) }])