Skip to content
Snippets Groups Projects
Commit 598fe887 authored by dg's avatar dg
Browse files

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
parent cb3ed18a
No related branches found
No related tags found
No related merge requests found
......@@ -1753,13 +1753,15 @@ function _M:equilibriumChance(eq)
if eq < wil then return true, 100 end
eq = eq - wil
local chance = math.sqrt(eq) / 60
print("[Equilibrium] Use chance: ", 100 - chance * 100, "::", self:getEquilibrium())
--print("[Equilibrium] Use chance: ", 100 - chance * 100, "::", self:getEquilibrium())
chance = util.bound(chance, 0, 1)
return rng.percent(100 - chance * 100), 100 - chance * 100
end
--- Paradox check
function _M:paradoxFailChance(pa)
--check for Paradox Mastery
local modifier
if self:knowTalent(self.T_PARADOX_MASTERY) and self:isTalentActive(self.T_PARADOX_MASTERY) then
modifier = self:getWil() * (1 + (self:getTalentLevel(self.T_PARADOX_MASTERY)/10) or 0 )
else
......@@ -1768,6 +1770,7 @@ function _M:paradoxFailChance(pa)
--print("[Paradox] Will modifier: ", modifier, "::", self:getParadox())
local chance = math.pow (((self:getParadox() - modifier)/200), 2)*((100 + self:combatFatigue()) / 100)
--print("[Paradox] Fail chance: ", chance, "::", self:getParadox())
chance = util.bound(chance, 0, 100)
return rng.percent(chance), chance
end
......
......@@ -220,7 +220,8 @@ function _M:display()
)) h = h + self.font_h
end
if player:knowTalent(player.T_EQUILIBRIUM_POOL) then
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,
local _, chance = player:equilibriumChance()
self:mouseTooltip(self.TOOLTIP_EQUILIBRIUM, self:makeTextureBar("#00ff74#Equi:", ("%d"):format(player:getEquilibrium()), 100 - chance, 100, x, h, 255, 255, 255,
{r=0x00 / 2, g=0xff / 2, b=0x74 / 2},
{r=0x00 / 5, g=0xff / 5, b=0x74 / 5}
)) h = h + self.font_h
......@@ -250,7 +251,8 @@ function _M:display()
)) h = h + self.font_h
end
if player:knowTalent(player.T_PARADOX_POOL) then
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,
local _, chance = player:paradoxFailChance()
self:mouseTooltip(self.TOOLTIP_PARADOX, self:makeTextureBar("#LIGHT_STEEL_BLUE#Paradox:", (" %d"):format(player:getParadox()), chance, 100, x, h, 255, 255, 255,
{r=176 / 2, g=196 / 2, b=222 / 2},
{r=176 / 2, g=196 / 2, b=222 / 2}
)) h = h + self.font_h
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment