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