Code: Select all
doMindStorm = function(self, t, p)
local tgts = {}
local tgts_oc = {}
local grids = core.fov.circle_grids(self.x, self.y, self:getTalentRange(t), true)
for x, yy in pairs(grids) do for y, _ in pairs(grids[x]) do
local a = game.level.map(x, y, Map.ACTOR)
if a and self:reactionToward(a) < 0 then
tgts[#tgts+1] = a
tgts_oc[#tgts_oc+1] = a
end
end end
local wrath = self:hasEffect(self.EFF_FOCUSED_WRATH)
-- Randomly take targets
local tg = self:getTalentTarget(t)
for i = 1, t.getTargetCount(self, t) do
if #tgts <= 0 or self:getFeedback() < 5 then break end
local a, id = rng.table(tgts)
table.remove(tgts, id)
-- Divert the Bolt?
if wrath then
self:projectile(tg, wrath.target.x, wrath.target.y, DamageType.MIND, self:mindCrit(t.getDamage(self, t), nil, wrath.power))
else
self:projectile(tg, a.x, a.y, DamageType.MIND, self:mindCrit(t.getDamage(self, t)))
end
self:incFeedback(-5)
end
(1) should
for x, yy in pairs(grids) do for y, _ in pairs(grids[x]) do
be
for x, y in pairs(grids) do for y, _ in pairs(grids[x]) do
(2) the description says each bolt costs 1 feedback, yet it says:
self:incFeedback(-5)
should this be
self:incFeedback(-1)