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)
Exemplo n.º 2
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
Exemplo n.º 3
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
Exemplo n.º 4
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
Exemplo n.º 5
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
Exemplo n.º 6
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
Exemplo n.º 7
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