diff --git a/common/dist/scripts/habitrpg-shared.js b/common/dist/scripts/habitrpg-shared.js index 6f3b8b5fbf..2c53f340f8 100644 --- a/common/dist/scripts/habitrpg-shared.js +++ b/common/dist/scripts/habitrpg-shared.js @@ -5154,7 +5154,7 @@ Task classes given everything about the class */ api.taskClasses = function(task, filters, dayStart, lastCron, showCompleted, main) { - var classes, completed, enabled, filter, repeat, type, value, _ref; + var classes, completed, enabled, filter, priority, repeat, type, value, _ref; if (filters == null) { filters = []; } @@ -5173,7 +5173,7 @@ api.taskClasses = function(task, filters, dayStart, lastCron, showCompleted, mai if (!task) { return; } - type = task.type, completed = task.completed, value = task.value, repeat = task.repeat; + type = task.type, completed = task.completed, value = task.value, repeat = task.repeat, priority = task.priority; if (main) { if (!task._editing) { for (filter in filters) { @@ -5204,6 +5204,13 @@ api.taskClasses = function(task, filters, dayStart, lastCron, showCompleted, mai classes += ' habit-narrow'; } } + if (priority === 1) { + classes += ' difficulty-easy'; + } else if (priority === 1.5) { + classes += ' difficulty-medium'; + } else { + classes += ' difficulty-hard'; + } if (value < -20) { classes += ' color-worst'; } else if (value < -10) { diff --git a/common/script/index.coffee b/common/script/index.coffee index 95b04f2609..461d81e915 100644 --- a/common/script/index.coffee +++ b/common/script/index.coffee @@ -250,7 +250,7 @@ Task classes given everything about the class ### api.taskClasses = (task, filters=[], dayStart=0, lastCron=+new Date, showCompleted=false, main=false) -> return unless task - {type, completed, value, repeat} = task + {type, completed, value, repeat, priority} = task # Filters if main # only show when on your own list @@ -277,6 +277,13 @@ api.taskClasses = (task, filters=[], dayStart=0, lastCron=+new Date, showComplet classes += ' habit-wide' if task.down and task.up classes += ' habit-narrow' if !task.down and !task.up + if priority == 1 + classes += ' difficulty-easy' + else if priority == 1.5 + classes += ' difficulty-medium' + else # priority == 2 + classes += ' difficulty-hard' + if value < -20 classes += ' color-worst' else if value < -10 @@ -771,7 +778,7 @@ api.wrap = (user, main=true) -> user.items.currentMount = "" user.items.currentPet = "" for animal of content.pets - giveTriadBingo = false if user.items.pets[animal] == -1 + giveTriadBingo = false if user.items.pets[animal] == -1 user.items.pets[animal] = 0 user.items.mounts[animal] = null if not user.achievements.beastMasterCount @@ -1353,7 +1360,7 @@ api.wrap = (user, main=true) -> user.stats.gp = if stats.gp >= 0 then stats.gp else 0 tnl = api.tnl(user.stats.lvl) - + # level up & carry-over exp if stats.exp >= tnl #silent = true # push through the negative xp silently