Пример #1
0
def try_progress_sex_interaction(sex_handler, is_manual=False):
    if sex_handler.is_npc_only():
        if sex_handler.get_animation_instance().get_sex_category(
        ) == SexCategoryType.CLIMAX:
            return
        animation_duration = _get_sex_handler_animation_duration(
            sex_handler.get_animation_instance(), is_npc_only=True)
    else:
        if get_sex_setting(
                SexSetting.SEX_PROGRESSION_TYPE, variable_type=int
        ) == SexProgressionLevelSetting.DISABLED and is_manual is False:
            return
        if sex_handler.get_animation_instance().get_sex_category(
        ) == SexCategoryType.CLIMAX and not get_sex_setting(
                SexSetting.CLIMAX_SEX_PROGRESSION_STATE, variable_type=bool):
            return
        animation_duration = _get_sex_handler_animation_duration(
            sex_handler.get_animation_instance())
    if is_manual is True or sex_handler.animation_counter >= animation_duration:
        sex_handler.animation_counter = 0
        if sex_handler.next_animation_instance is not None and sex_handler.next_animation_instance != sex_handler.get_animation_instance(
        ):
            if is_sim_allowed_for_animation(
                    sex_handler.get_actors_sim_info_gen(),
                    sex_handler.next_animation_instance.get_sex_category()):
                sex_handler.set_animation_instance(
                    sex_handler.next_animation_instance,
                    is_animation_change=True)
                sex_handler.next_animation_instance = None
                sex_handler.play(is_animation_change=True)
def join_sex_interaction_from_pre_sex_handler(pre_sex_handler,
                                              join_sims_list,
                                              ask_player_to_join=False,
                                              ignore_relationship_check=False,
                                              flip_relationship_check=False):
    creator_sim_info = TurboManagerUtil.Sim.get_sim_info(
        pre_sex_handler.get_creator_sim_id())
    can_sims_join = True
    for join_sim in join_sims_list:
        is_sex_allowed = is_sim_allowed_for_animation(
            tuple(pre_sex_handler.get_actors_sim_info_gen()),
            pre_sex_handler.get_interaction_type(),
            is_joining=True)
        if not is_sex_allowed:
            display_not_allowed_message(is_sex_allowed)
            can_sims_join = False
            break
        while ignore_relationship_check is False:
            relationship_score = get_test_relationship_score(
                (creator_sim_info, join_sim))
            if relationship_score < get_relationship_sex_acceptance_threshold(
            ):
                if flip_relationship_check is True:
                    apply_asking_for_woohoo_relations(join_sim,
                                                      creator_sim_info, False)
                else:
                    apply_asking_for_woohoo_relations(creator_sim_info,
                                                      join_sim, False)
                can_sims_join = False
                break
    if can_sims_join is False:
        for join_sim in join_sims_list:
            clear_sim_sex_extra_data(join_sim, only_pre_active_data=True)
        return
    if ask_player_to_join is True:

        def ask_for_sex_callback(dialog):
            if TurboUIUtil.DramaDialog.get_response_result(dialog):
                _join_sex_interaction_from_pre_handler(pre_sex_handler,
                                                       join_sims_list)
            else:
                active_sex_handler = sim_ev(
                    pre_sex_handler.get_creator_sim_id()).active_sex_handler
                for sim in join_sims_list:
                    clear_sim_sex_extra_data(sim)
                    sim_id = TurboManagerUtil.Sim.get_sim_id(sim)
                    while sim_id not in active_sex_handler.ignore_autonomy_join_sims:
                        active_sex_handler.ignore_autonomy_join_sims.append(
                            sim_id)
            return True

        display_drama_dialog(creator_sim_info,
                             join_sims_list[0],
                             text=3899042444,
                             text_tokens=(join_sims_list[0], creator_sim_info),
                             ok_text=3398494028,
                             cancel_text=3364226930,
                             callback=ask_for_sex_callback)
        return
    _join_sex_interaction_from_pre_handler(pre_sex_handler, join_sims_list)
