

@log_debug
def get_target_in_direction(level, location, direction, attack_range=100):
    '\n    Get target of the attack\n\n    :param level: level to operate\n    :type level: Level\n    :param location: start location\n    :type location: (int, int)\n    :param direction: direction to follow\n    :type direction: int\n    :returns: target character if found, otherwise None\n    :rtype: Character\n    '
    target = None
    target_location = location
    target_data = None
    if (direction == 9):
        return TargetData('void', None, None, None)
    off_sets = [(0, 0), (0, (- 1)), (1, (- 1)), (1, 0), (1, 1), (0, 1), ((- 1), 1), ((- 1), 0), ((- 1), (- 1))]
    while ((target is None) and (distance_between(location, target_location) <= attack_range)):
        target_location = tuple([x for x in map(sum, zip(target_location, off_sets[direction]))])
        if blocks_movement(level, target_location):
            target_data = TargetData('wall', target_location, None, target_data)
            target = target_data
        else:
            target = get_character(level, target_location)
            if target:
                target_data = TargetData('character', target_location, target, target_data)
                target = target_data
            else:
                target_data = TargetData('void', target_location, None, target_data)
    return target_data

dataset/ETHPy150Open tuturto/pyherc/src/pyherc/data/geometry.py get_target_in_direction/original