Commit 598fe88744161bbf463f779b00bfc65eb42b5912

Authored by dg
1 parent cb3ed18a

Equilibrium & Paradox bars on the left pane fill with failure chance instead of a meaningless log


git-svn-id: http://svn.net-core.org/repos/t-engine4@3344 51575b47-30f0-44d4-a5cc-537603b46e54
... ... @@ -1753,13 +1753,15 @@ function _M:equilibriumChance(eq)
1753 1753 if eq < wil then return true, 100 end
1754 1754 eq = eq - wil
1755 1755 local chance = math.sqrt(eq) / 60
1756   - print("[Equilibrium] Use chance: ", 100 - chance * 100, "::", self:getEquilibrium())
  1756 + --print("[Equilibrium] Use chance: ", 100 - chance * 100, "::", self:getEquilibrium())
  1757 + chance = util.bound(chance, 0, 1)
1757 1758 return rng.percent(100 - chance * 100), 100 - chance * 100
1758 1759 end
1759 1760
1760 1761 --- Paradox check
1761 1762 function _M:paradoxFailChance(pa)
1762 1763 --check for Paradox Mastery
  1764 + local modifier
1763 1765 if self:knowTalent(self.T_PARADOX_MASTERY) and self:isTalentActive(self.T_PARADOX_MASTERY) then
1764 1766 modifier = self:getWil() * (1 + (self:getTalentLevel(self.T_PARADOX_MASTERY)/10) or 0 )
1765 1767 else
... ... @@ -1768,6 +1770,7 @@ function _M:paradoxFailChance(pa)
1768 1770 --print("[Paradox] Will modifier: ", modifier, "::", self:getParadox())
1769 1771 local chance = math.pow (((self:getParadox() - modifier)/200), 2)*((100 + self:combatFatigue()) / 100)
1770 1772 --print("[Paradox] Fail chance: ", chance, "::", self:getParadox())
  1773 + chance = util.bound(chance, 0, 100)
1771 1774 return rng.percent(chance), chance
1772 1775 end
1773 1776
... ...
... ... @@ -220,7 +220,8 @@ function _M:display()
220 220 )) h = h + self.font_h
221 221 end
222 222 if player:knowTalent(player.T_EQUILIBRIUM_POOL) then
223   - self:mouseTooltip(self.TOOLTIP_EQUILIBRIUM, self:makeTextureBar("#00ff74#Equi:", ("%d"):format(player:getEquilibrium()), math.min(1, math.log(1 + player:getEquilibrium() / 100)), 100, x, h, 255, 255, 255,
  223 + local _, chance = player:equilibriumChance()
  224 + self:mouseTooltip(self.TOOLTIP_EQUILIBRIUM, self:makeTextureBar("#00ff74#Equi:", ("%d"):format(player:getEquilibrium()), 100 - chance, 100, x, h, 255, 255, 255,
224 225 {r=0x00 / 2, g=0xff / 2, b=0x74 / 2},
225 226 {r=0x00 / 5, g=0xff / 5, b=0x74 / 5}
226 227 )) h = h + self.font_h
... ... @@ -250,7 +251,8 @@ function _M:display()
250 251 )) h = h + self.font_h
251 252 end
252 253 if player:knowTalent(player.T_PARADOX_POOL) then
253   - self:mouseTooltip(self.TOOLTIP_PARADOX, self:makeTextureBar("#LIGHT_STEEL_BLUE#Paradox:", (" %d"):format(player:getParadox()), math.min(1, math.log(1 + player:getParadox() / 100)), 100, x, h, 255, 255, 255,
  254 + local _, chance = player:paradoxFailChance()
  255 + self:mouseTooltip(self.TOOLTIP_PARADOX, self:makeTextureBar("#LIGHT_STEEL_BLUE#Paradox:", (" %d"):format(player:getParadox()), chance, 100, x, h, 255, 255, 255,
254 256 {r=176 / 2, g=196 / 2, b=222 / 2},
255 257 {r=176 / 2, g=196 / 2, b=222 / 2}
256 258 )) h = h + self.font_h
... ...