Пример #3
0
 def sim_picker_callback(dialog):
     if pre_sex_handler is None:
         return False
     if not TurboUIUtil.SimPickerDialog.get_response_result(dialog):
         clear_sims_sex_extra_data(
             tuple(pre_sex_handler.get_actors_sim_info_gen()))
         return False
     selected_sim_id = TurboUIUtil.SimPickerDialog.get_tag_result(dialog)
     if not selected_sim_id:
         clear_sims_sex_extra_data(
             tuple(pre_sex_handler.get_actors_sim_info_gen()))
         return False
     selected_sim_info = TurboManagerUtil.Sim.get_sim_info(
         int(selected_sim_id))
     if selected_sim_info is None:
         clear_sims_sex_extra_data(
             tuple(pre_sex_handler.get_actors_sim_info_gen()))
         return False
     is_sim_sex_allowed = is_sim_allowed_for_animation(
         tuple(pre_sex_handler.get_actors_sim_info_gen()) +
         (selected_sim_info, ), pre_sex_handler.get_interaction_type())
     if not is_sim_sex_allowed:
         display_not_allowed_message(is_sim_sex_allowed)
         clear_sims_sex_extra_data(
             tuple(pre_sex_handler.get_actors_sim_info_gen()))
         return False
     pre_sex_handler.add_sim(selected_sim_id)
     open_start_sex_animations_picker_dialog(pre_sex_handler)
     return True
Пример #4
0
def _change_sex(interaction_sim, sex_category_type):
    sex_allowed = is_sim_allowed_for_animation(sim_ev(interaction_sim).active_sex_handler.get_actors_sim_info_gen(), sex_category_type)
    if not sex_allowed:
        display_not_allowed_message(sex_allowed)
        return False
    open_change_sex_animations_picker_dialog(sim_ev(interaction_sim).active_sex_handler, sex_category_type)
    return True
Пример #5
0
def get_random_sex_category_type(object_identifier, sims_info_list):
    genders = list()
    for sim_info in sims_info_list:
        genders.append(get_sim_sex_gender(sim_info))
    animations_list = get_animations_for_object(
        object_identifier,
        genders,
        excluded_sex_category_types=(SexCategoryType.CLIMAX, ))
    allowed_for_random_animations_list = list()
    for animation in animations_list:
        while animation.is_allowed_for_random():
            allowed_for_random_animations_list.append(animation)
    animations_list = allowed_for_random_animations_list or animations_list
    available_sex_category_types = list()
    for animation in animations_list:
        while animation.get_sex_category() not in available_sex_category_types:
            available_sex_category_types.append(animation.get_sex_category())
    allowed_sex_category_types = list()
    for sex_category_type in available_sex_category_types:
        sex_allowed = is_sim_allowed_for_animation(sims_info_list,
                                                   sex_category_type)
        if not sex_allowed:
            pass
        allowed_sex_category_types.append(sex_category_type)
    if len(allowed_sex_category_types) == 0:
        return
    return random.choice(allowed_sex_category_types)
Пример #6
0
def _join_to_sex_single_interaction(sex_category_type, interaction_sim, interaction_target):
    '''
    :param interaction_sim: Sim that is joining to an existing sex interaction
    :param interaction_target: Sim that owns an existing interaction
    '''
    active_sex_handler = sim_ev(interaction_target).active_sex_handler
    if active_sex_handler is None:
        return False
    pre_sex_handler = active_sex_handler.get_pre_sex_handler(is_joining=True)
    pre_sex_handler.add_sim(interaction_sim)
    if sex_category_type is not None:
        sex_allowed = is_sim_allowed_for_animation(tuple(pre_sex_handler.get_actors_sim_info_gen()), sex_category_type, is_joining=True)
        if not sex_allowed:
            display_not_allowed_message(sex_allowed)
            return False
    if sex_category_type is not None:
        open_join_sex_animations_picker_dialog(pre_sex_handler, (interaction_sim,), sex_category_type, flip_relationship_check=True)
    else:
        random_animation = get_random_animation(pre_sex_handler.get_object_identifier(), tuple(pre_sex_handler.get_actors_sim_info_gen()))
        if random_animation is None:
            display_ok_dialog(text=1395546180, title=1890248379)
            return False
        pre_sex_handler.set_animation_instance(random_animation)
        join_sex_interaction_from_pre_sex_handler(pre_sex_handler, (interaction_sim,), flip_relationship_check=True)
    return True
