[WIP] Treballant en el jefe. Implementant chase i avoid
This commit is contained in:
@@ -32,9 +32,9 @@ function imp.new(_hab,_x,_y)
|
||||
anim={28,29,28,30}, -- seqüencia de frames
|
||||
wait=0,
|
||||
step=0,
|
||||
moods={stop=0, chase=1, avoid=2, neutral=4},
|
||||
mood=0, --anterior fight_mode
|
||||
timers={mood=150,target=350, shot=100, super=200, super_wait=200, flip_wait=50, stucked_locked=50}, --anterior *_cooldown
|
||||
moods={"stop",PATTERN_CHASE, PATTERN_AVOID, PATTERN_RANDOM }, -- deu coincidir en els modes de pattern
|
||||
mood="stop", --anterior fight_mode
|
||||
timers={mood=150,target=350, shot=100, super=2000, super_wait=200, flip_wait=50, stucked_locked=50}, --anterior *_cooldown
|
||||
move_types={free=0, pattern=1, super=2},
|
||||
move_type=1, -- anterior movement_type
|
||||
actions={no_action=0, up=1, down=2, left=4, right=8, jump=16, shot=32, super=64, jumpfwd=128},
|
||||
@@ -88,6 +88,7 @@ function imp.new(_hab,_x,_y)
|
||||
super_movement = imp.super_movement,
|
||||
hit = imp.hit,
|
||||
warp_update = imp.warp_update,
|
||||
choose_mood = imp.choose_mood,
|
||||
-- debug
|
||||
_moure = imp._moure,
|
||||
_pause = false,
|
||||
@@ -231,13 +232,13 @@ function imp:update_normal()
|
||||
|
||||
if not self._pause then
|
||||
-- print("-------------------------------------------------")
|
||||
-- if self.mood~=self.moods.stop then print("TARGET= "..self.pattern:target()) end
|
||||
-- if self.mood~=self.moods.stop then print("ACT/EV= "..self.pattern:action().." / "..self.pattern:event()) end
|
||||
-- if self.mood~=self.moods.stop then print("ACTIONS= "..#self.pattern:actions()) end
|
||||
-- if self.mood~="stop" then print("TARGET= "..self.pattern:target()) end
|
||||
-- if self.mood~="stop" then print("ACT/EV= "..self.pattern:action().." / "..self.pattern:event()) end
|
||||
-- if self.mood~="stop" then print("ACTIONS= "..#self.pattern:actions()) end
|
||||
self:reduce_timers()
|
||||
|
||||
-- Ajustar mood (emocions)
|
||||
-- self:choose_mood()
|
||||
self:choose_mood()
|
||||
|
||||
-- self:choose_target()
|
||||
|
||||
@@ -251,7 +252,7 @@ function imp:update_normal()
|
||||
self:choose_action()
|
||||
-- local str_aev = ""
|
||||
-- for k,v in pairs(self.action_event) do str_aev=str_aev..", "..v end
|
||||
-- if self.mood~=self.moods.stop then print("TARGET= "..self.pattern:target().." ACTION= "..self.pattern:action().." ACTION EVENT= "..self.pattern:event().." / "..str_aev) end
|
||||
-- if self.mood~="stop" then print("TARGET= "..self.pattern:target().." ACTION= "..self.pattern:action().." ACTION EVENT= "..self.pattern:event().." / "..str_aev) end
|
||||
-- moviment
|
||||
self:controller_input()
|
||||
self:moure()
|
||||
|
||||
Reference in New Issue
Block a user