Skip to content
Snippets Groups Projects
Commit aac44822 authored by dg's avatar dg
Browse files

Added new target types (for project): ballbolt, conebolt, ballbeam, conebeam

git-svn-id: http://svn.net-core.org/repos/t-engine4@1096 51575b47-30f0-44d4-a5cc-537603b46e54
parent 5b94c173
No related branches found
No related tags found
No related merge requests found
......@@ -121,6 +121,14 @@ function _M:getType(t)
return {range=t.range, friendlyfire=t.friendlyfire, no_restrict=t.no_restrict, ball=t.radius}
elseif t.type == "cone" then
return {range=t.range, friendlyfire=t.friendlyfire, no_restrict=t.no_restrict, cone=t.radius, cone_angle=t.cone_angle or 55}
elseif t.type == "ballbolt" then
return {range=t.range, friendlyfire=t.friendlyfire, no_restrict=t.no_restrict, ball=t.radius, stop_block=true}
elseif t.type == "conebolt" then
return {range=t.range, friendlyfire=t.friendlyfire, no_restrict=t.no_restrict, cone=t.radius, cone_angle=t.cone_angle or 55, stop_block=true}
elseif t.type == "ballbeam" then
return {range=t.range, friendlyfire=t.friendlyfire, no_restrict=t.no_restrict, ball=t.radius, line=true}
elseif t.type == "conebeam" then
return {range=t.range, friendlyfire=t.friendlyfire, no_restrict=t.no_restrict, cone=t.radius, cone_angle=t.cone_angle or 55, line=true}
else
return {}
end
......
......@@ -33,9 +33,11 @@ newTalent{
if self:getTalentLevel(t) >= 5 then
local tg = {default_target=self, type="hit", nowarning=true, range=10, first_target="friend"}
local tx, ty = self:getTarget(tg)
local _ _, tx, ty = self:canProject(tg, tx, ty)
if tx and ty then
target = game.level.map(tx, ty, Map.ACTOR) or self
if tx then
local _ _, tx, ty = self:canProject(tg, tx, ty)
if tx then
target = game.level.map(tx, ty, Map.ACTOR) or self
end
end
end
......@@ -90,9 +92,11 @@ newTalent{
if self:getTalentLevel(t) >= 5 then
local tg = {default_target=self, type="hit", nowarning=true, range=10, first_target="friend"}
local tx, ty = self:getTarget(tg)
local _ _, tx, ty = self:canProject(tg, tx, ty)
if tx and ty then
target = game.level.map(tx, ty, Map.ACTOR) or self
if tx then
local _ _, tx, ty = self:canProject(tg, tx, ty)
if tx then
target = game.level.map(tx, ty, Map.ACTOR) or self
end
end
end
......
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