
Unfortunately (unrelated to the new tree), Unseen Force is broken unless you put 4 or 5 talent points on it. It also displays negative values in the description. Then at lvl 4 the values become positive and it works.
Moderator: Moderator
How about this line?Hachem_Muche wrote:Well the formula for the number of extra hits you get returns math.max(0, ....) so there should be no way to get negative numbers from it. I don't see any other problems in the talent code.
Code: Select all
getSecondHitChance = function(self, t) return self:combatTalentScale(self:getTalentLevel(t)-4, 15, 35) end,
Code: Select all
local xtrahits = t.getSecondHitChance(self,t)/100
local hitCount = 1 + math.floor(xtrahits)
if rng.percent(xtrahits - math.floor(xtrahits)*100) then hitCount = hitCount + 1 end
Code: Select all
diff --git a/game/modules/tome/data/talents/cursed/force-of-will.lua b/game/modules/tome/data/talents/cursed/force-of-will.lua
index 59466e1..6691371 100644
--- a/game/modules/tome/data/talents/cursed/force-of-will.lua
+++ b/game/modules/tome/data/talents/cursed/force-of-will.lua
@@ -308,7 +308,18 @@ newTalent{
getKnockback = function(self, t)
return 2
end,
- getSecondHitChance = function(self, t) return self:combatTalentScale(self:getTalentLevel(t)-4, 15, 35) end,
+ -- Minimum effects until tLvl > 4
+ getAdjustedTalentLevel = function(self, t)
+ local tLevel = self:getTalentLevel(self, t) - 4
+ -- Do not feed a negative talent level to the scaling functions
+ if tLevel < 0 then
+ tLevel = 0
+ end
+ return tLevel
+ end,
+ getSecondHitChance = function(self, t)
+ return self:combatTalentScale(t.getAdjustedTalentLevel(self, t), 15, 35)
+ end,
action = function(self, t)
game.logSeen(self, "An unseen force begins to swirl around %s!", self.name)
local duration = t.getDuration(self, t)