Prevent over-capped powerups

Higher than possible RE chance can lead to powerups created outside the possible realm.
With the formula: ( ( (skillMod * rand(randomRollMin, 1.25f) ) / 100) + rand(1.0f, 1.25f)) * power;
skillMod is a possible max of 169:
100	level 90
10	expertise
5	arm
11	pup
11	pup
11	pup
4	wep
4	chest
3	shirt
10	tool
169	total
rolling the max for both randoms (1.25 and 1.25), we end up with
( ( (169 * 1.25) / 100) + 1.25) * 35 (where power = the power bit = 35 max)
= a max of 117.6875 power
This commit is contained in:
Elour
2019-03-30 10:44:35 -07:00
parent dcdb80f8ff
commit b358dfe356

View File

@@ -491,6 +491,8 @@ public class reverse_engineering_tool extends script.base_script
obj_id powerup = static_item.createNewItemFunction(getGemTemplateByClass(player, ratio, 1), inventory);
if (isIdValid(powerup))
{
if(power > 117)
power = 117;
setObjVar(powerup, "reverse_engineering.reverse_engineering_power", power);
setObjVar(powerup, "reverse_engineering.reverse_engineering_modifier", mod);
setObjVar(powerup, "reverse_engineering.reverse_engineering_ratio", ratio);