Lines Matching refs:enemy

3 local enemy = ...
4 local game = enemy:get_game()
5 local map = enemy:get_map()
16 function enemy:on_created()
18 local sprite_id = "enemies/" .. enemy:get_breed()
38 function enemy:on_restarted()
44 function enemy:on_hurt()
50 function enemy:get_state() return state end
51 function enemy:set_state(new_state)
71 function enemy:wait_for_hero()
74 if enemy:get_distance(hero) <= detection_distance then
75 enemy:start_flying()
83 function enemy:update_height(new_height)
90 height_timer = sol.timer.start(enemy, 50, function()
107 function enemy:update_shadow()
113 shadow_timer = sol.timer.start(enemy, 10, function()
123 function enemy:start_flying()
137 if enemy:get_distance(hero) <= detection_distance then
138 enemy:start_flying() -- Start new movement.
140 enemy:wait_for_hero() -- Wait for hero.
144 enemy:restart()
153 function enemy:get_sprite_damage(sprite)
156 function enemy:set_sprite_damage(sprite, damage)
161 function enemy:on_attacking_hero(hero, enemy_sprite)
162 local enemy = self
163 local hero = enemy:get_map():get_hero()
165 if enemy:get_sprite_damage(enemy_sprite) == 0 then return end
166 local collision_mode = enemy:get_attacking_collision_mode()
167 if not hero:overlaps(enemy, collision_mode) then return end
170 and hero:is_shield_protecting_from_enemy(enemy, enemy_sprite) then
174 if enemy.custom_attacking_collision_test and
175 not enemy:custom_attacking_collision_test(enemy_sprite) then
179 local damage = enemy:get_damage()
181 hero:start_hurt(enemy, enemy_sprite, damage)
183 hero:start_hurt(enemy, damage)