...
|
...
|
@@ -1834,7 +1834,9 @@ function _M:preUseTalent(ab, silent, fake) |
1834
|
1834
|
|
1835
|
1835
|
if not self:enoughEnergy() and not fake then return false end
|
1836
|
1836
|
|
1837
|
|
- if ab.mode == "sustained" then
|
|
1837
|
+ if self:attr("force_talent_ignore_ressources") then
|
|
1838
|
+ -- nothing
|
|
1839
|
+ elseif ab.mode == "sustained" then
|
1838
|
1840
|
if ab.sustain_mana and self.max_mana < ab.sustain_mana and not self:isTalentActive(ab.id) then
|
1839
|
1841
|
if not silent then game.logPlayer(self, "You do not have enough mana to activate %s.", ab.name) end
|
1840
|
1842
|
return false
|
...
|
...
|
@@ -1864,6 +1866,7 @@ function _M:preUseTalent(ab, silent, fake) |
1864
|
1866
|
return false
|
1865
|
1867
|
end
|
1866
|
1868
|
else
|
|
1869
|
+ if ab.mana then print("============ CHECKE MANA", ab.mana, self:getMana(), ab.mana * (100 + 2 * self:combatFatigue()) / 100) end
|
1867
|
1870
|
if ab.mana and self:getMana() < ab.mana * (100 + 2 * self:combatFatigue()) / 100 then
|
1868
|
1871
|
if not silent then game.logPlayer(self, "You do not have enough mana to cast %s.", ab.name) end
|
1869
|
1872
|
return false
|
...
|
...
|
@@ -1896,7 +1899,7 @@ function _M:preUseTalent(ab, silent, fake) |
1896
|
1899
|
|
1897
|
1900
|
-- Equilibrium is special, it has no max, but the higher it is the higher the chance of failure (and loss of the turn)
|
1898
|
1901
|
-- But it is not affected by fatigue
|
1899
|
|
- if (ab.equilibrium or (ab.sustain_equilibrium and not self:isTalentActive(ab.id))) and not fake then
|
|
1902
|
+ if (ab.equilibrium or (ab.sustain_equilibrium and not self:isTalentActive(ab.id))) and not fake and not self:attr("force_talent_ignore_ressources") then
|
1900
|
1903
|
-- Fail ? lose energy and 1/10 more equilibrium
|
1901
|
1904
|
if not self:attr("no_equilibrium_fail") and not self:equilibriumChance(ab.equilibrium or ab.sustain_equilibrium) then
|
1902
|
1905
|
if not silent then game.logPlayer(self, "You fail to use %s due to your equilibrium!", ab.name) end
|
...
|
...
|
@@ -1907,7 +1910,7 @@ function _M:preUseTalent(ab, silent, fake) |
1907
|
1910
|
end
|
1908
|
1911
|
|
1909
|
1912
|
-- Paradox is special, it has no max, but the higher it is the higher the chance of something bad happening
|
1910
|
|
- if (ab.paradox or (ab.sustain_paradox and not self:isTalentActive(ab.id))) and not fake then
|
|
1913
|
+ if (ab.paradox or (ab.sustain_paradox and not self:isTalentActive(ab.id))) and not fake and not self:attr("force_talent_ignore_ressources") then
|
1911
|
1914
|
-- Check failure first
|
1912
|
1915
|
if not self:attr("no_paradox_fail") and self:paradoxFailChance(ab.paradox or ab.sustain_paradox) and self:getParadox() > 200 then
|
1913
|
1916
|
if not silent then game.logPlayer(self, "You fail to use %s due to your paradox!", ab.name) end
|
...
|
...
|
@@ -1999,7 +2002,9 @@ function _M:postUseTalent(ab, ret) |
1999
|
2002
|
end
|
2000
|
2003
|
|
2001
|
2004
|
local trigger = false
|
2002
|
|
- if ab.mode == "sustained" then
|
|
2005
|
+ if self:attr("force_talent_ignore_ressources") then
|
|
2006
|
+ -- nothing
|
|
2007
|
+ elseif ab.mode == "sustained" then
|
2003
|
2008
|
if not self:isTalentActive(ab.id) then
|
2004
|
2009
|
if ab.sustain_mana then
|
2005
|
2010
|
trigger = true; self:incMaxMana(-ab.sustain_mana)
|
...
|
...
|
@@ -2105,20 +2110,12 @@ end |
2105
|
2110
|
|
2106
|
2111
|
--- Force a talent to activate without using energy or such
|
2107
|
2112
|
function _M:forceUseTalent(t, def)
|
2108
|
|
- local oldpause = game.paused
|
2109
|
|
- local oldenergy = self.energy.value
|
2110
|
|
- if def.ignore_energy then self.energy.value = 10000 end
|
2111
|
|
-
|
2112
|
2113
|
if def.no_equilibrium_fail then self:attr("no_equilibrium_fail", 1) end
|
2113
|
2114
|
if def.no_paradox_fail then self:attr("no_paradox_fail", 1) end
|
2114
|
|
- self:useTalent(t, nil, def.force_level, def.ignore_cd, def.force_target)
|
|
2115
|
+ local ret = {engine.interface.ActorTalents.forceUseTalent(self, t, def)}
|
2115
|
2116
|
if def.no_equilibrium_fail then self:attr("no_equilibrium_fail", -1) end
|
2116
|
2117
|
if def.no_paradox_fail then self:attr("no_paradox_fail", -1) end
|
2117
|
|
-
|
2118
|
|
- if def.ignore_energy then
|
2119
|
|
- game.paused = oldpause
|
2120
|
|
- self.energy.value = oldenergy
|
2121
|
|
- end
|
|
2118
|
+ return unpack(ret)
|
2122
|
2119
|
end
|
2123
|
2120
|
|
2124
|
2121
|
--- Breaks stealth if active
|
...
|
...
|
|