fix blast projectile for rearranged checks

This commit is contained in:
Kistaro Windrider 2023-09-30 12:52:58 -07:00
parent c90b56b603
commit 2b02d2b94b
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -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