Skip to content

Commit

Permalink
Merge pull request #662 from greatbritdan/patch-4
Browse files Browse the repository at this point in the history
Added "enemykill" transform
  • Loading branch information
alesan99 authored Dec 10, 2024
2 parents 23d97e4 + 50dc591 commit 7116f5a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions enemy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2773,6 +2773,11 @@ function enemy:globalcollide(a, b, c, d, dir)
if self.killsenemies and ((self.killsenemiesonsides and (dir == "left" or dir == "right")) or (self.killsenemiesonbottom and dir == "floor") or (self.killsenemiesontop and dir == "ceil") or
(self.killsenemiesonleft and dir == "left") or (self.killsenemiesonright and dir == "right") or (self.killsenemiesonpassive and dir == "passive"))
and a == "enemy" and (not (b.resistsenemykill or b.resistseverything)) and (not b.killsenemies) then

if self.transforms and self:gettransformtrigger("enemykill") and (not self.justspawned) then
self:transform(self:gettransformsinto("enemykill"))
end

return true
end

Expand All @@ -2797,6 +2802,11 @@ function enemy:globalcollide(a, b, c, d, dir)
self.speedy = -(self.bounceforce or 10)
end
addpoints((firepoints[b.t] or 200), self.x, self.y)

if self.transforms and self:gettransformtrigger("enemykill") and (not self.justspawned) then
self:transform(self:gettransformsinto("enemykill"))
end

return true
end
end
Expand Down

0 comments on commit 7116f5a

Please sign in to comment.