[WIP] Lluita contra jefes. Eliminats actors de la zona de combat
This commit is contained in:
@@ -29,10 +29,13 @@ function caco.new(_hab,_x,_y,_flip)
|
||||
dying=false,
|
||||
death_time=40,
|
||||
anim={19,19,20,21},
|
||||
bb={x=4,y=4,w=24,h=16} }
|
||||
bb={x=4,y=4,w=24,h=16},
|
||||
enabled= true,
|
||||
disable_reason="" }
|
||||
end
|
||||
|
||||
function caco:draw()
|
||||
if not self.enabled then return end
|
||||
-- if self.frame>0 then draw.surf((self.frame&7)*16,(self.frame>>3)*16,16,16,self.x,self.y,16,16,self.flip) end
|
||||
|
||||
if self.warping then
|
||||
@@ -62,6 +65,7 @@ function caco:draw()
|
||||
end
|
||||
|
||||
function caco:update_normal()
|
||||
if not self.enabled then return end
|
||||
self.wait=self.wait+1
|
||||
|
||||
if self.wait==6 then
|
||||
@@ -116,6 +120,7 @@ function caco:update_normal()
|
||||
end
|
||||
|
||||
function caco:update_hit()
|
||||
if not self.enabled then return end
|
||||
local step_time = self.death_time
|
||||
if self.can_warp then
|
||||
step_time = self.death_time/3; -- warp, wait, appear
|
||||
@@ -181,6 +186,7 @@ function caco:update_hit()
|
||||
end
|
||||
|
||||
function caco:hit()
|
||||
if not self.enabled then return end
|
||||
self.update=caco.update_hit
|
||||
|
||||
if self.can_warp then self.warping=true end
|
||||
|
||||
Reference in New Issue
Block a user