def change_player_sex_interaction_location(active_sex_handler,
                                           location_object,
                                           interaction_context=None,
                                           interaction_type=None):
    object_identifier = SexInteractionLocationType.get_location_identifier(
        location_object)
    if TurboTypesUtil.Objects.is_game_object(location_object):
        location_object = TurboObjectUtil.GameObject.get_parent(
            location_object)
        game_object_id = TurboResourceUtil.Resource.get_id(location_object)
        location_position = get_object_fixed_position(location_object)
        location_level = TurboMathUtil.Location.get_location_level(
            TurboObjectUtil.Position.get_location(location_object))
        location_angle = TurboMathUtil.Orientation.convert_orientation_to_angle(
            TurboMathUtil.Location.get_location_orientation(
                TurboObjectUtil.Position.get_location(location_object)))
        location_route_position = TurboObjectUtil.Position.get_position(
            location_object) + get_object_fixed_direction(location_object)
    elif interaction_context is not None:
        game_object_id = -1
        location_position = get_floor_object_position(location_object,
                                                      interaction_context)
        location_level = get_floor_object_level(location_object,
                                                interaction_context)
        location_angle = random.randint(0, 360)
        location_route_position = location_position
    else:
        return
    if interaction_type is not None:
        open_change_sex_location_animations_picker_dialog(
            active_sex_handler, interaction_type, object_identifier,
            game_object_id, 0, location_position.x, location_position.y,
            location_position.z, location_level, location_angle,
            location_route_position.x, location_route_position.y,
            location_route_position.z, location_level)
    else:
        random_animation = get_random_animation(
            object_identifier,
            tuple(active_sex_handler.get_actors_sim_info_gen()))
        if random_animation is None:
            display_ok_dialog(text=2459296019, title=1890248379)
            return
        active_sex_handler.set_animation_instance(random_animation,
                                                  is_manual=True)
        active_sex_handler.set_object_identifier(object_identifier)
        active_sex_handler.set_game_object_id(game_object_id)
        active_sex_handler.set_object_height(0)
        active_sex_handler.set_location(location_position.x,
                                        location_position.y,
                                        location_position.z, location_level,
                                        location_angle)
        active_sex_handler.set_route_position(location_route_position.x,
                                              location_route_position.y,
                                              location_route_position.z,
                                              location_level)
        active_sex_handler.reassign_actors()
        active_sex_handler.restart()
def start_new_npc_sex_interaction(location_object,
                                  interaction_context=None,
                                  interaction_type=None,
                                  is_manual=False):
    location_object = TurboObjectUtil.GameObject.get_parent(location_object)
    location_identifier = SexInteractionLocationType.get_location_identifier(
        location_object)
    if TurboTypesUtil.Objects.is_game_object(location_object):
        game_object_id = TurboResourceUtil.Resource.get_id(location_object)
        location_position = get_object_fixed_position(location_object)
        location_level = TurboMathUtil.Location.get_location_level(
            TurboObjectUtil.Position.get_location(location_object))
        location_angle = TurboMathUtil.Orientation.convert_orientation_to_angle(
            TurboMathUtil.Location.get_location_orientation(
                TurboObjectUtil.Position.get_location(location_object)))
        location_route_position = TurboObjectUtil.Position.get_position(
            location_object) + get_object_fixed_direction(location_object)
    elif interaction_context is not None:
        game_object_id = -1
        location_position = get_floor_object_position(location_object,
                                                      interaction_context)
        location_level = get_floor_object_level(location_object,
                                                interaction_context)
        location_angle = random.randint(0, 360)
        location_route_position = location_position
    else:
        return
    if interaction_type is not None:
        open_sex_npc_sims_picker_dialog(location_position,
                                        interaction_type,
                                        location_identifier,
                                        game_object_id,
                                        0,
                                        TurboWorldUtil.Lot.get_active_lot_id(),
                                        location_position,
                                        location_level,
                                        location_angle,
                                        location_route_position,
                                        location_level,
                                        is_manual=is_manual)
    else:
        open_random_sex_npc_sims_picker_dialog(
            location_position,
            location_identifier,
            game_object_id,
            0,
            TurboWorldUtil.Lot.get_active_lot_id(),
            location_position,
            location_level,
            location_angle,
            location_route_position,
            location_level,
            is_manual=is_manual)