Пример #7
0
def _change_sex_location(interaction_sim, interaction_target, interaction_context, sex_category_type):
    if sex_category_type is not None:
        sex_allowed = is_sim_allowed_for_animation(sim_ev(interaction_sim).active_sex_handler.get_actors_sim_info_gen(), sex_category_type)
        if not sex_allowed:
            display_not_allowed_message(sex_allowed)
            return False
    active_sex_handler = sim_ev(interaction_sim).active_sex_handler
    if active_sex_handler is None:
        return False
    change_player_sex_interaction_location(active_sex_handler, interaction_target, interaction_context=interaction_context, interaction_type=sex_category_type)
    return True
def _trigger_autonomy_join_sex_interaction(active_sex_handler, join_sim):
    object_identifier = active_sex_handler.get_object_identifier()
    genders = list()
    sims_list = list(active_sex_handler.get_actors_sim_info_gen())
    sims_list.append(join_sim)
    for sim in sims_list:
        genders.append(get_sim_sex_gender(sim))
    target_sex_category_type = active_sex_handler.get_animation_instance(
    ).get_sex_category()
    animation_instance = None
    for sex_category_type in (target_sex_category_type,
                              SexCategoryType.ORALJOB, SexCategoryType.VAGINAL,
                              SexCategoryType.ANAL, SexCategoryType.HANDJOB,
                              SexCategoryType.FOOTJOB,
                              SexCategoryType.TEASING):
        if not is_sim_allowed_for_animation(sims_list, sex_category_type):
            pass
        animation_instance = get_random_animation_of_type(
            sex_category_type,
            object_identifier,
            genders,
            ignore_animations=get_autonomy_disabled_sex_animations())
        while animation_instance is not None:
            break
    if animation_instance is None:
        return False
    pre_sex_handler = active_sex_handler.get_pre_sex_handler(is_joining=True)
    pre_sex_handler.set_animation_instance(animation_instance)
    for sim in sims_list:
        pre_sex_handler.add_sim(sim)
    creator_sim = TurboManagerUtil.Sim.get_sim_info(
        pre_sex_handler.get_creator_sim_id())
    ask_player_to_start = False
    if get_sex_setting(
            SexSetting.AUTONOMY_PLAYER_ASK_PLAYER_DIALOG_STATE,
            variable_type=bool) and TurboSimUtil.Sim.is_player(
                creator_sim) and TurboSimUtil.Sim.is_player(join_sim):
        ask_player_to_start = True
    elif get_sex_setting(
            SexSetting.AUTONOMY_NPC_ASK_PLAYER_DIALOG_STATE,
            variable_type=bool) and TurboSimUtil.Sim.is_player(
                creator_sim) and TurboSimUtil.Sim.is_npc(join_sim):
        ask_player_to_start = True
    elif get_sex_setting(
            SexSetting.AUTONOMY_PLAYER_ASK_NPC_DIALOG_STATE,
            variable_type=bool) and TurboSimUtil.Sim.is_npc(
                creator_sim) and TurboSimUtil.Sim.is_player(join_sim):
        ask_player_to_start = True
    join_sex_interaction_from_pre_sex_handler(
        pre_sex_handler, (join_sim, ),
        ask_player_to_join=ask_player_to_start,
        ignore_relationship_check=True)
    return True
