mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
@@ -82,14 +82,6 @@ habitrpg.controller('NotificationCtrl',
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$rootScope.$watch('user._tmp.crit', function(after, before){
|
|
||||||
if (after == before || !after) return;
|
|
||||||
var amount = User.user._tmp.crit * 100 - 100;
|
|
||||||
// reset the crit counter
|
|
||||||
User.user._tmp.crit = undefined;
|
|
||||||
Notification.crit(amount);
|
|
||||||
});
|
|
||||||
|
|
||||||
$rootScope.$watch('user._tmp.drop', function(after, before){
|
$rootScope.$watch('user._tmp.drop', function(after, before){
|
||||||
// won't work when getting the same item twice?
|
// won't work when getting the same item twice?
|
||||||
if (_.isEqual(after, before) || !after) return;
|
if (_.isEqual(after, before) || !after) return;
|
||||||
|
|||||||
@@ -224,8 +224,13 @@ angular.module('habitrpg')
|
|||||||
|
|
||||||
Tasks.scoreTask(data.params.task._id, data.params.direction).then(function (res) {
|
Tasks.scoreTask(data.params.task._id, data.params.direction).then(function (res) {
|
||||||
var tmp = res.data.data._tmp || {}; // used to notify drops, critical hits and other bonuses
|
var tmp = res.data.data._tmp || {}; // used to notify drops, critical hits and other bonuses
|
||||||
|
var crit = tmp.crit;
|
||||||
var drop = tmp.drop;
|
var drop = tmp.drop;
|
||||||
|
|
||||||
|
if (crit) {
|
||||||
|
var critBonus = crit * 100 - 100;
|
||||||
|
Notification.crit(critBonus);
|
||||||
|
}
|
||||||
if (drop) user._tmp.drop = drop;
|
if (drop) user._tmp.drop = drop;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user