[WIP] Treballant en el jefe. Almenys ja no explota, algo es algo
This commit is contained in:
@@ -41,14 +41,16 @@ function imp:next_action()
|
||||
next_action = self.actions.shot
|
||||
end
|
||||
end
|
||||
|
||||
print("next_action= "..next_action.." == "..self.actions.no_action)
|
||||
if next_action==self.actions.no_action then
|
||||
if self.move_type==self.move_types.free then
|
||||
-- msg_print(10,20,"FREE",true)
|
||||
next_action = self:free_next_action()
|
||||
elseif self.move_type==self.move_types.pattern then
|
||||
-- msg_print(10,20,"PATTERN "..self.action_event,true)
|
||||
print("imp_action.lua -> next_action -> pattern")
|
||||
next_action=self:pattern_next_action()
|
||||
print("imp_action.lua -> next_action -> pattern => "..next_action)
|
||||
elseif self.move_type==self.move_types.super then
|
||||
-- msg_print(10,20,"SUPER "..self.action_event,true)
|
||||
end
|
||||
@@ -110,21 +112,23 @@ end
|
||||
|
||||
function imp:pattern_next_action()
|
||||
if DEBUG_FN_NAME then print("pattern_next_action") end
|
||||
print("self.pattern_point= ".. self.pattern_point)
|
||||
local pattern_event = self.pattern.actions[self.pattern_point].event
|
||||
|
||||
print("imp_action.lua -> pattern_next_action -> "..self.action_event.."~="..pattern_event)
|
||||
-- Si no s'ha donat l'event mantindre el moviment
|
||||
if self.action_event~=pattern_event then
|
||||
action = self.actions[self.pattern.actions[self.pattern_point].action]
|
||||
else
|
||||
-- Si s'ha donat l'event avançar el punter del path
|
||||
-- Si no queden accions carregar el següent path
|
||||
if self.pattern_point<#self.pattern.actions then
|
||||
self:pattern_get_next_path()
|
||||
self.pattern_point = 0
|
||||
end
|
||||
|
||||
-- En el path
|
||||
self.pattern_point = self.pattern_point + 1
|
||||
-- Si no queden accions carregar el següent path
|
||||
print(self.pattern_point..">#"..#self.pattern.actions)
|
||||
if self.pattern_point>#self.pattern.actions then
|
||||
self:pattern_get_next_path()
|
||||
end
|
||||
|
||||
print("-self.pattern_point= ".. self.pattern_point)
|
||||
action = self:pattern_action()
|
||||
end
|
||||
self.action_event = ""; -- Action_event processat
|
||||
@@ -132,8 +136,13 @@ if DEBUG_FN_NAME then print("pattern_next_action") end
|
||||
end
|
||||
|
||||
function imp:pattern_action()
|
||||
if DEBUG_FN_NAME then print("pattern_action") end
|
||||
return self.actions[self.path.actions[self.pattern_point].action]
|
||||
if not DEBUG_FN_NAME then print("pattern_action") end
|
||||
local idx = self.pattern_point
|
||||
print(idx)
|
||||
local pattern_action = self.pattern.actions[idx]
|
||||
local curr_action = pattern_action.action
|
||||
local next_action = self.actions[curr_action]
|
||||
return next_action
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user