Пример #9
0
 def join_sims_picker_callback(dialog):
     if pre_sex_handler is None:
         return False
     if not TurboUIUtil.SimPickerDialog.get_response_result(dialog):
         return False
     picked_sims_ids = TurboUIUtil.SimPickerDialog.get_tag_results(dialog)
     if not picked_sims_ids:
         return False
     picked_sims = list()
     for sim_id in picked_sims_ids:
         sim_info = TurboManagerUtil.Sim.get_sim_info(int(sim_id))
         if sim_info is None:
             return False
         picked_sims.append(sim_info)
     for sim_info in picked_sims:
         pre_sex_handler.add_sim(sim_info)
     genders_list = list()
     for sim_info in pre_sex_handler.get_actors_sim_info_gen():
         genders_list.append(get_sim_sex_gender(sim_info))
     if sex_category_type is not None:
         sex_allowed = is_sim_allowed_for_animation(tuple(picked_sims),
                                                    sex_category_type,
                                                    is_joining=True)
         if not sex_allowed:
             display_not_allowed_message(sex_allowed)
             return False
         has_animations = False
         if has_animations_with_params(
                 sex_category_type, pre_sex_handler.get_object_identifier(),
                 genders_list):
             has_animations = True
         if has_animations is False:
             display_ok_dialog(text=2693069513,
                               title=get_sex_category_animations_stbl_name(
                                   sex_category_type))
             return False
         open_join_sex_animations_picker_dialog(pre_sex_handler,
                                                picked_sims,
                                                sex_category_type)
     else:
         random_animation = get_random_animation(
             pre_sex_handler.get_object_identifier(),
             tuple(pre_sex_handler.get_actors_sim_info_gen()))
         if random_animation is None:
             display_ok_dialog(text=2693069513, title=1890248379)
             return False
         pre_sex_handler.set_animation_instance(random_animation)
         join_sex_interaction_from_pre_sex_handler(pre_sex_handler,
                                                   picked_sims)
     return True
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)
Пример #11
0
 def npc_sims_picker_callback(dialog):
     clear_menu_sim()
     if not TurboUIUtil.SimPickerDialog.get_response_result(dialog):
         return False
     picked_sims_ids = TurboUIUtil.SimPickerDialog.get_tag_results(dialog)
     if not picked_sims_ids:
         return False
     picked_sims = list()
     for sim_id in picked_sims_ids:
         sim_info = TurboManagerUtil.Sim.get_sim_info(int(sim_id))
         if sim_info is None:
             return False
         picked_sims.append(sim_info)
     is_sim_sex_allowed = is_sim_allowed_for_animation(
         picked_sims, sex_category_type)
     if not is_sim_sex_allowed:
         display_not_allowed_message(is_sim_sex_allowed)
         return False
     pre_sex_handler = PreSexInteractionHandler(
         sex_category_type,
         TurboManagerUtil.Sim.get_sim_id(next(iter(picked_sims))),
         location_identifier,
         game_object_id,
         object_height,
         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,
         route_level,
         is_manual=is_manual)
     for sim_info in picked_sims:
         pre_sex_handler.add_sim(sim_info)
         sim_ev(sim_info).active_pre_sex_handler = pre_sex_handler
     open_start_npc_sex_animations_picker_dialog(pre_sex_handler)
     return True
Пример #12
0
def get_random_animation(object_identifier, sims_info_list):
    genders = list()
    for sim_info in sims_info_list:
        genders.append(get_sim_sex_gender(sim_info))
    disallowed_sex_category_types = [SexCategoryType.CLIMAX]
    for sex_category_type in (SexCategoryType.HANDJOB, SexCategoryType.ORALJOB,
                              SexCategoryType.TEASING, SexCategoryType.VAGINAL,
                              SexCategoryType.ANAL, SexCategoryType.FOOTJOB):
        sex_allowed = is_sim_allowed_for_animation(sims_info_list,
                                                   sex_category_type)
        if sex_allowed:
            pass
        disallowed_sex_category_types.append(sex_category_type)
    animations_list = get_animations_for_object(
        object_identifier,
        genders,
        excluded_sex_category_types=disallowed_sex_category_types)
    if not animations_list:
        return
    allowed_for_random_animations_list = list()
    for animation in animations_list:
        while animation.is_allowed_for_random():
            allowed_for_random_animations_list.append(animation)
    return random.choice(allowed_for_random_animations_list or animations_list)