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

stuff

parent 0673e711
No related branches found
No related tags found
No related merge requests found
......@@ -267,3 +267,24 @@ function _M:pickSpotRemove(filter)
table.remove(self.spots, s.idx)
return s.spot
end
--- Pick a random spot matching the given filter
function _M:pickSpotFrom(filter, spots)
local list = {}
for i, spot in ipairs(spots) do
if not filter or game.zone:checkFilter(spot, filter) then list[#list+1] = spot end
end
return rng.table(list), list
end
--- Pick a random spot matching the given filter and remove it
function _M:pickSpotRemoveFrom(filter, spots)
local list = {}
for i, spot in ipairs(spots) do
if not filter or game.zone:checkFilter(spot, filter) then list[#list+1] = {spot=spot, idx=i} end
end
local s = rng.table(list)
if not s then return end
table.remove(spots, s.idx)
return s.spot
end
......@@ -726,7 +726,7 @@ newTalent{
reflectable = true,
requires_target = true,
proj_speed = 2,
target = function(self, t) return {type="bolt", range=self:getTalentRange(t), talent=t, display={particle="bolt_void", trail="voidtrail"}} end,
target = function(self, t) return {type="beam", range=self:getTalentRange(t), talent=t, selffire=false, display={particle="bolt_void", trail="voidtrail"}} end,
action = function(self, t)
local tg = self:getTalentTarget(t)
local x, y = self:getTarget(tg)
......
No preview for this file type
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