Skip to content
Snippets Groups Projects
Commit 16430f0d authored by DarkGod's avatar DarkGod
Browse files

Disruption Shield correctly explodes once your mana dips below 50%, for whatever reason

parent 2c5a51f4
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -5327,6 +5327,16 @@ function _M:paradoxDoAnomaly(chance, paradox, def)
end
end
-- Overwrite incParadox to set up threshold log messages
local previous_incMana = _M.incMana
function _M:incMana(mana)
if mana < 0 and self:isTalentActive(self.T_DISRUPTION_SHIELD) then
self:callTalent(self.T_DISRUPTION_SHIELD, "doLostMana", mana)
end
return previous_incMana(self, mana)
end
-- Overwrite incParadox to set up threshold log messages
local previous_incParadox = _M.incParadox
......
......@@ -199,11 +199,19 @@ newTalent{
local max = t.getMaxAbsorb(self, t)
self.disruption_shield_power = math.min(self.disruption_shield_power + max / 10, max)
end,
doLostMana = function(self, t, mana)
if (self:getMana() - mana) / self:getMaxMana() < 0.5 then
self:forceUseTalent(self.T_DISRUPTION_SHIELD, {ignore_energy=true})
end
end,
callbackOnHit = function(self, t, cb, src, dt)
local p = self:isTalentActive(t.id)
if not p then return end
if cb.value <= 0 then return end
if self:getMana() / self:getMaxMana() < 0.5 then return end
if self:getMana() / self:getMaxMana() < 0.5 then
self:forceUseTalent(self.T_DISRUPTION_SHIELD, {ignore_energy=true})
return
end
-- if self:reactionToward(src) > 0 then return end
self.disruption_shield_power = self.disruption_shield_power or 0
self.disruption_shield_storage = self.disruption_shield_storage or 0
......
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