From 9f77819d94826803784385e126bf5c0fbcdb3243 Mon Sep 17 00:00:00 2001 From: Alice Harris Date: Sat, 20 Dec 2014 11:07:47 +1000 Subject: [PATCH] add pickpocket change from PR by brandonjreid: https://github.com/HabitRPG/habitrpg-shared/pull/331/files#diff-652dbbf3d459e90a3de1a122c063bb6bL502 --- script/content.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script/content.coffee b/script/content.coffee index 13cce8424e..f7f7a245f3 100644 --- a/script/content.coffee +++ b/script/content.coffee @@ -445,6 +445,8 @@ api.gearTypes = gearTypes # diminishingReturns = (bonus, max, halfway=max/2) -> max*(bonus/(bonus+halfway)) +calculateBonus = (value, stat, crit=1, stat_scale=0.5) -> (if value < 0 then 1 else value+1) + (stat * stat_scale * crit) + api.spells = wizard: @@ -543,8 +545,8 @@ api.spells = target: 'task' notes: t('spellRoguePickPocketNotes') cast: (user, target) -> - bonus = (if target.value < 0 then 1 else target.value+2) + (user._statsComputed.per * 0.5) - user.stats.gp += 25 * (bonus / (bonus + 75)) + bonus = calculateBonus(target.value, user._statsComputed.per) + user.stats.gp += diminishingReturns(bonus, 25, 75) backStab: text: t('spellRogueBackStabText') mana: 15