From 10ab2a93742b72d113a2f8b547241614873d382c Mon Sep 17 00:00:00 2001 From: BlackEdder Date: Thu, 28 Nov 2013 18:06:48 +0000 Subject: [PATCH 1/2] Calculate chance to drop using a slowly increasing function Maximum of the function is probability of 0.75. The old system would give a guaranteed drop at a modifier of 20. With this function the probability is then roughly .55. --- script/algos.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/algos.coffee b/script/algos.coffee index efcc8531db..1cdcad65bc 100644 --- a/script/algos.coffee +++ b/script/algos.coffee @@ -127,7 +127,11 @@ randomDrop = (user, delta, priority, streak = 0, options={}) -> chanceMultiplier *= obj.priorityValue(priority) # multiply chance by reddness chanceMultiplier += streak # streak bonus - if user.flags?.dropsEnabled and Math.random() < (.05 * chanceMultiplier) + max = 0.75 # Max probability of drop + a = 0.1 # rate of increase + alpha = a*max*chanceMultiplier/(a*chanceMultiplier+max) # current probability of drop + + if user.flags?.dropsEnabled and Math.random() < alpha # current breakdown - 1% (adjustable) chance on drop # If they got a drop: 50% chance of egg, 50% Hatching Potion. If hatchingPotion, broken down further even further rarity = Math.random() From 9fad649c64fb5159cc670726e217435aa0a169fc Mon Sep 17 00:00:00 2001 From: BlackEdder Date: Sun, 1 Dec 2013 18:46:53 +0000 Subject: [PATCH 2/2] Added comment about further changes that will be needed --- script/algos.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/algos.coffee b/script/algos.coffee index 1cdcad65bc..87580b9414 100644 --- a/script/algos.coffee +++ b/script/algos.coffee @@ -127,6 +127,10 @@ randomDrop = (user, delta, priority, streak = 0, options={}) -> chanceMultiplier *= obj.priorityValue(priority) # multiply chance by reddness chanceMultiplier += streak # streak bonus + # 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. + # Old drop chance: + # if user.flags?.dropsEnabled and Math.random() < (.05 * chanceMultiplier) max = 0.75 # Max probability of drop a = 0.1 # rate of increase alpha = a*max*chanceMultiplier/(a*chanceMultiplier+max) # current probability of drop