def start_new_direct_sex_interaction(sims_list,
                                     location_object,
                                     animation_instance,
                                     is_autonomy=True):
    creator_sim = TurboManagerUtil.Sim.get_sim_instance(next(iter(sims_list)))
    location_object = TurboObjectUtil.GameObject.get_parent(location_object)
    location_identifier = SexInteractionLocationType.get_location_identifier(
        location_object)
    if TurboTypesUtil.Objects.is_game_object(location_object):
        game_object_id = TurboResourceUtil.Resource.get_id(location_object)
        location_position = get_object_fixed_position(location_object)
        location_level = TurboMathUtil.Location.get_location_level(
            TurboObjectUtil.Position.get_location(location_object))
        location_angle = TurboMathUtil.Orientation.convert_orientation_to_angle(
            TurboMathUtil.Location.get_location_orientation(
                TurboObjectUtil.Position.get_location(location_object)))
        location_route_position = TurboObjectUtil.Position.get_position(
            location_object) + get_object_fixed_direction(location_object)
    elif TurboTypesUtil.Data.is_location(location_object):
        game_object_id = -1
        location_position = TurboMathUtil.Location.get_location_translation(
            location_object)
        location_level = TurboMathUtil.Location.get_location_level(
            location_object)
        location_angle = TurboMathUtil.Orientation.convert_orientation_to_angle(
            TurboMathUtil.Location.get_location_orientation(
                TurboSimUtil.Location.get_location(creator_sim)))
        location_route_position = location_position
    else:
        return False
    pre_sex_handler = PreSexInteractionHandler(
        animation_instance.get_sex_category(),
        TurboManagerUtil.Sim.get_sim_id(creator_sim),
        location_identifier,
        game_object_id,
        0,
        TurboWorldUtil.Lot.get_active_lot_id(),
        location_position.x,
        location_position.y,
        location_position.z,
        location_level,
        location_angle,
        location_route_position.x,
        location_route_position.y,
        location_route_position.z,
        location_level,
        is_autonomy=is_autonomy)
    pre_sex_handler.set_animation_instance(animation_instance)
    for sim in sims_list:
        pre_sex_handler.add_sim(TurboManagerUtil.Sim.get_sim_id(sim))
        sim_ev(sim).active_pre_sex_handler = pre_sex_handler
    return start_sex_interaction_from_pre_sex_handler(pre_sex_handler)
Exemplo n.º 4
0
def _parse_sex_animation_locations(locations_names):
    if len(locations_names) <= 0:
        return ()
    if ',' not in locations_names:
        location_data = SexInteractionLocationType.verify_location_type(
            str(locations_names).strip())
        if location_data is None:
            return ()
        return (location_data, )
    locations_list = list()
    locations_names = locations_names.split(',')
    for location_name in locations_names:
        location_name = str(location_name).strip()
        if not location_name:
            continue
        location_data = SexInteractionLocationType.verify_location_type(
            location_name.strip())
        if not location_data is None:
            if location_data == 'NONE':
                continue
            locations_list.append(location_data)
    return tuple(locations_list)
