# Path: actor.py
# class DoNothingActor(Actor):
#     """
#     Entities with this actor will do nothing.
#     """
#     def __init__(self):
#         super(DoNothingActor, self).__init__()
# 
#     def act(self):
#         """
#         Just returns energy spent, nothing is done.
#         """
#         return gametime.single_turn
# 
# class StunnedActor(Actor):
#     """
#     Entities with this actor will do nothing.
#     """
#     def __init__(self):
#         super(StunnedActor, self).__init__()
# 
#     def on_tick(self, time):
#         if self.parent.has("status_bar"):
#             self.parent.status_bar.add(Status.STUNNED_STATUS_DESCRIPTION)
# 
#     def act(self):
#         """
#         Just returns energy spent, shows it's stunned.
#         """
#         self.parent.char_printer.append_fg_color_blink_frames([colors.CHAMPAGNE])
#         return gametime.single_turn
# 
# Path: entityeffect.py
# class AddSpoofChild(EntityEffect):
#     def __init__(self, source_entity, spoof_child, time_to_live, message_effect=None, meld_id=None, effect_id=None,
#                  status_description=None):
#         super(AddSpoofChild, self).__init__(source_entity=source_entity,
#                                             effect_type=EffectTypes.ADD_SPOOF_CHILD,
#                                             time_to_live=time_to_live,
#                                             meld_id=meld_id,
#                                             effect_id=effect_id)
#         self.status_description = status_description
#         self.message_effect = message_effect
#         self.spoof_child = spoof_child
# 
#     def update(self, time_spent):
#         self.target_entity.add_spoof_child(self.spoof_child)
#         if self.message_effect:
#             self.message()
#         self.update_status_icon()
#         self.tick(time_spent)
# 
#     def update_status_icon(self):
#         if self.status_description and self.target_entity.has("status_bar"):
#             self.target_entity.status_bar.add(self.status_description)
# 
#     def message(self):
#         messenger.msg.send_visual_message(
#             self.message_effect % {"source_entity": self.source_entity.description.long_name,
#                                    "target_entity": self.target_entity.description.long_name},
#             self.target_entity.position.value)
# 
# Path: mover.py
# class ImmobileStepper(Stepper):
#     def __init__(self):
#         super(ImmobileStepper, self).__init__()
#         self.component_type = "stepper"
# 
#     def try_move_or_bump(self, position):
#         return self.parent.movement_speed.value


from actor import DoNothingActor, StunnedActor
from entityeffect import AddSpoofChild
from mover import ImmobileStepper
import gametime
import libtcodpy as libtcod
import turn
import direction
import geometry as geo
        neighbor_position = geo.add_2d(position, direction_)
        try:
            neighbor = dungeon_level.get_tile(neighbor_position)
            if entity.mover.can_pass_terrain(neighbor.get_terrain()):
                result_positions.append(neighbor_position)
        except IndexError:
            pass
    return result_positions


def _get_walkable_neighbors_or_unseen(position, entity, dungeon_level):
    result_positions = []
    for direction_ in direction.DIRECTIONS:
        neighbor_position = geo.add_2d(position, direction_)
        try:
            neighbor = dungeon_level.get_tile(neighbor_position)
            if (entity.mover.can_pass_terrain(neighbor.get_terrain()) or
                    not entity.memory_map.has_seen_position(neighbor_position)):
                result_positions.append(neighbor_position)
        except IndexError:
            pass
    return result_positions


def entity_skip_turn(source_entity, target_entity):
    add_spoof_effect = AddSpoofChild(source_entity, DoNothingActor(), gametime.single_turn)
    target_entity.effect_queue.add(add_spoof_effect)


def entity_stunned_turn(source_entity, target_entity):

# Path: actor.py
# class DoNothingActor(Actor):
#     """
#     Entities with this actor will do nothing.
#     """
#     def __init__(self):
#         super(DoNothingActor, self).__init__()
# 
#     def act(self):
#         """
#         Just returns energy spent, nothing is done.
#         """
#         return gametime.single_turn
# 
# class StunnedActor(Actor):
#     """
#     Entities with this actor will do nothing.
#     """
#     def __init__(self):
#         super(StunnedActor, self).__init__()
# 
#     def on_tick(self, time):
#         if self.parent.has("status_bar"):
#             self.parent.status_bar.add(Status.STUNNED_STATUS_DESCRIPTION)
# 
#     def act(self):
#         """
#         Just returns energy spent, shows it's stunned.
#         """
#         self.parent.char_printer.append_fg_color_blink_frames([colors.CHAMPAGNE])
#         return gametime.single_turn
# 
# Path: entityeffect.py
# class AddSpoofChild(EntityEffect):
#     def __init__(self, source_entity, spoof_child, time_to_live, message_effect=None, meld_id=None, effect_id=None,
#                  status_description=None):
#         super(AddSpoofChild, self).__init__(source_entity=source_entity,
#                                             effect_type=EffectTypes.ADD_SPOOF_CHILD,
#                                             time_to_live=time_to_live,
#                                             meld_id=meld_id,
#                                             effect_id=effect_id)
#         self.status_description = status_description
#         self.message_effect = message_effect
#         self.spoof_child = spoof_child
# 
#     def update(self, time_spent):
#         self.target_entity.add_spoof_child(self.spoof_child)
#         if self.message_effect:
#             self.message()
#         self.update_status_icon()
#         self.tick(time_spent)
# 
#     def update_status_icon(self):
#         if self.status_description and self.target_entity.has("status_bar"):
#             self.target_entity.status_bar.add(self.status_description)
# 
#     def message(self):
#         messenger.msg.send_visual_message(
#             self.message_effect % {"source_entity": self.source_entity.description.long_name,
#                                    "target_entity": self.target_entity.description.long_name},
#             self.target_entity.position.value)
# 
# Path: mover.py
# class ImmobileStepper(Stepper):
#     def __init__(self):
#         super(ImmobileStepper, self).__init__()
#         self.component_type = "stepper"
# 
#     def try_move_or_bump(self, position):
#         return self.parent.movement_speed.value


# Path: util.py
from actor import DoNothingActor, StunnedActor
from entityeffect import AddSpoofChild
from mover import ImmobileStepper
import gametime
import libtcodpy as libtcod
import turn
import direction
import geometry as geo

        neighbor_position = geo.add_2d(position, direction_)
        try:
            neighbor = dungeon_level.get_tile(neighbor_position)
            if entity.mover.can_pass_terrain(neighbor.get_terrain()):
                result_positions.append(neighbor_position)
        except IndexError:
            pass
    return result_positions


def _get_walkable_neighbors_or_unseen(position, entity, dungeon_level):
    result_positions = []
    for direction_ in direction.DIRECTIONS:
        neighbor_position = geo.add_2d(position, direction_)
        try:
            neighbor = dungeon_level.get_tile(neighbor_position)
            if (entity.mover.can_pass_terrain(neighbor.get_terrain()) or
                    not entity.memory_map.has_seen_position(neighbor_position)):
                result_positions.append(neighbor_position)
        except IndexError:
            pass
    return result_positions


def entity_skip_turn(source_entity, target_entity):
    add_spoof_effect = AddSpoofChild(source_entity, DoNothingActor(), gametime.single_turn)
    target_entity.effect_queue.add(add_spoof_effect)


def entity_stunned_turn(source_entity, target_entity):

    add_spoof_effect = AddSpoofChild(source_entity, StunnedActor(), gametime.single_turn)