diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index ca576b5d47..dcba26bd03 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -12629,7 +12629,7 @@ var process=require("__browserify_process");(function() { if (chance == null) { chance = .03; } - if (user.fns.predictableRandom() <= chance * (1 + stat / 100)) { + if (user.fns.predictableRandom() <= chance * (1 + user._statsComputed[stat] / 100)) { return 1.5 + (.02 * user._statsComputed[stat]); } else { return 1; @@ -12679,10 +12679,11 @@ var process=require("__browserify_process");(function() { var acceptableDrops, chance, drop, dropK, quest, rarity, task, _base, _base1, _base2, _name, _name1, _name2, _ref, _ref1, _ref2, _ref3, _ref4; task = modifiers.task; - chance = _.max([Math.abs(task.value - 25) / 500, .02]); - chance *= task.priority * (1 + (task.streak / 100 || 0)) * (1 + (user._statsComputed.per / 100)) * (1 + (user.contributor.level / 25 || 0)) * (1 + (user.achievements.rebirths / 25 || 0)) * (1 + (user.achievements.streak / 200 || 0)) * (user._tmp.crit || 1) * (1 + (_.reduce(task.checklist, (function(m, i) { + chance = _.min([Math.abs(task.value - 21.27), 37.5]) / 150 + .02; + chance *= task.priority * (1 + (task.streak / 100 || 0)) * (1 + (user._statsComputed.per / 100)) * (1 + (user.contributor.level / 20 || 0)) * (1 + (user.achievements.rebirths / 20 || 0)) * (1 + (user.achievements.streak / 200 || 0)) * (user._tmp.crit || 1) * (1 + .5 * (_.reduce(task.checklist, (function(m, i) { return m + (i.completed ? 1 : 0); }), 0) || 0)); + chance = api.diminishingReturns(chance, 0.75); quest = content.quests[(_ref = user.party.quest) != null ? _ref.key : void 0]; if ((quest != null ? quest.collect : void 0) && user.fns.predictableRandom(user.stats.gp) < (chance * 2)) { dropK = user.fns.randomVal(quest.collect, { diff --git a/script/index.coffee b/script/index.coffee index 3d0ab1dcbd..a2239536ac 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -940,7 +940,8 @@ api.wrap = (user, main=true) -> x - Math.floor(x) crit: (stat='str', chance=.03) -> - if user.fns.predictableRandom() <= chance*(1+stat/100) then 1.5 + (.02*user._statsComputed[stat]) + #console.log("Crit Chance:"+chance*(1+user._statsComputed[stat]/100)) + if user.fns.predictableRandom() <= chance*(1+user._statsComputed[stat]/100) then 1.5 + (.02*user._statsComputed[stat]) else 1 ### @@ -980,17 +981,19 @@ api.wrap = (user, main=true) -> # % chance of getting a drop - chance = _.max([Math.abs(task.value - 25) / 500,.02]) # Base drop chance based on task value. A typical, fresh task will be around 5%. Oldest tasks have a base around 15%, and there's a minimum of 2% for blues. + chance = _.min([Math.abs(task.value - 21.27),37.5])/150+.02 # Base drop chance is a percentage based on task value. Typical fresh task: 15%. Very ripe task: 25%. Very blue task: 2%. chance *= task.priority * # Task priority: +50% for Medium, +100% for Hard (1 + (task.streak / 100 or 0)) * # Streak bonus: +1% per streak (1 + (user._statsComputed.per / 100)) * # PERception: +1% per point - (1 + (user.contributor.level / 25 or 0)) * # Contrib levels: +4% per level - (1 + (user.achievements.rebirths / 25 or 0)) * # Rebirths: +4% per achievement + (1 + (user.contributor.level / 20 or 0)) * # Contrib levels: +5% per level + (1 + (user.achievements.rebirths / 20 or 0)) * # Rebirths: +5% per achievement (1 + (user.achievements.streak / 200 or 0)) * # Streak achievements: +0.5% per achievement (user._tmp.crit or 1) * # Use the crit multiplier if we got one - (1 + (_.reduce(task.checklist,((m,i)->m+(if i.completed then 1 else 0)),0) or 0)) # +100% per checklist item complete + (1 + .5*(_.reduce(task.checklist,((m,i)->m+(if i.completed then 1 else 0)),0) or 0)) # +50% per checklist item complete. TODO: make this into X individual drop chances instead + + chance = api.diminishingReturns(chance, 0.75) #console.log("Drop chance: " + chance)