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

Merge branch 'the-cure-cure' into 'master'

FOR1.8: Update Disintegration. Change proc tracking from callbackOnActBase to a turn_pro…

…c, fix call to removeEffectsFilter, restore tracking The Cure achievement.

See merge request !736
parents c889e811 772000e1
No related branches found
No related tags found
No related merge requests found
......@@ -273,52 +273,31 @@ newTalent{
doStrip = function(self, t, target, type)
local what = type == "PHYSICAL" and "physical" or "magical"
local p = self:isTalentActive(self.T_DISINTEGRATION)
if what == "physical" and p.physical[target] then return end
if what == "magical" and p.magical[target] then return end
self.turn_procs.disintegration_physical = self.turn_procs.disintegration_physical or {}
self.turn_procs.disintegration_magical = self.turn_procs.disintegration_magical or {}
if what == "physical" and self.turn_procs.disintegration_physical[target] then return end
if what == "magical" and self.turn_procs.disintegration_magical[target] then return end
if rng.percent(t.getChance(self, t)) then
local effs = {}
-- Go through all spell effects
for eff_id, p in pairs(target.tmp) do
local e = target.tempeffect_def[eff_id]
if e.type == what and e.status == "beneficial" then
effs[#effs+1] = {"effect", eff_id}
end
end
if #effs > 0 then
local eff = rng.tableRemove(effs)
if eff[1] == "effect" then
if target:removeEffect(eff[2], self) then
game.logSeen(self, "#CRIMSON#%s's beneficial effect was stripped!#LAST#", target:getName():capitalize())
if what == "physical" then p.physical[target] = true end
if what == "magical" then p.magical[target] = true end
-- The Cure achievement
local acheive = self.player and not target.training_dummy and target ~= self
if acheive then
world:gainAchievement("THE_CURE", self)
end
end
-- effect filter
local filter = {type = what, status = "beneficial"}
if target:removeEffectsFilter(self, filter, 1) > 0 then
game.logSeen(self, "#CRIMSON#%s's beneficial effect was stripped!#LAST#", target:getName():capitalize())
if what == "physical" then self.turn_procs.disintegration_physical[target] = true end
if what == "magical" then self.turn_procs.disintegration_magical[target] = true end
-- The Cure achievement
local acheive = self.player and not target.training_dummy and target ~= self
if acheive then
world:gainAchievement("THE_CURE", self)
end
end
end
end,
callbackOnActBase = function(self, t)
-- reset our targets
local p = self:isTalentActive(self.T_DISINTEGRATION)
if p then
p.physical = {}
p.magical = {}
end
end,
activate = function(self, t)
game:playSoundNear(self, "talents/earth")
local ret = {
physical = {}, magical ={}
}
local ret = { }
if core.shader.active(4) then
ret.particle = self:addParticles(Particles.new("shader_ring_rotating", 1, {rotation=-0.01, radius=1.2}, {type="stone", hide_center=1, zoom=0.6, color1={0.4, 0.4, 0, 1}, color2={0.5, 0.5, 0, 1}, xy={self.x, self.y}}))
end
......
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