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

archery

git-svn-id: http://svn.net-core.org/repos/t-engine4@344 51575b47-30f0-44d4-a5cc-537603b46e54
parent 4aead0e8
No related branches found
No related tags found
No related merge requests found
......@@ -119,23 +119,31 @@ function _M:project(t, x, y, damtype, dam, particles)
end
-- Now project on each grid, one type
for px, ys in pairs(grids) do
for py, _ in pairs(ys) do
-- Call the projected method of the target grid if possible
if not game.level.map:checkAllEntities(x, y, "projected", self, t, x, y, damtype, dam, particles) then
-- Friendly fire ?
if px == self.x and py == self.y then
if t.friendlyfire then
if type(damtype) == "function" then
for px, ys in pairs(grids) do
for py, _ in pairs(ys) do
damtype(px, py)
end
end
else
for px, ys in pairs(grids) do
for py, _ in pairs(ys) do
-- Call the projected method of the target grid if possible
if not game.level.map:checkAllEntities(x, y, "projected", self, t, x, y, damtype, dam, particles) then
-- Friendly fire ?
if px == self.x and py == self.y then
if t.friendlyfire then
DamageType:get(damtype).projector(self, px, py, damtype, dam)
if particles then
game.level.map:particleEmitter(px, py, 1, particles.type)
end
end
else
DamageType:get(damtype).projector(self, px, py, damtype, dam)
if particles then
game.level.map:particleEmitter(px, py, 1, particles.type)
end
end
else
DamageType:get(damtype).projector(self, px, py, damtype, dam)
if particles then
game.level.map:particleEmitter(px, py, 1, particles.type)
end
end
end
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