def start_new_player_sex_interaction(sim_identifier,
                                     location_object,
                                     interaction_context=None,
                                     origin_position=None,
                                     interaction_type=None):
    location_object = TurboObjectUtil.GameObject.get_parent(location_object)
    location_identifier = SexInteractionLocationType.get_location_identifier(
        location_object)
    if TurboTypesUtil.Objects.is_game_object(location_object):
        game_object_id = TurboResourceUtil.Resource.get_id(location_object)
        location_position = get_object_fixed_position(location_object)
        location_level = TurboMathUtil.Location.get_location_level(
            TurboObjectUtil.Position.get_location(location_object))
        location_angle = TurboMathUtil.Orientation.convert_orientation_to_angle(
            TurboMathUtil.Location.get_location_orientation(
                TurboObjectUtil.Position.get_location(location_object)))
        location_route_position = TurboObjectUtil.Position.get_position(
            location_object) + get_object_fixed_direction(location_object)
    elif interaction_context is not None:
        game_object_id = -1
        location_position = get_floor_object_position(location_object,
                                                      interaction_context)
        location_level = get_floor_object_level(location_object,
                                                interaction_context)
        location_angle = TurboMathUtil.Orientation.convert_orientation_to_angle(
            TurboMathUtil.Location.get_location_orientation(
                TurboSimUtil.Location.get_location(sim_identifier)))
        location_route_position = location_position
    else:
        return
    origin_position = TurboSimUtil.Location.get_position(
        sim_identifier) if origin_position is None else origin_position
    pre_sex_handler = PreSexInteractionHandler(
        interaction_type, TurboManagerUtil.Sim.get_sim_id(sim_identifier),
        location_identifier, game_object_id, 0,
        TurboWorldUtil.Lot.get_active_lot_id(), location_position.x,
        location_position.y, location_position.z, location_level,
        location_angle, location_route_position.x, location_route_position.y,
        location_route_position.z, location_level)
    sim_ev(sim_identifier).active_pre_sex_handler = pre_sex_handler
    if interaction_type is not None:
        open_start_sex_sims_picker_dialog(origin_position, pre_sex_handler)
    else:
        open_start_random_sex_sims_picker_dialog(origin_position,
                                                 pre_sex_handler)
def trigger_sex_autonomy_interaction(
    sims_pair,
    sex_location,
    sex_category_types=(SexCategoryType.ORALJOB, SexCategoryType.VAGINAL,
                        SexCategoryType.ANAL, SexCategoryType.HANDJOB,
                        SexCategoryType.FOOTJOB, SexCategoryType.TEASING)):
    object_identifier = SexInteractionLocationType.get_location_identifier(
        sex_location)
    genders = list()
    for sim in sims_pair:
        genders.append(get_sim_sex_gender(sim))
    animation_instance = None
    for sex_category_type in sex_category_types:
        if not is_sim_allowed_for_animation(sims_pair, sex_category_type):
            continue
        animation_instance = get_random_animation_of_type(
            sex_category_type,
            object_identifier,
            genders,
            ignore_animations=get_autonomy_disabled_sex_animations())
        if animation_instance is not None:
            break
    if animation_instance is None:
        return False
    if is_main_debug_flag_enabled():
        for sim in sims_pair:
            sim_name = TurboSimUtil.Name.get_name(sim)
            display_notification(title='Autonomy Triggered',
                                 text=str(sim_name[0]) + ' ' +
                                 str(sim_name[1]),
                                 secondary_icon=sim)
        if TurboTypesUtil.Objects.is_game_object(sex_location):
            display_notification(title='Autonomy Triggered',
                                 text=str(
                                     animation_instance.get_sex_category()),
                                 secondary_icon=sex_location)
        TurboWorldUtil.Time.set_current_time_speed(
            TurboWorldUtil.Time.ClockSpeedMode.PAUSED)
    return start_new_direct_sex_interaction(sims_pair,
                                            sex_location,
                                            animation_instance,
                                            is_autonomy=True)
Exemplo n.º 7
0
def _test_for_change_sex_location(interaction_context, interaction_sim, interaction_target, sex_category_types):
    if interaction_target is None:
        return False
    active_sex_handler = sim_ev(interaction_sim).active_sex_handler
    if active_sex_handler is None:
        return False
    if active_sex_handler.is_playing is False:
        return False
    if TurboTypesUtil.Objects.is_game_object(interaction_target):
        object_position = TurboObjectUtil.Position.get_position(interaction_target) + get_object_fixed_direction(interaction_target)
        target_room_id = TurboWorldUtil.Lot.get_room_id(TurboObjectUtil.Position.get_location(interaction_target), position=object_position)
    elif interaction_context is not None:
        target_room_id = TurboWorldUtil.Lot.get_room_id(TurboMathUtil.Location.get_location(get_floor_object_position(interaction_target, interaction_context), get_floor_object_level(interaction_target, interaction_context), 0))
    else:
        return False
    if target_room_id != TurboWorldUtil.Lot.get_room_id(active_sex_handler.get_location()):
        return False
    if TurboTypesUtil.Objects.is_game_object(interaction_target):
        interaction_target = TurboObjectUtil.GameObject.get_parent(interaction_target)
        if active_sex_handler.get_game_object_id() == TurboResourceUtil.Resource.get_id(interaction_target):
            return False
        if not is_sim_allowed_on_active_lot(interaction_sim) and TurboWorldUtil.Lot.is_position_on_active_lot(TurboObjectUtil.Position.get_position(interaction_target)):
            return False
    else:
        if not is_safe_floor_object_position(interaction_target, interaction_context):
            return False
        if TurboTypesUtil.Objects.is_terrain(interaction_target) and not is_sim_allowed_on_active_lot(interaction_sim) and TurboWorldUtil.Lot.is_position_on_active_lot(get_floor_object_position(interaction_target, interaction_context)):
            return False
    object_identifier = SexInteractionLocationType.get_location_identifier(interaction_target)
    genders_list = list()
    for actor_sim_info in active_sex_handler.get_actors_sim_info_gen():
        genders_list.append(get_sim_sex_gender(actor_sim_info))
    has_animations = False
    for sex_category_type in sex_category_types:
        while has_animations_with_params(sex_category_type, object_identifier, genders_list):
            has_animations = True
            break
    if has_animations is False:
        return False
    return True
