[FIX] Els warps reutilitzats mantenien l'estat anterior [NEW] Funcio distancia(a, b)
74 lines
2.5 KiB
Lua
74 lines
2.5 KiB
Lua
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 |