Skip to content

Commit

Permalink
Update stat requirement formula
Browse files Browse the repository at this point in the history
  • Loading branch information
LocalIdentity committed Jan 18, 2025
1 parent c38dd2b commit beae00c
Showing 1 changed file with 4 additions and 27 deletions.
31 changes: 4 additions & 27 deletions src/Modules/CalcTools.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,39 +119,16 @@ function calcLib.gemIsType(gem, type, includeTransfigured)
((type ~= "active skill" and type ~= "grants_active_skill" and type ~= "skill") and gem.tags[type]))
end

-- From PyPoE's formula.py
-- In-game formula
function calcLib.getGemStatRequirement(level, isSupport, multi)
if multi == 0 then
return 0
end
local a, b
local statType = 0.7
if isSupport then
b = 6 * multi / 100
if multi == 100 then
a = 1.495
elseif multi == 60 then
a = 0.945
elseif multi == 40 then
a = 0.6575
else
return 0
end
else
b = 8 * multi / 100
if multi == 100 then
a = 2.1
b = 7.75
elseif multi == 75 then
a = 1.619
elseif multi == 60 then
a = 1.325
elseif multi == 40 then
a = 0.924
else
return 0
end
statType = 0.5
end
local req = round(level * a + b)
local req = round( ( 20 + ( level - 3 ) * 3 ) * ( multi / 100 ) ^ 0.9 * statType )
return req < 14 and 0 or req
end

Expand Down

0 comments on commit beae00c

Please sign in to comment.