fix blast projectile for rearranged checks
This commit is contained in:
parent
c90b56b603
commit
2b02d2b94b
@ -1166,21 +1166,32 @@ 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
|
||||
if self.damage > 0 and not self.awaitcancel then
|
||||
self.awaitcancel = true
|
||||
events:push_back{move = function()
|
||||
wait -= 1
|
||||
if wait <= 0 then
|
||||
self.damage = 4
|
||||
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
|
||||
return false
|
||||
end,
|
||||
}
|
||||
self.damage = 0
|
||||
self.awaitcancel = false
|
||||
return true
|
||||
end}
|
||||
end
|
||||
end
|
||||
}
|
||||
blast_t = {
|
||||
__index = blast
|
||||
|
Loading…
Reference in New Issue
Block a user