Commit af1957c644f6b877b033bc2c1ea31f226fa1578a

Authored by Chris Davidson
1 parent 3cdee491

Fix Confused stacking past 50% via multiple effects

... ... @@ -1315,7 +1315,7 @@ function _M:move(x, y, force)
1315 1315
1316 1316 -- Confused ?
1317 1317 if not force and self:attr("confused") then
1318   - if rng.percent(self:attr("confused")) then
  1318 + if rng.percent(util.bound(self:attr("confused"), 0, 50)) then
1319 1319 x, y = self.x + rng.range(-1, 1), self.y + rng.range(-1, 1)
1320 1320 end
1321 1321 end
... ... @@ -5497,7 +5497,7 @@ function _M:preUseTalent(ab, silent, fake)
5497 5497 if not ab.never_fail then
5498 5498 -- Confused ? lose a turn!
5499 5499 if self:attr("confused") and (ab.mode ~= "sustained" or not self:isTalentActive(ab.id)) and util.getval(ab.no_energy, self, ab) ~= true and not fake and not self:attr("force_talent_ignore_ressources") then
5500   - if rng.percent(self:attr("confused")) then
  5500 + if rng.percent(util.bound(self:attr("confused"), 0, 50)) then
5501 5501 if not silent then game.logSeen(self, "%s is confused and fails to use %s.", self.name:capitalize(), ab.name) end
5502 5502 self:useEnergy()
5503 5503 return false
... ...