BulwarkFrame v0.2.0

This commit is contained in:
2026-08-17 15:19:45 +02:00
parent 7cd508e2a3
commit 2b6de41d9a
8 changed files with 253 additions and 35 deletions
+4 -1
View File
@@ -168,7 +168,10 @@ C.RANK_RATE = { [0] = 0, [1] = 0.05, [2] = 0.10, [3] = 0.15 }
-- neither is assumed; the caller decides once measurement settles it.
function C.rateForRank(rank, addBonus, multBonus)
local base = C.RANK_RATE[rank or -1]
if not base then return 0 end
-- `<= 0` and not just `not base`: rank 0 maps to a rate of 0, and 0 is truthy in Lua, so a
-- bare nil check would let an additive set bonus resurrect a rate for a talent the character
-- has not learned -- exactly the confidently wrong number this guard exists to prevent.
if not base or base <= 0 then return 0 end
if type(addBonus) == "number" then base = base + addBonus end
if type(multBonus) == "number" then base = base * multBonus end
return base