fix blast projectile for rearranged checks
This commit is contained in:
parent
c90b56b603
commit
2b02d2b94b
@ -1166,21 +1166,32 @@ blast = {
|
|||||||
damage = 4,
|
damage = 4,
|
||||||
dx = 0, -- px/frame
|
dx = 0, -- px/frame
|
||||||
dy = 2,
|
dy = 2,
|
||||||
|
awaitcancel = false,
|
||||||
|
|
||||||
-- disable damage for 2 frames
|
-- disable damage for 2 frames
|
||||||
-- when hitting something
|
-- when hitting something
|
||||||
hitship = function(self, _)
|
hitship = function(self, _)
|
||||||
self.damage = 0
|
if self.damage > 0 and not self.awaitcancel then
|
||||||
local wait = 2
|
self.awaitcancel = true
|
||||||
events:push_back{move = function()
|
events:push_back{move = function()
|
||||||
wait -= 1
|
new_events:push_back{
|
||||||
if wait <= 0 then
|
wait = 2,
|
||||||
self.damage = 4
|
obj = self,
|
||||||
|
saved_dmg = self.damage,
|
||||||
|
move = function(self)
|
||||||
|
self.wait -= 1
|
||||||
|
if self.wait <= 0 then
|
||||||
|
self.obj.damage = self.saved_dmg
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return false
|
end,
|
||||||
|
}
|
||||||
|
self.damage = 0
|
||||||
|
self.awaitcancel = false
|
||||||
|
return true
|
||||||
end}
|
end}
|
||||||
end
|
end
|
||||||
|
end
|
||||||
}
|
}
|
||||||
blast_t = {
|
blast_t = {
|
||||||
__index = blast
|
__index = blast
|
||||||
|
Loading…
Reference in New Issue
Block a user