diff --git a/data/game.lua b/data/game.lua index 06cb25e..7015485 100644 --- a/data/game.lua +++ b/data/game.lua @@ -175,7 +175,10 @@ function world_update() -- Comprovar dispars contra "monstres" if viewp:inside(actor.x, actor.y, actor.w, actor.h) and actor~=abad then for _, cacau_shot in pairs(cacau.shots()) do - if cacau_shot.alive and collision(actor,cacau_shot) then + -- if collision(actor,cacau_shot) then print("COLLISION") end + -- if actor.enabled then print(actor.name) else print("NOT "..actor.name) end + -- if cacau_shot.alive then print("CACAU") end + if actor.enabled and cacau_shot.alive and collision(actor,cacau_shot) then if actor.hit ~= nil and not actor.dying then actor:hit() if actor.can_warp then warp.open(actor) end diff --git a/data/imp.lua b/data/imp.lua index 68b051e..69a17f9 100644 --- a/data/imp.lua +++ b/data/imp.lua @@ -50,7 +50,7 @@ function imp.new(_hab, _x, _y) step=0, hurting=0, jumpfwd=false, - step_length=1, + step_length=0.6, vmove_space=1, max_jump_height=24, jump_height=0, @@ -70,6 +70,9 @@ function imp.new(_hab, _x, _y) super_cooldown=2000, shot_cooldown=500, action="", + enabled=true, + disable_reason="", + can_warp=false, fight=imp.fight, draw=imp.draw, hit=imp.hit, @@ -106,7 +109,7 @@ function imp:draw() end function imp:hit() - -- + print("HIT!") end function imp:direccio( actor ) diff --git a/data/stage1.lua b/data/stage1.lua index 005d305..2c023be 100644 --- a/data/stage1.lua +++ b/data/stage1.lua @@ -132,6 +132,8 @@ function stages.stage1_boss() -- actors_in_room_backup_and_remove(stage1_boss_mapa.r0.r,stage1_boss_mapa.r1.r) viewp:fixed({l=8,r=44,u=48,d=0}) stages.boss_loaded = true + boss.reason="" + boss.enabled=true boss:fight() end end diff --git a/data/zombie.lua b/data/zombie.lua index 1d6c81b..0d3e9db 100644 --- a/data/zombie.lua +++ b/data/zombie.lua @@ -118,7 +118,7 @@ function zombie:update_hit() self.frame=self.anim[0] self.step=0 self.wait=0 - self.update=caco.update_normal + self.update=zombie.update_normal self.dying = false end end