mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-03 04:29:40 +00:00
bug fix subtractPoints() for hp modification
This commit is contained in:
parent
6a107db7a3
commit
ab7e05b19c
2 changed files with 5 additions and 4 deletions
5
dist/habitrpg-shared.js
vendored
5
dist/habitrpg-shared.js
vendored
|
|
@ -11299,9 +11299,10 @@ var process=require("__browserify_process");(function() {
|
|||
return stats.gp += task.streak ? (streakBonus = task.streak / 100 + 1, afterStreak = gpMod * streakBonus, gpMod > 0 ? user._tmp.streakBonus = afterStreak - gpMod : void 0, afterStreak) : gpMod;
|
||||
};
|
||||
subtractPoints = function() {
|
||||
var conMod;
|
||||
var conMod, hpMod;
|
||||
conMod = 1 - (user._statsComputed.con / 100);
|
||||
return stats.hp += Math.round(task.value * HP * conMod * task.priority);
|
||||
hpMod = delta * HP * conMod * task.priority;
|
||||
return stats.hp += Math.round(hpMod * 10) / 10;
|
||||
};
|
||||
switch (task.type) {
|
||||
case 'habit':
|
||||
|
|
|
|||
|
|
@ -565,8 +565,8 @@ api.wrap = (user) ->
|
|||
# HP modifier
|
||||
subtractPoints = ->
|
||||
conMod = 1 - (user._statsComputed.con / 100)
|
||||
stats.hp += Math.round(task.value * HP * conMod * task.priority)
|
||||
# round to 1dp
|
||||
hpMod = delta * HP * conMod * task.priority
|
||||
stats.hp += Math.round(hpMod * 10) / 10 # round to 1dp
|
||||
|
||||
switch task.type
|
||||
when 'habit'
|
||||
|
|
|
|||
Loading…
Reference in a new issue