Exemplo n.º 8
0
def _test_for_sex_start(interaction_context, interaction_sim,
                        interaction_target, sex_category_types):
    if interaction_target is None:
        return False
    if not is_sim_ready_for_sex(interaction_sim) or sim_ev(
            interaction_sim).active_pre_sex_handler is not None:
        return False
    if not CNSimUtils.can_have_sex(interaction_sim):
        return False
    if TurboTypesUtil.Objects.is_game_object(interaction_target):
        interaction_target = TurboObjectUtil.GameObject.get_parent(
            interaction_target)
        if not is_sim_allowed_on_active_lot(
                interaction_sim
        ) and TurboWorldUtil.Lot.is_position_on_active_lot(
                TurboObjectUtil.Position.get_position(interaction_target)):
            return False
    else:
        if not is_safe_floor_object_position(interaction_target,
                                             interaction_context):
            return False
        if TurboTypesUtil.Objects.is_terrain(
                interaction_target) and not is_sim_allowed_on_active_lot(
                    interaction_sim
                ) and TurboWorldUtil.Lot.is_position_on_active_lot(
                    get_floor_object_position(interaction_target,
                                              interaction_context)):
            return False
    object_identifier = SexInteractionLocationType.get_location_identifier(
        interaction_target)
    sim_gender = get_sim_sex_gender(interaction_sim)
    for sex_category_type in sex_category_types:
        if sex_category_type is None:
            continue
        if has_object_identifier_animations(object_identifier,
                                            sex_category_type, sim_gender):
            return True
    return False
Exemplo n.º 9
0
def _test_for_npc_sex_start(interaction_context, interaction_target,
                            sex_category_types):
    if not get_sex_setting(SexSetting.MANUAL_NPC_SEX_STATE,
                           variable_type=bool):
        return False
    if interaction_target is None:
        return False
    if TurboTypesUtil.Objects.is_game_object(interaction_target):
        interaction_target = TurboObjectUtil.GameObject.get_parent(
            interaction_target)
    elif not (TurboTypesUtil.Objects.is_terrain(interaction_target)
              and is_safe_floor_object_position(interaction_target,
                                                interaction_context)):
        return False
    object_identifier = SexInteractionLocationType.get_location_identifier(
        interaction_target)
    for sex_category_type in sex_category_types:
        while get_animation_max_amount_of_actors(
                sex_category_type, object_identifier[0]
        ) > 0 or get_animation_max_amount_of_actors(sex_category_type,
                                                    object_identifier[1]) > 0:
            return True
    return False
Exemplo n.º 10
0
def has_object_any_animations(game_object, req_gender):
    object_identifier = SexInteractionLocationType.get_location_identifier(
        game_object)
    return has_animation_with_object(object_identifier[0],
                                     req_gender) or has_animation_with_object(
                                         object_identifier[1], req_gender)
