From 64db3041da9077073a07a453f195eff994a07511 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Mon, 16 Dec 2013 11:47:06 -0700 Subject: [PATCH] classes: add .3*PER to chanceMultiplier in drops. Add .5+(.05*STR) to crits (.03 chance) This is a temporary until we get all the numbers worked out. @SabreCat --- dist/habitrpg-shared.js | 8 +++++--- script/index.coffee | 10 ++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index 92e4188d48..faf562f0db 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -11508,10 +11508,11 @@ var process=require("__browserify_process");(function() { }); }; addPoints = function() { - var afterStreak, gpMod, intMod, streakBonus; + var afterStreak, crit, gpMod, intMod, streakBonus; + crit = user.fns.predictableRandom() <= .03 ? 1.5 + (.05 * user._statsComputed.str) : 1; intMod = 1 + (user._statsComputed.int / 100); - stats.exp += Math.round(delta * XP * intMod * task.priority); - gpMod = delta * task.priority; + stats.exp += Math.round(delta * XP * intMod * task.priority * crit); + gpMod = delta * task.priority * crit; gpMod *= user._statsComputed.per * .3; return stats.gp += task.streak ? (streakBonus = task.streak / 100 + 1, afterStreak = gpMod * streakBonus, gpMod > 0 ? user._tmp.streakBonus = afterStreak - gpMod : void 0, afterStreak) : gpMod; }; @@ -11702,6 +11703,7 @@ var process=require("__browserify_process");(function() { chanceMultiplier = Math.abs(delta); chanceMultiplier *= priority; chanceMultiplier += streak; + chanceMultiplier += user._statsComputed.per * .3; max = 0.75; a = 0.1; alpha = a * max * chanceMultiplier / (a * chanceMultiplier + max); diff --git a/script/index.coffee b/script/index.coffee index 0b9b29cfb4..25630745c7 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -667,12 +667,17 @@ api.wrap = (user) -> delta += nextDelta addPoints = -> + # Critical + crit = + if user.fns.predictableRandom() <= .03 then 1.5 + (.05*user._statsComputed.str) + else 1 + # Exp Modifier intMod = 1 + (user._statsComputed.int / 100) - stats.exp += Math.round(delta * XP * intMod * task.priority) + stats.exp += Math.round(delta * XP * intMod * task.priority * crit) # GP modifier - gpMod = delta * task.priority + gpMod = delta * task.priority * crit gpMod *= (user._statsComputed.per *.3) # Factor in PER stats.gp += if task.streak @@ -833,6 +838,7 @@ api.wrap = (user) -> chanceMultiplier = Math.abs(delta) chanceMultiplier *= priority # multiply chance by reddness chanceMultiplier += streak # streak bonus + chanceMultiplier += user._statsComputed.per*.3 # Temporary solution to lower the maximum drop chance to 75 percent. More thorough # overhaul of drop changes is needed. See HabitRPG/habitrpg#1922 for details.