Skip to content

Commit d3f59b1

Browse files
committed
Some comments to clarify code
1 parent 8380df8 commit d3f59b1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

alchemy/base/alchemy.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,14 +416,16 @@ function M.canUseHerb(user, id)
416416
local alchemyLevel = user:getSkill(Character.alchemy)
417417

418418
for _, herb in pairs(herbs) do
419-
if herb.id == id then
419+
if herb.id == id then -- We found the herb the user is trying to add to their brew
420420
local commonHerb = world:getItemStatsFromId(herb.id)
421421
local level = commonHerb.Level
422422

423-
local breakPoints = {75, 50, 25, 0} -- to ensure fairness for all substances, other level impact is speed of adding the herbs
423+
local breakPoints = {75, 50, 25, 0}
424+
-- to ensure fairness for all substances, we have four breakpoints with one of each substance positive and negative in each
425+
-- level also impacts speed of adding the herbs, which is why you still want to go beyond level 75
424426

425427
for _, breakPoint in ipairs(breakPoints) do
426-
if level > breakPoint then
428+
if level > breakPoint then --We lower the level to the nearest breakpoint. If exactly at the breakpoint, it is actually part of the lower group to allow the numbers to add up for 8 in each category.
427429
level = breakPoint
428430
break
429431
end

0 commit comments

Comments
 (0)