[WIP] Treballant en el jefe. Organitzant codi (Ha deixat de funcionar quasi tot)

[FIX] Els warps reutilitzats mantenien l'estat anterior
[NEW] Funcio distancia(a, b)
This commit is contained in:
2026-04-12 23:02:35 +02:00
parent f26d43a97d
commit a43173a940
15 changed files with 1293 additions and 22 deletions

74
data/imp_super.lua Normal file
View File

@@ -0,0 +1,74 @@
function imp:super_ready()
if not DEBUG_FN_NAME then print("super_ready()") end
if self.x<self.hot_points[3].x then
self.target = self.hot_points[3]
self.path = {next=3, actions= {{action="jumpfwd", event="land"},
{action="right" , event="target"},
{action="super" , event="super_ready"}}}
end
--if self.x<self.hot_points[3].x then
-- self.target = self.hot_points[11]
-- self.path = {next=11, actions= {{action="jumpfwd", event="land"},
-- {action="right" , event="target"},
-- {action="super" , event="super_ready"}}}
--else
-- self.target = self.hot_points[12]
-- self.path = {next=12, actions= {{action="jumpfwd", event="land"},
-- {action="left" , event="target"},
-- {action="super" , event="super_ready"}}}
--end
end
function imp:super()
if not DEBUG_FN_NAME then print("super()") end
self:super_movement()
-- self.fight_mode = self.fight_modes["super"]
self.invencible = true
self.update=self.state_super
end
function imp:state_super()
if DEBUG_FN_NAME then print("state_super") end
self.super_wait = self.super_wait -1
if self.zoom<1.75 and self.super_wait>100 then
if self.super_wait%4==0 then self.zoom=self.zoom+0.1 end
elseif not self.super_fired and self.zoom>=1.75 and self.super_wait>100 then
local x_ini = self.x+self.bb.x+self.bb.w+4
local hab, tx, ty, off_x, off_y = coords.world_to_tile(x_ini,self.y+(self.h/2))
fireball.init(hab, tx, ty, false, off_x, off_y, 2)
self.super_fired = true
elseif self.zoom>1 and self.super_wait<=100 then
if self.super_wait%4==0 then self.zoom=self.zoom-0.1 end
end
if self.super_wait == 0 then
self.update=imp.super_end
end
end
function imp:super_end()
print("super_end()")
self.zoom = 1
self.super_wait = 200
-- self.super_cooldown=2000
self.super_cooldown=200
self:reset_fight_mode_cooldown()
self.invencible = false
self.super_fired = false
self:free_movement()
self.update=imp.state_normal
end
function imp:super_movement()
if DEBUG_FN_NAME then print("super_movement") end
self.movement_type = "super"
print("Super")
end
function imp:super_next_action()
print("Super Next Action")
end
function imp:super_next_target()
print("Super Next Target")
end