def _wickedwhims_command_test_sex_autonomy(output=None):
    output('--- Sex Autonomy Test ---')
    output('Looking for sims pairs...')
    available_sims = get_available_for_sex_sims()
    sims_pairs = get_list_of_possible_sex_pairs(available_sims)[:8]
    output('Found ' + str(len(available_sims)) + ' Sims and ' +
           str(len(sims_pairs)) + ' Sims pairs (top 6):')
    for sims_pair in sims_pairs:
        sim_name = TurboSimUtil.Name.get_name(sims_pair[0])
        target_name = TurboSimUtil.Name.get_name(sims_pair[1])
        output(' > ' + str(sim_name[0]) + ' ' + str(sim_name[1]) + ' + ' +
               str(target_name[0]) + ' ' + str(target_name[1]) + ' = ' +
               str(sims_pair[2]))
    if not sims_pairs:
        return
    sims_pair = random.choice(sims_pairs)[:2]
    sim_name = TurboSimUtil.Name.get_name(sims_pair[0])
    target_name = TurboSimUtil.Name.get_name(sims_pair[1])
    output(' ')
    output('Picked sims pair for sex location test: ' + str(sim_name[0]) +
           ' ' + str(sim_name[1]) + ' + ' + str(target_name[0]) + ' ' +
           str(target_name[1]))
    output(' ')
    autonomy_chance = get_chance_for_random_sex_autonomy(sims_pair)
    output('Current Base Success Rate: ' + str(autonomy_chance * 100) + '%')
    output(' ')
    output('Looking for sex locations...')
    location_style_and_delay = get_sex_location_style_and_chance(sims_pair)
    sims_risk = get_sims_risk_chance_for_sex_autonomy(
        sims_pair, location_style_and_delay[0])
    output(' ')
    output('Picked Location Style: ' + str(location_style_and_delay[0].name))
    output('Picked Location Success Rate: ' +
           str(location_style_and_delay[1] * 100) + '%')
    output('Sims Risk Success Rate: ' + str(sims_risk * 100) + '%')
    sex_locations_cache = dict()
    output(' ')
    for location_style in (LocationStyleType.PRIVACY,
                           LocationStyleType.COMFORT,
                           LocationStyleType.SEMI_OPEN, LocationStyleType.OPEN,
                           LocationStyleType.PUBLIC):
        sex_locations = get_sex_locations(sims_pair,
                                          location_style=location_style)
        sex_locations_cache[location_style] = sex_locations
        output('Found ' + str(len(sex_locations)) + " locations of type '" +
               str(location_style.name) + "' (top 6):")
        for sex_location in sex_locations[:6]:
            output(' > ' + str(
                SexInteractionLocationType.get_location_identifier(
                    sex_location[1])) + ', score: ' + str(sex_location[0]) +
                   ' [' + str(sex_location[1].__class__) + ']')
    output(' ')
    picked_sex_location = get_sex_autonomy_location(
        sims_pair,
        location_style=location_style_and_delay[0],
        sex_locations_override=sex_locations_cache[location_style_and_delay[0]]
    ) if location_style_and_delay[0] != LocationStyleType.NONE else None
    if picked_sex_location is not None:
        output('Picked Sex Location: ' + str(
            SexInteractionLocationType.get_location_identifier(
                picked_sex_location)) + ' [' +
               str(picked_sex_location.__class__) + ']')
        display_notification(text='Picked Sex Autonomy Location',
                             secondary_icon=picked_sex_location)
    else:
        output('Picked Sex Location: None')
    output(' ')
    output('Autonomy Test Run...')
    sims_test = random.uniform(0, 1) <= sims_risk
    output('Sims Test: ' + str('Positive' if sims_test else 'Negative'))
    autonomy_test = random.uniform(0, 1) <= autonomy_chance
    output('Autonomy Test: ' +
           str('Positive' if autonomy_test else 'Negative'))
    location_test = random.uniform(0, 1) <= location_style_and_delay[1]
    output('Location Test: ' +
           str('Positive' if location_test else 'Negative'))
    output(' ')
    output('Test Run Positive.' if autonomy_test and location_test
           and sims_test else 'Test Run Negative.')
Exemplo n.º 12
0
 def __init__(self, game_object):
     self._game_object = game_object
     self._is_accessible = self._is_accessible(game_object)
     self._sex_identifier = SexInteractionLocationType.get_location_identifier(
         game_object)
     self._has_sex_animations = self._has_object_sex_animations()